For Programmers: Free Programming Magazines  


Home > Archive > Mathematica > January 2008 > ContourPlot and ContourLabels bug









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author ContourPlot and ContourLabels bug
nigol

2008-01-25, 7:57 pm

I think I found another bug in contourplot.

ContourPlot[x^2 + y^2, {x, -3, 3}, {y, -3, 3},
Contours -> Join[Range[1, 10], {{5, Dashed}}],
ContourShading -> False, ContourLabels -> Automatic]

In this example the countour 6 is labeled 5, the contour 7 is labeled
6,...

The root cause is linked to a bug in the way identical contour levels
are handled:

ContourPlot[x^2 + y^2, {x, -3, 3}, {y, -3, 3},
Contours -> {1, 2, 3, 4, 5, 5, 5, 5, 6, 7, 8, 9, 10},
ContourShading -> False, ContourLabels -> Automatic]

I can fix the second example with Union:

ContourPlot[x^2 + y^2, {x, -3, 3}, {y, -3, 3},
Contours -> Union@{1, 2, 3, 4, 5, 5, 5, 5, 6, 7, 8, 9, 10},
ContourShading -> False, ContourLabels -> Automatic]

I am looking for simple ways to fix the first example.
Thanks,
Dario

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com