graphics for functions of 2 variables




On Tue, 13 Oct 2009, Voirin Pascale wrote:

< Hello,
< 
< I have two questions:
< 
< 1. what option should I add to the plotting command below (either in plot3d or in draw3d) to tune the z-range to [0,10] for instance ?
< Maxima commands: 
< f(x,y):=9-x^2-y^2; plot3d(f(x,y),[x,-3,3],[y,-3,3]);

You can set the zrange (and x,y ranges, too) by going through
gnuplot_preamble:

plot3d(f(x,y),[x,-3,3],[y,-3,3],[gnuplot_preamble,"set zrange [0:10];");

(if you set the x,y ranges this way, the graph looks better).


< or
< load(draw); 
< f(x,y):=9-x^2-y^2; draw3d(explicit(f(x,y),x,-3,3,y,-3,3));

You can set the z range via 

draw3d(explicit(f(x,y),x,-3,3,y,-3,3),zrange=[0,10]);

The x,y ranges can be set this way, too.


< 
< 2. again, I guess there is an option I did not find out to get a scale ratio of one for plotting contours. What should I write ?
< Maxima commands:
< f(x,y):=9-x^2-y^2; contour_plot(f(x,y),[x,-3,3],[y,-3,3]);
< /* contour_plot gives a region [-3,4]x[-3,4] by the way, which is not nice */

I don't know why these plot commands are sloppy with the ranges, but
they are. If you pass them directly to gnuplot, this works better. Also,
turning the legend/key off improves the scale ratio.

contour_plot(f(x,y),[x,-3,3],[y,-3,3],[gnuplot_preamble,"set xrange
[-3:3]; set yrange [-3:3]; set key off;"]);

Leo

< or
< load(draw); 
< f(x,y):=9-x^2-y^2; draw3d(explicit(f(x,y),x,-3,3,y,-3,3),contour=map,contour_levels=10);



-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.