Menu

ztic doesn't cover the entire range.

Help
2017-11-10
2017-11-10
  • Vijay Dubey

    Vijay Dubey - 2017-11-10

    hello,

    i am using the following gnuplot code to create a parameteric curve in gnuplot.


    set terminal postscript eps size 5,3 enhanced color font 'Helvetica,20' lw 2
    set output 'output.eps'
    r=1
    T=10
    pi=3.14159
    set parametric
    set urange [0:T*pi]
    fy(u) = rcos(u)
    fx(u) = r
    sin(u)
    fz(u) = u
    set title "Plot of t->(sin(t),cos(t),t for t=0 to 10pi)"
    set xtics -1,0.5,1
    set ytics -1,0.5,1
    set ztics 0,5,40
    %set ztics add ("h" 35)
    set arrow from 0,1,0 to sin(T
    pi),cos(Tpi),Tpi
    unset key
    set label 1 at sin(Tpi),cos(Tpi),T*pi 'Q'
    set label 2 at 0,1,0 'P'
    splot fx(u),fy(u),fz(u) lc 'black'


    I have mentioned the range for ztic from 0 to 40 and the maximum value that z assumes on plot is 31.4159 which means 35 should appear as tic on z. But this doesn't happen. I tried to even add 35 as tic forcibly using "set ztics add ("something" tic-value)" command but it still doesn't work. What should i add or remove so that 35 also appears as ztic ?

     

    Last edit: Vijay Dubey 2017-11-10
  • Bastian Märkisch

    show zrange would tell you that the autorange actually ends at 10 pi... Hence explicitely setting

    zrange [0:40]
    

    solves your particular problem. For more on ranges see help set xrange.

     
  • Hans-Bernhard Broeker

    which means 35 should appear as tic on z.

    No, it doesn't mean that. Those commands you gave define the range in which the tics will be displayed. But that doesn't all by itself make the actual range of the axis extend all the way up to 40. For that, you have to change the zrange, not the tic setting.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.