Box n whisker from CSV with octave

邮差的信 提交于 2019-12-11 10:28:24

问题


I'm totally new to Octave but thought I'd give it a try since I need to create a box and whisker plot from a raster image with height values.

I've managed to export my GeoTIFF image to some sort of .CSV-file, it can be accessed from here and it uses "." for decimals and ";" as the delimiter between cells.

When I run dlmread ("test.csv",, ";", 0, 0) the results indicate that the data is split up in multiple columns? And on top of that I have zero-values (0) which isn't present in test.csv, see screenshot below from Octave:

First of all I was under the impression that to create a box and whisker plot I needed to have the data in one column, not a couple of hundred like in this case. And secondly; what am I doing wrong when I'm getting all these zeroes?

Could someone point out how to properly import the above CSV to octave. And if you feel really generous I would be so thankful if you also could help me to create a box and whisker plot from the attached data.

I'm using Octave 4.2.1 x86_64 on Windows 10 home.


回答1:


It's really difficult to figure out what you really want and it might be much easier to use the GeoTIFF directly without needing to go through multiple (yet obscure) conversions.

But here is a wild guess:

pkg load statistics

s = urlread ("https://drive.google.com/uc?export=download&id=1RzJ-EO0OXgfMmMRG8wiCBz-51RcwSM5h");
o = str2double (strsplit (s, ";"));
o(isnan (o)) = [];

subplot (3, 1, 1);
plot (o)
grid on

subplot (3, 1, 2);
hist (o, 100);

subplot (3, 1, 3);
boxplot (o)

print out.png

gives you the raw data, the histogram and a boxplot with center, spread, departure from symmetry and whiskers:



来源:https://stackoverflow.com/questions/48099439/box-n-whisker-from-csv-with-octave

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!