Search code examples
gnuplot

Trying to Mimic depth and Orientation in gnuplot


I am attempting to plot a data series on xyz axis. I have successfully splotted the data series I want, but cannot get a pleasing orientation and depth to view the graph. When I try to orient the Z axis like that of the example graph, it changes positioning (I am using windows mode on gnuplot). In the process I tend to lose view of my axes and some curves in the data series get eclipsed by others. Any recommendations on how I can improve my graph in progress would be greatly appreciated, thank you Graph in progress Example Graph

p.s. Do not mind the legend, I plan on getting rid of it.

X1 Y1 Z1 X2 Y2 Z2
0 100 0 0 75 1
500 24 0 500 14 14

X1 | Y1 | Z1| X2| Y2 | Z2
| --- | --- | ---|---| ---| --|
| 0 | 100 | 0 | 0 | 75 | 1|
| 500| 24| 0| 500| 14| 14| 1

0 78.641 0 0 74.725 1 0 72.148 2 0 75.504 3 0 72.244 5 0 72.839 12 1 78.094 0 1 74.499 1 1 72.793 2 1 76.035 3 1 72.25 5 1 72.81 12 2 77.924 0 2 74.969 1 2 72.569 2 2 75.912 3 2 72.311 5 2 72.666 12 3 78.142 0 3 75.283 1 3 71.873 2 3 75.537 3 3 72.649 5 3 73.274 12 4 77.854 0 4 75.441 1 4 72.214 2 4 75.68 3 4 72.393 5 4 73.344 12


Solution

  • If you want to plot your data in such a way (waterfall/fence), you need to have some "suitable" data for this. Otherwise some other representation might be better. Take the following example as starting point. Although, I am not yet fully convinced about the result and perhaps you might experience some surprises with the representation of the plot when you rotate it. The code certainly needs to be adapted to your detailed requirements which are misssing.

    Code:

    ### "waterfall/fence" plot 
    reset session
    
    $Data <<EOD
    0   78.641   0   0   74.725   1   0   72.148   2   0   75.504   3   0   72.244   5   0   72.839   12
    1   78.094   0   1   74.499   1   1   72.793   2   1   76.035   3   1   72.25    5   1   72.81    12
    2   77.924   0   2   74.969   1   2   72.569   2   2   75.912   3   2   72.311   5   2   72.666   12
    3   78.142   0   3   75.283   1   3   71.873   2   3   75.537   3   3   72.649   5   3   73.274   12
    4   77.854   0   4   75.441   1   4   72.214   2   4   75.68    3   4   72.393   5   4   73.344   12
    EOD
    
    set style fill transparent solid 0.5
    set xyplane at 70
    set key noautotitle
    set view 66,106
    set grid x,y
    set xtic 1
    set ytics offset 0,-0.5
    set zrange [70:80]
    
    splot for [i=1:6] $Data u i*3-2:i*3:i*3-1 w lp pt 7 lc i, \
          for [i=1:6] $Data u i*3-2:i*3:i*3-1:(70):i*3-1 w zerrorfill lc i ti sprintf("%d",i)
    ### end of code
    

    Result:

    enter image description here