[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Contour plots
From: |
Henry F. Mollet |
Subject: |
Re: Contour plots |
Date: |
Mon, 07 Mar 2005 09:22:42 -0800 |
User-agent: |
Microsoft-Entourage/10.1.1.2418 |
Thanks, I'll try GnuPlot directly one more time. I was getting nowhere the
first time around but your code below should help a great deal.
Henry
on 3/7/05 3:53 AM, Peter Gawthrop at address@hidden wrote:
> Hi Henry,
>
> the raw gnuplot functions - see:
> http://gnuplot.sourceforge.net/demo/contours.html
> work well for me. My code follows where F3g.dat contains the colums
> for (x,y,f(x,y)) in gnuplot format (ie with spaces to separate the
> jumps in x).
>
>
> Peter.
>
> #! /bin/sh
> gnuplot<<EOF
> # Plots cost contour
> set nosurface
> set contour
> set cntrparam levels 30
> set nokey
> set out "F3_cont.dat"
> set term table
> splot "F3g.dat"
> set term epslatex mono
> set out "Figs/$1.eps"
> set grid
> set xtics 0.5
> set xlabel "$\\\\hat{k}/k$"
> set ylabel "$\\\\hat{\\\\mu}/\\\\mu$"
> set size square 0.75,0.75
> plot "F3_cont.dat" with lines
> EOF
>
>
>
> From: "Henry F. Mollet" <address@hidden>
> Subject: Contour plots
> Date: Sun, 06 Mar 2005 10:22:13 -0800
>
>>> This message is in MIME format. Since your mail reader does not understand
>> this format, some or all of this message may not be legible.
>>
>> --B_3192949337_199304
>> Content-type: text/plain; charset="US-ASCII"
>> Content-transfer-encoding: 7bit
>>
>> GNU Octave, version 2.1.46 (powerpc-apple-darwin6.6).
>> G N U P L O T
>> Version 3.8i patchlevel 0
>>
>> octave:1> help contour
>> contour is the user-defined function from the file
>> /sw/share/octave/2.1.46/m/plot/contour.m
>> - Function File: contour (Z, N)
>> - Function File: contour (X, Y, Z, N)
>> Make a contour plot of the three-dimensional surface described by
>> Z. Someone needs to improve `gnuplot''s contour routines before
>> this will be very useful.
>>
>> Second function file does not work for me to get better control over the
>> number of contours. There are additional difficulties when used in
>> combination with multiplot.
>>
>> See attached for the best I was able to come up with. Of *most concern* is
>> the jaggedness of the contours as the parameter w/al increases. It does not
>> appear to be related to the meshgrid. 35x35 produces a similar plot as
>> 350x350 (see below), and my computer cannot handle 1000x1000 and I have to
>> force quit the terminal window.
>> How is this problem best defined so that I could search for a solution?
>> Additional problems are the placement of the y-scale on the right instead of
>> on the left and the horizontal instead of vertical placement of the y-label.
>>
>> I could calculate the contours as y = y(x) but that might be a lot of work.
>> Well, perhaps easy with fsovle for a good number of x-values for each
>> contour (about 10-15 for each subplot) if I were more familiar with it?
>> However, I assume that this would really be a work around?
>> Henry
>>
>> % Code for last of 4 contour subplots:
>> % x = Sa/la from 0 to 1.2
>> % y = alpha from 1 to 35
>> % w = 12* alpha
>> subplot (2,2,4) % subplot (2,2,4)
>> gset origin 0.30,-0.07
>> axis ([0.2,1.2,0,35], "square"); % problems with "normal"
>> gset label 4 " D) w/al = 12.0 " at 0.25, 27.5
>> grid "on"
>> x=linspace(0,1.2,350);
>> y=linspace(1,35,350);
>> [xx,yy]=meshgrid(x,y);
>> z=xx./(yy.*(1-xx)) -
>> (12*yy-yy+1).*xx.^(12*yy-yy+1)./yy./(1-xx.^(12*yy-yy+1)) + eps;
>> xlabel ("Sa/lambda1")
>> ylabel (" alpha")
>> contour (x,y,z)
>>
>
>
>
> -------------------------------------------------------------
> Octave is freely available under the terms of the GNU GPL.
>
> Octave's home on the web: http://www.octave.org
> How to fund new projects: http://www.octave.org/funding.html
> Subscription information: http://www.octave.org/archive.html
> -------------------------------------------------------------
>
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------
Re: Contour plots, Per Persson, 2005/03/06
Re: Contour plots, Peter Gawthrop, 2005/03/07
- Re: Contour plots,
Henry F. Mollet <=