Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #3379 > unrolled thread

plot 2d contour with contour labels from nonuniform matrix data file

Started byxlrotor@gmail.com
First post2016-09-02 13:25 -0700
Last post2016-09-08 14:49 -0700
Articles 8 — 2 participants

Back to article view | Back to comp.graphics.apps.gnuplot


Contents

  plot 2d contour with contour labels from nonuniform matrix data file xlrotor@gmail.com - 2016-09-02 13:25 -0700
    Re: plot 2d contour with contour labels from nonuniform matrix data file Gavin Buxton <gavinbuxton@gmail.com> - 2016-09-03 08:36 -0700
    Re: plot 2d contour with contour labels from nonuniform matrix data file xlrotor@gmail.com - 2016-09-05 21:59 -0700
      Re: plot 2d contour with contour labels from nonuniform matrix data file Gavin Buxton <gavinbuxton@gmail.com> - 2016-09-06 10:02 -0700
        Re: plot 2d contour with contour labels from nonuniform matrix data file xlrotor@gmail.com - 2016-09-07 12:26 -0700
          Re: plot 2d contour with contour labels from nonuniform matrix data file xlrotor@gmail.com - 2016-09-07 21:46 -0700
            Re: plot 2d contour with contour labels from nonuniform matrix data file Gavin Buxton <gavinbuxton@gmail.com> - 2016-09-08 07:02 -0700
              Re: plot 2d contour with contour labels from nonuniform matrix data file xlrotor@gmail.com - 2016-09-08 14:49 -0700

#3379 — plot 2d contour with contour labels from nonuniform matrix data file

Fromxlrotor@gmail.com
Date2016-09-02 13:25 -0700
Subjectplot 2d contour with contour labels from nonuniform matrix data file
Message-ID<6f06402f-3def-454b-a66c-2218f6a8b93d@googlegroups.com>
I have been able to generate a 2d contour plot from a nonuniform matrix data file by using
set contour
unset surface
set view map
splot 'datafile' nonuniform matrix with lines

But I can't figure out how to get contour labels.
I would also like to control how many contour labels are created.
I am using Windows 7.
Thanks

[toc] | [next] | [standalone]


#3380

FromGavin Buxton <gavinbuxton@gmail.com>
Date2016-09-03 08:36 -0700
Message-ID<48d7a28e-7bd1-4e6c-bcec-69bd3213ef12@googlegroups.com>
In reply to#3379
Don't know if this would work, but you might be able to output your contour as a table, and then plot each contour as a line in a 2D plot. To change the contour number you could use cntrparam. I haven't looked at the nonuniform matrix stuff, but presume this is not too dissimilar to dgrid3d? But the outputing to a table, and then plotting the lines in the new file was the only way to change contour colors at one time.

[toc] | [prev] | [next] | [standalone]


#3386

Fromxlrotor@gmail.com
Date2016-09-05 21:59 -0700
Message-ID<458077e6-9c18-415f-af98-755467b9c648@googlegroups.com>
In reply to#3379
I've tried the table method with 2d plot, but I couldn't get the plot I want.

I have 
10 x values.
180 y values (not equally spaced).
1800 z values.

If I put each of these in a separate data block in the same data file, how can I specify them in an splot command?  Sort of like...
   splot 'datafile' using x:y:z with lines
but x, y and z are different data blocks read from the same file.

[toc] | [prev] | [next] | [standalone]


#3387

FromGavin Buxton <gavinbuxton@gmail.com>
Date2016-09-06 10:02 -0700
Message-ID<db4f0c63-3d99-4c0b-97cc-0a377a109796@googlegroups.com>
In reply to#3386
The not equally spaced part should be cool, but you might have to rewrite your data in a different format: 

http://psy.swansea.ac.uk/staff/carter/gnuplot/gnuplot_3d.htm

is the norm. Although I haven't tried the new "nonuniform matrix" bit you originally mentioned, which might work out better. 

There's a quick example of the table output for plotting contours at the bottom of this page:

http://lowrank.net/gnuplot/plot3d-e.html

Hope that helps.

[toc] | [prev] | [next] | [standalone]


#3390

Fromxlrotor@gmail.com
Date2016-09-07 12:26 -0700
Message-ID<70b43aec-d46e-461e-a284-343b21d8a079@googlegroups.com>
In reply to#3387
The stuff I posted in the other thread "Plotting data array as variable (not in files)"
https://groups.google.com/forum/#!topic/comp.graphics.apps.gnuplot/UdiiC2cBQNo
is working great.

The problem was, for some unknown reason, splot would create a 2d contour plot with lines, but not with labels.  This problem only happened with a nonuniform matrix input file.

[toc] | [prev] | [next] | [standalone]


#3392

Fromxlrotor@gmail.com
Date2016-09-07 21:46 -0700
Message-ID<c431b133-3cfb-433b-9cd0-b887aedc594d@googlegroups.com>
In reply to#3390
I figure out my problem getting lines and labels together on the same contour plot from a nonuniform matrix.  I needed to specify "using 1:2:3".  Once I did that, everything worked :)

I don't need to use the array trick or multiplot.  But I learned a lot through the struggle.

[toc] | [prev] | [next] | [standalone]


#3393

FromGavin Buxton <gavinbuxton@gmail.com>
Date2016-09-08 07:02 -0700
Message-ID<de8caf21-31d3-4a33-93d5-b2f1a8a007c5@googlegroups.com>
In reply to#3392
I'm curious to see how it turned out... any chance of a pic? 

[toc] | [prev] | [next] | [standalone]


#3394

Fromxlrotor@gmail.com
Date2016-09-08 14:49 -0700
Message-ID<326804c2-50a4-41a9-9c94-67dfb2114ff0@googlegroups.com>
In reply to#3393
> I'm curious to see how it turned out... any chance of a pic?

Here are the commands.  I am using Internet Explorer 11 and I don't see any way to attach an image.

set view map scale 1
unset surface 
set contour base
set cntrlabel  format '%8.3g' font ',7' start 10 interval 20
unset hidden3d
set cntrparam levels discrete 0,25 ,50 ,75 ,100 ,200 ,300 ,400 ,500 ,600 ,700 ,800 ,900 
set xlabel "Axial, inches" 
set ylabel "Circumferential, degrees" 
set title "Hydrodynamic Pressure, psi" 
splot 'gridnonuni.dat' nonuniform matrix u 1:2:3  with lines, '' nonuniform matrix u 1:2:3 with labels

[toc] | [prev] | [standalone]


Back to top | Article view | comp.graphics.apps.gnuplot


csiph-web