0
$\begingroup$

I'm using a black background on a Plot3D image and I'm trying to change the axes labels to be white, to contrast. I tried using

LabelStyle -> White

but this only changes the axes colour. Help please, I can't seem to find how to change this for Plot3D. Thanks.

Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}, 
 AxesLabel -> MaTeX@{L, "\\kappa", "\\mathbb{E}[\\tau]"}, 
 ColorFunction -> "Rainbow", Background -> Black, AxesStyle -> White]
$\endgroup$
5
  • 1
    $\begingroup$ pls share the code of the plot. I'd guess you'll need FrameStyle->White or AxisStyle->White but it's hard to try different solutions without your specific example. $\endgroup$
    – Fraccalo
    Feb 3, 2020 at 13:30
  • $\begingroup$ I've actually just realised that the problem is I'm using the MaTeX package for axes labels. For some reason it doesn't like to be white...any ideas? $\endgroup$ Feb 3, 2020 at 13:51
  • $\begingroup$ again, share the code please or it's hard to help you :) $\endgroup$
    – Fraccalo
    Feb 3, 2020 at 13:54
  • $\begingroup$ try AxesStyle ->Directive[FontColor->White]? (e.g., Graphics3D[Cuboid[], Axes -> True, AxesStyle -> Directive[Orange, Thick, FontColor -> Green, FontSize -> 16]]) $\endgroup$
    – kglr
    Feb 3, 2020 at 14:04
  • $\begingroup$ Still not working with the MaTeX package. $\endgroup$ Feb 3, 2020 at 14:09

1 Answer 1

2
$\begingroup$

I've never used that package before, but giving a look at the package documentation (http://szhorvat.net/pelican/latex-typesetting-in-mathematica.html) I think the following is the correct approach:

SetOptions[MaTeX, "Preamble" -> {"\\usepackage{color,txfonts}"}]

Plot3D[Sin[x + y^2], {x, -3, 3}, {y, -2, 2}, 
 AxesLabel -> 
  MaTeX@{"\\color{white}\\L", "\\kappa", 
    "\\color{white}\\ \\mathbb{E}[\\tau]"}, 
 ColorFunction -> "Rainbow", Background -> Black, AxesStyle -> White, 
 BaseStyle -> White]

enter image description here

$\endgroup$

Your Answer

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

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