Plot 2D tables as a fence in gnuplot
A simple question about gnuplot. i have a data represented in开发者_JAVA百科 a table, that spans further in each direction.
0 1 2 3 4
1 1 2.0408830835 2.8180454121 3.9760428593
2 2.0622871101 3.9709816613 5.7664953944 7.5379858295
3 3.1861064949 5.7565758609 7.8939354949 9.7787163957
4 4.0944785549 6.4357145355 9.5787145459 11.6365303155
5 4.7675231829 6.3181833785 8.8833920556 11.4107253565
....
I want to plot this as a surface or fence in gnuplot, so that first column represents X, first row represents Y, and data at position {x,y} in the table represents Z, the height of the graph.
Is there a way to do it? Thanks!
If do not have gridded data then the following might do the trick for you:
Take a data file "Data.csv":
0.65 0.99 0.28 0.43 0.50
0.98 0.23 0.15 0.94 0.19
0.57 0.65 0.38 0.31 0.20
0.15 0.08 0.88 0.16 0.64
0.37 0.84 0.87 0.59 0.41
and plot it like so:
splot "Data.csv" matrix w lines
Gnuplot will index your data from 0
to n
/m
. If you want to specify the point (x, y)
in space for each data point then you need to specify a grid that tells gnuplot where each point is actually located.
精彩评论