如何以最佳方式可视化来自二进制文件的地图? [英] how to visualize a map from a binary file in the best way?
本文介绍了如何以最佳方式可视化来自二进制文件的地图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
下面给出的此代码将读取二进制文件,并简单地可视化地图,如下所示这是文件的链接
this code given bellow will read a binary file and simply visualize the map as shown bellow Here is a link to the file
firsrow <- file("C:\\LaiAverage_2011_WGS84_50km.img", "rb")
row1 = readBin(firsrow, integer(), size = 2, n = 720*360, signed = F)
y <- matrix(data = row1, ncol = 360, nrow = 720)
image(t(t(y)), ylim=c(1,0)).
谁能帮助我以这种方式可视化它:
can anyone help me to visualize it like this instead:
推荐答案
您的问题非常广泛且含糊,因此我的回答将具有这些特质.另外,我将重点介绍基于ggplot2的解决方案.
Your question is quite broad and vague, therefore my answer will share those qualities. In addition, I will focus on a ggplot2 based solution.
- 要更改填充颜色,请查看
scale_fill _ *
,其中*例如连续
或渐变
. - 要更改x和y轴的布局,请查看
scale_ {x,y} _ *
,例如labels
和breaks
参数. - 要获得高分辨率输出,请另存为pdf或高分辨率png.我非常喜欢为此使用
ggsave
.
- To change the fill color, look at
scale_fill_*
, where * is e.g.continuous
orgradient
. - to change the layout of the x and y axis, look at
scale_{x,y}_*
, e.g. thelabels
andbreaks
arguments. - To get high-res output, either save as pdf or high res png. I greatly prefer using
ggsave
for this.
这篇关于如何以最佳方式可视化来自二进制文件的地图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文