ContourPlots - would create a contour plot with the six...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Contour Plots Warren Weckesser This Maple session gives some examples of creating contour plots. First, load the "plots" library: > with(plots): Define an expression to hold f(x,y). We'll do a contour plot for f(x,y) = x^2+2*y^2. > f := x^2 + 2*y^2; := f + x 2 2 y 2 The contourplot command creates a contour plot. The first argument is the function; the second and third arguments are the x and y ranges, respectively. > contourplot(f,x=-1. .1,y=-1. .1); After the first three arguments, you can include many optional arguments. The following are just a small sample. You can specify the exact number of contours to draw with "contours=N" (replace N with the number). The default is 8. OR, you can specify the actual contour values to be used to create the contour lines with "contours=[z1,z2,. ..,zn]". For example, the option contours=[0,0.5,1,1.5,2,2.5]
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: would create a contour plot with the six given contour values. You can change the color of the contour lines; for example, "color=green". You can force the plot to use the same scaling on the x and y axes (so a circle really looks like a circle) with "scaling=constrained". If the curves in the contour plot look jagged, you can increase the resolution with the option "grid=[Nx,Ny]", where you replace Nx and Ny with integers that give the x and y resolutions. The default is [25,25]. Here are some examples that use these options: > contourplot(f,x=-1. .1,y=-1. .1,contours=21,color=blue,scaling=const rained); > g := x^2-y^2+y^3; := g- + x 2 y 2 y 3 > contourplot(g,x=-1. .1,y=-1. .1,contours=[-0.4,-0.2,0,0.2,0.4],grid= [41,41],scaling=constrained); >...
View Full Document

This note was uploaded on 02/11/2012 for the course MTH 141, 142, taught by Professor Mcallister during the Spring '08 term at SUNY Empire State.

Page1 / 2

ContourPlots - would create a contour plot with the six...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online