3
$\begingroup$

I am trying to make contour plot of a 20*20 matrix using the function ListContourPlot.

I want the contour curves to be thick and black at the same time.

So I tried

ContourStyle -> [Black, Thick]

and

BaseStyle -> Thick, ContourStyle -> Thick

and many other ways.

However, all of them give me Thick and Gray curves.

Like this

enter image description here

How can I make the contour curves as black as the frame lines?

Here is my data

data

Here is how I read in the data:

data = ReadList[".../2Dshape4t30.txt", Number, RecordLists -> True];

Here is the my code for plotting

ListContourPlot[data2d, Contours -> {0.05, 0.1, 0.2, 0.01, 0.001}, 
 InterpolationOrder -> 3, ContourShading -> None, 
 ContourLabels -> All, ContourStyle -> Directive[Black, Thick], 
 Axes -> False , FrameStyle -> Thick, FrameTicks -> None]
$\endgroup$
  • 1
    $\begingroup$ Please provide a complete example in your question so we can test any solutions. It looks like you are using square brackets instead of the required curly braces. But the solution may require more than simply changing the brackets. $\endgroup$ – LouisB Oct 14 '19 at 17:37
  • $\begingroup$ PlotTheme->"Monochrome" ? $\endgroup$ – yarchik Oct 14 '19 at 18:44
  • $\begingroup$ @LouisB Thank you for your comment! I have edited my question and added a concrete example. $\endgroup$ – Jun Liu Oct 14 '19 at 18:45
  • 2
    $\begingroup$ Then you need to add Opacity[1] to the ContourStyle. It is black but partially transparent by default. $\endgroup$ – yarchik Oct 14 '19 at 18:53
  • 2
    $\begingroup$ try ContourStyle -> Directive[Black, Thick] or ContourStyle -> Directive[Opacity[1],Black, Thick]? $\endgroup$ – kglr Oct 14 '19 at 18:53
2
$\begingroup$
data = Table[Sin[i  + j] Cos[i j], {i, -3, 3, 0.1}, {j, -3, 3, 0.1}];

ListContourPlot[data,
 Contours -> {0.05, -.75, .5, .95}, 
 Axes -> False , FrameStyle -> Thick, FrameTicks -> None, 
 InterpolationOrder -> 3, 
 ContourShading -> None, 
 ContourLabels -> All, 
 ContourStyle -> Directive[Black, Thick]]

enter image description here

You can

  1. add the option PlotTheme -> None or
  2. change the option ContourStyle to ContourStyle -> Directive[Opacity[1, Black], Thick]

to get

enter image description here

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.