Gnuplot - how to scale xyrange to not take into account small z in heatmap plot

后端 未结 1 945
猫巷女王i
猫巷女王i 2021-01-22 00:22

I have a data file _FullWV.dat and I want Gnuplot to automatically scale xyrange if outside the wanted region z < 10^(-8), is there any way to make it?

Graph is here

1条回答
  •  终归单人心
    2021-01-22 01:15

    Code

    set size ratio -1
    splot '_FullWV.dat' u (abs($3)<1e-5 ? NaN : $2*cos($1)):($2*sin($1)):3
    

    1e-8 was too small, it cut almost nothing from the original range.

    Explanation

    abs($3)<1e-5 ? NaN : $2*cos($1)
    

    If z (3rd column) is between -1e-5 and 1e-5, leave x undefined (Not a Number). If x is undefined, no point will be displayed, even if y and z are defined.

    If z is outside this range, define x as $2*cos($1).

    Note that for pm3d, at least 2 consecutive values are needed for a point to be displayed. It means that 1 lone value will be take into account by autoscale, but will not be displayed.

    set size ratio -1
    

    means that one unit on the x scale will be as big as one unit on the y scale : a circle might be displayed as an ellipse otherwise.

    0 讨论(0)
提交回复
热议问题