Menu

contour in gnuplot

Help
2016-11-11
2016-11-11
  • mohammed mouhcine

    my script:::

    # Set terminal and output 
    set terminal postscript enhanced color 
    set output 'plot.ps' 
    # Set various features of the plot 
    set pm3d 
    unset surface  # don't need surfaces 
    set view map 
    set contour 
    set key outside 
    set cntrparam cubicspline  # smooth out the lines 
    set cntrparam levels 50    # sets the num of contour lines 
    set pm3d interpolate 20,20 # interpolate the color 
    # Set a nice color palette 
    set palette model RGB defined ( 0"black", 1"blue", 
    2"cyan",3"green",4"yellow",\ 
         5"red",8"purple" ) 
    # Axes 
    set xlabel 'X' 
    set ylabel 'Y' 
    set format x '%.1f' 
    set format y '%.1f' 
    set format z '%.2f' 
    set size square 
    # Now plot 
    splot 'data.dat' using 1:2:3 notitle with lines lt 1
    

    data file :::

     0.00000 0.00000 0.00000 
     0.10000 0.00000 0.00000 
     0.20000 0.00000 0.00000 
     0.30000 0.00000 0.00000 
     0.40000 0.00000 0.00000 
     0.50000 0.00000 0.00000 
     0.60000 0.00000 0.00000 
     0.70000 0.00000 0.00000 
     0.80000 0.00000 0.00000 
     0.90000 0.00000 0.00000 
     1.00000 0.00000 0.00000 
     0.00000 0.10000 0.00000 
     0.10000 0.10000 0.00869 
     0.20000 0.10000 0.01654 
     0.30000 0.10000 0.02276 
     0.40000 0.10000 0.02676 
     0.50000 0.10000 0.02813 
     0.60000 0.10000 0.02676 
     0.70000 0.10000 0.02276 
     0.80000 0.10000 0.01654 
     0.90000 0.10000 0.00869 
     1.00000 0.10000 0.00000
    

    in complation : erreur after compulation:::
    "d.gnu", line 14: undefined variable: quot

     
    • Ethan Merritt

      Ethan Merritt - 2016-11-11

      On Friday, 11 November 2016 08:46:39 PM mohammed mouhcine wrote:

      The script and data file work for me, with one change.

      • When the commands are issued as shown, I get the warning message
        line 21: warning: Cannot contour non grid data. Please use "set dgrid3d".

      • When I add the line "set dgrid3d", the commands produce a pm3d+contour
        plot as requested.

      tested in versions 4.6.6 5.0.5 and current cvs

      Ethan
      

      my script:::
      ~~~

      Set terminal and output

      set terminal postscript enhanced color
      set output 'plot.ps'

      Set various features of the plot

      set pm3d
      unset surface # don't need surfaces
      set view map
      set contour
      set key outside
      set cntrparam cubicspline # smooth out the lines
      set cntrparam levels 50 # sets the num of contour lines
      set pm3d interpolate 20,20 # interpolate the color

      Set a nice color palette

      set palette model RGB defined ( 0"black", 1"blue",
      2"cyan",3"green",4"yellow",\
      5"red",8"purple" )

      Axes

      set xlabel 'X'
      set ylabel 'Y'
      set format x '%.1f'
      set format y '%.1f'
      set format z '%.2f'
      set size square

      Now plot

      splot 'data.dat' using 1:2:3 notitle with lines lt 1
      ~~~

      data file :::
      ~~~
      0.00000 0.00000 0.00000
      0.10000 0.00000 0.00000
      0.20000 0.00000 0.00000
      0.30000 0.00000 0.00000
      0.40000 0.00000 0.00000
      0.50000 0.00000 0.00000
      0.60000 0.00000 0.00000
      0.70000 0.00000 0.00000
      0.80000 0.00000 0.00000
      0.90000 0.00000 0.00000
      1.00000 0.00000 0.00000
      0.00000 0.10000 0.00000
      0.10000 0.10000 0.00869
      0.20000 0.10000 0.01654
      0.30000 0.10000 0.02276
      0.40000 0.10000 0.02676
      0.50000 0.10000 0.02813
      0.60000 0.10000 0.02676
      0.70000 0.10000 0.02276
      0.80000 0.10000 0.01654
      0.90000 0.10000 0.00869
      1.00000 0.10000 0.00000
      ~~~
      in complation : erreur after compulation:::
      "d.gnu", line 14: undefined variable: quot


      contour in gnuplot


      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/gnuplot/discussion/5925/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       
  • mohammed mouhcine

    thanks, it works

     

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.