Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1239 gnuplot parametric plot bug

closed-works-for-me
nobody
None
5
2015-03-23
2013-05-06
Larry
No

gnuplot 4.4 patchlevel 3

The plotting script is included below.

executed with,
script not used cb view
./plot.sh 0 GMF.gif 0 360 90 0
./plot.sh 0 GMF.gif 0 360 45 0
./plot.sh 0 GMF.gif 0 360 135 0

first and third work, second does not.
The first and third script execution producd the correct plot. The second line produced a plot with continents and lat lon lines correct but the 2d array plotted as if view was set to 135,0.
gnuplot << EOF

set term gif giant enhance size 800,600 font "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf, 15"
set output 'GMF.gif'
#set term svg size 800,600 font "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf, 15"
#set output '$2'

reset
set bmargin at screen 0.07
set tmargin at screen 0.88
set lmargin at screen 0.15
set rmargin at screen 0.75
#set format ''
#set tic scale 0
unset xtic
unset ytic
unset ztic
unset xlabel
unset ylabel
unset zlabel
set format x ""
set format y ""
set format z ""

set label 'TECu' at screen 0.82,0.22
set label 'TEC' at screen 0.37,0.96

set palette file '72colors.dat'
set colorbox vertical
set colorbox user origin 0.82,0.25 size 0.025,0.5

unset key
unset border
set mapping spherical
set angle degrees
set hidden3d front
set xyplane at -1
set view $5,$6
set parametric
set isosamples 25,19
set urange [0:360]
set vrange [-90:90]
set cbrange [$3:$4]
#set cbrange [0:3]
set xrange [-1:1]
set yrange [-1:1]
#set pm3d interpolate 5,5

r = 0.99
splot rcos(v)cos(u),rcos(v)sin(u),r*sin(v) w l lw 1.5 lc 0, \ '2d.txt' u 1:2:(1):3 w pm3d, \ 'world.dat' u 1:2:(1) w l lw 1.5 lc -1, \ 'gridlabel.txt' u 1:2:(1):3 w labels front font "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf, 12"

unset output

EOF

1 Attachments

Discussion

  • Ethan Merritt
    Ethan Merritt
    2013-05-06

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -10,7 +10,7 @@
    
     first and third work, second does not.
     The first and third script execution producd the correct plot.  The second line produced a plot with continents and lat lon lines correct but the 2d array plotted as if view was set to 135,0.
    -
    +~~~~
     gnuplot << EOF
    
     set term gif giant enhance size 800,600 font "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf, 15"
    @@ -69,4 +69,4 @@
     unset output
    
     EOF
    -
    +~~~~
    
     
  • Ethan Merritt
    Ethan Merritt
    2013-05-06

    Are you sure that is the command you used?
    All I get is an error message:
    line 45: parametric function not fully specified

    And indeed, the splot command seems to consist of one parametric function and then pieces of 3 non-parametric functions.

     
    • Larry
      Larry
      2013-05-07

      Here is the whole test file case in a gzip file. To crate the plots you now use ./plot.sh 0 0 where 0 0 is the numbers for the veiw command. now it seems to be doing the opposite of what it was when I sent the bug report. I can tilt the globe with view set from 0 0 to 90 0, but when it is set to >90 0 the 2d plot is distorted. The 2d plot is a simple latitude gradient with low in the north and high in the south.

       
      Attachments
  • Ethan Merritt
    Ethan Merritt
    2013-05-07

    I think you are not passing the view parameters you intended.
    If I understand correctly the view[s] you are aiming for, they correspond to
    set view 90, N
    where N varies from 0 to 360.

    But instead your test is passing in
    set view N, 0

    At some cardinal angles these happen to work out to similar views, but that's coincidence.

     
    • Larry
      Larry
      2013-05-08

      Ok, here is another example which is taken from the internet. This is supposed to be the correct use of the parametric gnuplot function.

      It plots to the terminal instead of a file, and you can rotate the globe with the mouse instead of having to keep changing the view command.

      Notice that rotating around the north pole all is well. But when you try to roatate to the southern pole the color plot then rotates wrong.

       
      Attachments
  • Ethan Merritt
    Ethan Merritt
    2013-05-08

    What do you mean "rotates wrong"?
    For me the demo rotates correctly in both version 4.4 and current version 4.6. The left/right arrow keys cause rotation about the vertical axis; the up/down arrow keys cause rotation about the horizontal axis. Were you expecting something else?

     
  • Ethan Merritt
    Ethan Merritt
    2013-05-20

    • status: open --> open-works-for-me
     
  • Ethan Merritt
    Ethan Merritt
    2013-05-27

    • status: open-works-for-me --> closed-works-for-me