3
$\begingroup$

I had no suspect that the default color for axis label and ticks would be black. However, after exporting an image to pdf, it seems that these colors are not black for me. Indeed, by checking the color with mspaint, the RGB value is (102,102,102).

The following is the code used to generate a plot:

cm = 72/2.54;
r = RegionPlot[x^2 + y^2 < 1, {x, -1, 1}, {y, -1, 1}, Frame -> True, 
  PlotRange -> {{-1, 1}, {-1, 1}}, FrameLabel -> {x, y}]
Export["test1.pdf", Show[r, ImageSize -> 7 cm]]

The following is the part of the resulting plot that I magnified:

enter image description here

It does not seem as the real black. Is it the expected behavior? How can I make the color "true" black, with RGB (255,255,255)?

$\endgroup$
5
  • 1
    $\begingroup$ You can add the option FrameStyle -> Black, which also allows for other kinds of customizations, please see the Help. $\endgroup$
    – Hans Olo
    Jul 18, 2021 at 11:42
  • $\begingroup$ @HansOlo Thanks, I checked that works. However, it is still very surprising to me that the default color is not black! $\endgroup$
    – eigenvalue
    Jul 18, 2021 at 11:47
  • $\begingroup$ I think the default is Gray, at least in some recent versions of MMA that I have checked. $\endgroup$
    – Hans Olo
    Jul 18, 2021 at 11:48
  • 5
    $\begingroup$ You can see the current default values on your system using CurrentValue[{StyleDefinitions, #}] & /@ {"GraphicsAxes", "GraphicsFrame", "GraphicsTicks", "GraphicsLabel"}. If you did nothing strange, they should all include the color specification GrayLevel[0.4] somewhere $\endgroup$
    – Lukas Lang
    Jul 18, 2021 at 11:52
  • $\begingroup$ Easier to read version of @Lucas Lang's comment. AssociationMap[ CurrentValue[{StyleDefinitions, #}] &, {"GraphicsAxes", "GraphicsFrame", "GraphicsTicks", "GraphicsLabel"}] // Dataset $\endgroup$ Jul 18, 2021 at 18:26

1 Answer 1

4
$\begingroup$

To answer your question of why the default isn't black, it looks like it's to emphasize what's being plotted instead of the frame. From here it says "Axes and frames have been lightened slightly to shift emphasis to the actual data."

In addition to the comment Hans made about FrameStyle -> Black, I might also recommend using a Directive to thicken the frame like FrameStyle -> Directive[Black, Thick], if you really want a bold, black frame.

Looking at PlotTheme might also be useful. For example, you might be interested in PlotTheme -> "Monochrome".

Also, check out Graphics Options and Styling for lots of other options.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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