2-D contour plot with gnuplot

  1. Hello
    with gnuplot
    I need to have 2d contour plot from a file (say ss.dat) with three column, first and secend columns are X and Y respectively and the third column is magnitude (I need to have this magnitude with labels on it in 2d plot).

    Thanks in advance
  2. jcsd
  3. Assuming your file contains grid data, the basic commands to generate a contour plot would be

    set contour base
    unset sur
    set view map
    splot 'file'

    gnuplot will generate a key mapping dash patterns in the contours to values. If you want actual numerical labels printed on the contours, you have to resort to tricks. I describe one way to do it in the gnuplot Cookbook.
  4. Thank you very much. my file dose not have grid data. it just has three coulmn first is "x"axis second "y" and third is just the data I want to have the plot of. How can I grid x and y axis.

  5. Your data might already be in grid form, depending on how it is organized. Type "help grid_data" at the gnuplot interactive prompt to find out what this means. Even if it is not, the plot might work. Try it and see. If your data is scattered you might be able to plot it after letting gnuplot convert it into a grid arrangement. Type "help dgrid3d" to find out how to do this.
Know someone interested in this topic? Share a link to this question via email, Google+, Twitter, or Facebook