0
$\begingroup$

I'm drawing a density plot,and I used the command of 'ColorFunction',but failed to get the color 'black,grey and white' as the paper.The pictures are as follows: enter image description here

enter image description here

$\endgroup$

closed as off-topic by Bob Hanlon, Carl Lange, m_goldberg, Henrik Schumacher, LouisB May 19 at 20:43

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Bob Hanlon, Carl Lange, m_goldberg, Henrik Schumacher, LouisB
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ What did you try? It should be simple as ColorFunction -> GrayLevel. $\endgroup$ – C. E. May 19 at 2:10
  • $\begingroup$ ColorConvert[..., "Grayscale"] $\endgroup$ – AccidentalFourierTransform May 19 at 2:11
  • $\begingroup$ Oh,right!Thanks. $\endgroup$ – KarryMa May 19 at 2:16
1
$\begingroup$

You can use the option ColorFunction.

Here is an example taken from the documentation of DensityPlot

DensityPlot[y + Sin[x^2 + 3 y], {x, -3, 3}, {y, -3, 3}, ColorFunction -> GrayLevel]

plot

$\endgroup$
  • $\begingroup$ Yeah,I got it.Thanks. $\endgroup$ – KarryMa May 19 at 2:27
  • $\begingroup$ And one more question: How to set the coordinate interval? $\endgroup$ – KarryMa May 19 at 2:31
  • $\begingroup$ @KarryMa. That's new question as should be posted as such. $\endgroup$ – m_goldberg May 19 at 2:47
0
$\begingroup$

I often use PlotTheme -> "Monochrome" for all kinds of plots :

DensityPlot[y + Sin[x^2 + 3 y], {x, -3, 3}, {y, -3, 3}, 
 PlotTheme -> "Monochrome"]  

enter image description here

$\endgroup$

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