Message Boards Message Boards

0
|
1798 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

How negative contour lines dashed and positive contour lines solid?

Posted 1 year ago

POSTED BY: richard young
2 Replies

In case you want more (here 15) contours and you know minf and maxf, the minimum and maximmum value for your contours you could for example use

n = 15;
minf = -4;
maxf = 4;
cons = Table[minf + (j - 1) (maxf - minf)/(n - 1), {j, 1, n}]
constyle = 
  Which[# < 0, Dashed, # == 0, {Thick, Blue}, # > 0, Red] & /@ cons;
ContourPlot[x^2 - y^2, {x, -2, 2}, {y, -2, 2}, Contours -> cons, 
 ContourStyle -> constyle]
POSTED BY: Hans Dolhaine

Perhaps this gives a hint

ContourPlot[x^2 - y^2, {x, -2, 2}, {y, -2, 2}, Contours -> {-1, 0, 1},
 ContourStyle -> {Dashed, Thick, {Thick, Red}}]
POSTED BY: Hans Dolhaine
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract