7
$\begingroup$

I am using MaTeX (check this for installation) for labeling which works fine with Plot but with Plot3D the label resolution becomes very bad. How can I solve that? For example, I have this code

fig = Plot3D[{Sqrt[x^2 + y^2], -Sqrt[x^2 + y^2]}, {x, -2, 2}, {y, -2, 
   2}, PlotRange -> {-2.5, 2.5}, ClippingStyle -> None, 
  PlotPoints -> 80, Mesh -> None, BoundaryStyle -> None, 
  PlotTheme -> "Grid", BoxRatios -> {0.5, 0.5, 0.9}, ImageSize -> 120,
   AxesLabel -> (MaTeX[#, Magnification -> 1] &) /@ {"lx", "ly", 
     "E(\\gamma)"}, AxesStyle -> Directive[Black, Thin], 
  LabelStyle -> {FontFamily -> "Latin Modern Roman", Black, 
    FontSize -> 9}, ViewPoint -> {1, -1, 0.6}]   

enter image description here

Now, I export this as pdf using Export["..../test1.pdf", fig, ImageResolution -> 2000]. When I enlarge this one the labels are not smoothed (see labels) and resolution is bad (see ticks) as indicated by the red arrows in the below picture (I set ImageResolution -> 2000 to obtain this quality) enter image description here

Update One can also impose the ticks using MaTeX

Plot3D[{Sqrt[x^2 + y^2], -Sqrt[x^2 + y^2]}, {x, -2, 2}, {y, -2, 2}, 
 PlotRange -> {-2.5, 2.5}, ClippingStyle -> None, PlotPoints -> 80, 
 Mesh -> None, BoundaryStyle -> None, PlotTheme -> "Grid", 
 BoxRatios -> {0.5, 0.5, 0.9}, ImageSize -> 120, 
 AxesStyle -> Directive[Black, Thin], 
 BoxStyle -> Directive[Black, Thin], 
 AxesLabel -> {MaTeX["lx", Magnification -> 1], 
   MaTeX["ly", Magnification -> 1], 
   Rotate[MaTeX["\\text{E}(\\gamma)", Magnification -> 1], 
    90 Degree]}, AxesStyle -> Directive[Black, Thickness[0.01]], 
 BoxStyle -> Directive[Black, Thickness[0.01]], 
 Ticks -> {With[{ticks = 
      Range[-2, 2, 2]}, {#, 
       MaTeX[NumberForm[#, {\[Infinity], 1}], "DisplayStyle" -> False,
         Magnification -> 1]} & /@ ticks], 
   With[{ticks = 
      Range[-2, 2, 2]}, {#, 
       MaTeX[NumberForm[#, {\[Infinity], 1}], "DisplayStyle" -> False,
         Magnification -> 1]} & /@ ticks], 
   With[{ticks = 
      Range[-2, 2, 2]}, {#, 
       MaTeX[NumberForm[#, {\[Infinity], 1}], "DisplayStyle" -> False,
         Magnification -> 1]} & /@ ticks]}, ViewPoint -> {1, -1, 0.6}]   

and then export the results using the above statement which gives this
enter image description here

which shows that the problem exists even with the ticks when created by MaTeX.

$\endgroup$
14
  • $\begingroup$ I cannot reproduce this. What version of Mathematica did you use? $\endgroup$ – Szabolcs Oct 23 '20 at 13:24
  • 1
    $\begingroup$ Note that the tick labels are not produced by MaTeX. The jaggedness looks like a misrendering of FilledCurve / BezierCurve in a 3D environment. I assume you don't see the jaggedness unless using Graphics3D? It looks like a Mathematica bug ... it should be reported to Wolfram. $\endgroup$ – Szabolcs Oct 23 '20 at 13:27
  • $\begingroup$ What version is this? $\endgroup$ – SHuisman Oct 23 '20 at 13:49
  • 1
    $\begingroup$ @Szabolcs, I am using Mathematica 12.0.0.0 on Ubuntu. I updated the code to impose the ticks with MaTeX. $\endgroup$ – valar morghulis Oct 23 '20 at 13:54
  • 1
    $\begingroup$ wolfram.com/support/contact/email/?topic=Feedback $\endgroup$ – Szabolcs Oct 29 '20 at 11:29

Your Answer

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

Browse other questions tagged or ask your own question.