A New Kind of Science: The NKS Forum : Powered by vBulletin version 2.3.0 A New Kind of Science: The NKS Forum > Applied NKS > Isolines
  Last Thread   Next Thread
Thread Post New Thread    Post A Reply

Registered: Apr 2005
Posts: 1


Hi there,
Well i've been using the feature ContourPlot in mathematica recently and i think that i need your help guys.
The problem is that i need to plot the contour lines plus the values of each curve : in another term plot the curve and the values of the isolines as well.
Thx a lot for your response

Report this post to a moderator | IP: Logged

Old Post 04-08-2005 03:17 PM
Michel is offline Click Here to See the Profile for Michel Click here to Send Michel a Private Message Click Here to Email Michel Edit/Delete Message Reply w/Quote
Jason Cawley
Wolfram Science Group
Phoenix, AZ USA

Registered: Aug 2003
Posts: 712

In general, for Mathematica help the places to look are first the help browser, then the Mathematica book, and then online resources like the Information Center -


If you still can't find what you need you can try the MathGroup discussion list, where you can submit a question if there is no relevant thread already -


This forum is specifically for New Kind of Science subjects, rather than general Mathematica ones.

All that said, to address your actual question, you can probably get what you want with just the optional argument ContourLabels->Automatic. For example -

ContourPlot[x Sin[2 Pi y], {x, -4, 4}, {y, -1, 1}, 
PlotRange -> {-4, 4}, PlotPoints -> 25,
ContourShading -> False,  Contours -> 7, 
ContourLabels -> Automatic] 

Notice, the Contours argument tells it how many lines to draw. If you just give an integer, it draws that many lines, and they are evenly spaced within the specified PlotRange. ContourLabels tells it to label each line with the Z value of that contour.

You can also give a list of z values instead of a integer number of lines, as a value for Contours. E.g.

ContourPlot[x Sin[2 Pi y], {x, -4, 4}, {y, -1, 1}, 
PlotRange -> {-4, 4}, PlotPoints -> 25,
ContourShading -> False,  Contours -> {-3,0,2}, 
ContourLabels -> Automatic] 

That draws only the z = -3, the z = 0, and the z = 2 contours - and labels them.

Notice I also used the PlotPoints argument. With the default number of points, some of the contour lines might look a bit squared off in places. Increasing the number of plot points gives a smoother shape - at some sacrifice in rendering speed.

Incidentally, if you want to see a 3D graphic version of the same, you would use something like -

Plot3D[x Sin[2 Pi y], {x, -5, 5}, {y, -2, 2}, Mesh -> False, PlotPoints -> 50]

I hope this helps.

Report this post to a moderator | IP: Logged

Old Post 04-08-2005 05:22 PM
Jason Cawley is offline Click Here to See the Profile for Jason Cawley Click here to Send Jason Cawley a Private Message Edit/Delete Message Reply w/Quote
Nottingham University

Registered: Feb 2006
Posts: 2

Problems with ContourLabels

I try

ContourPlot[x Sin[2 ð y], {x, -4, 4}, {y, -1, 1}, ContourLabels -> Automatic]

but I get

ContourPlot :: optx :
Unknown option ContourLabels in ContourPlot[x Sin[2 Pi y],{x,-4,4},{y,-,1,1},ContourLabels->Automatic]. More...

Note that


gives the answer


and this means the system recognizes it, isn't it? So what is going on?

I would be very grateful for any help on this.

:) Katerina.

Report this post to a moderator | IP: Logged

Old Post 02-20-2006 12:31 PM
katerina is offline Click Here to See the Profile for katerina Click here to Send katerina a Private Message Click Here to Email katerina Edit/Delete Message Reply w/Quote
Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread


wolframscience.com  |  wolfram atlas  |  NKS online  |  Wolfram|Alpha  |  Wolfram Science Summer School  |  web resources  |  contact us

Forum Sponsored by Wolfram Research

© 2004-16 Wolfram Research, Inc. | Powered by vBulletin 2.3.0 © 2000-2002 Jelsoft Enterprises, Ltd. | Disclaimer | Archives