简体   繁体   English

Python或R! -为指定的光栅文件绘制直方图

[英]Python or R! - draw histograms for specified raster files

I have two raster files (one with big cell size and second with much smaller.) I have written a Python script which splits these files into pieces limited by bigger cells. 我有两个栅格文件(一个栅格文件较大,另一个栅格文件较小)。我编写了Python脚本,将这些文件分成较大的栅格所限制。

Now I want to draw a histogram for cell values and add value (for example as a line) from the bigger cell. 现在,我想为单元格值绘制直方图,并从较大的单元格中添加值(例如,作为一条线)。 Unfortunately I don't know how to do it in R (it may be useful, because I want to do this operation for many folders) 不幸的是,我不知道如何在R中执行此操作(这可能很有用,因为我想对许多文件夹执行此操作)

Could you help me? 你可以帮帮我吗?

Without more information, all I can tell you is to look into matplotlib , specifically the hist() function. 没有更多信息,我只能告诉您matplotlib ,尤其是hist()函数。 http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.hist http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.hist

In R, it's much the same as in Python: 在R中,它与Python中的相同:

hist(data) 

There is a useful introduction to the raster package in the vignette: 小插图中的栅格软件包有一个有用的介绍:

http://cran.r-project.org/web/packages/raster/vignettes/Raster.pdf http://cran.r-project.org/web/packages/raster/vignettes/Raster.pdf

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM