I am trying to create an illustration for a paper and export it to PDF. Here is the code
textsize = 16;
Framed[Show[
ContourPlot[y^2 - Cos[x], {x, -3 Pi, 3 Pi}, {y, -2.5, 2.5},
ContourShading -> None, ContourStyle -> Thickness[0.002],
PlotPoints -> 100, Frame -> None, Contours -> Range[-1, 7, 0.5],
AspectRatio -> 4/(3 Pi), PlotRangePadding -> 0],
ContourPlot[y^2 - Cos[x] == 1, {x, -3 Pi, 3 Pi}, {y, -2.5, 2.5},
ContourShading -> None, ContourStyle -> Thickness[0.004],
PlotPoints -> 200, Frame -> None, AspectRatio -> 4/(3 Pi),
PlotRangePadding -> 0],
Graphics[{Black, Arrowheads[0.025], PointSize[0.0001],
Thickness[0.0001],
Arrow[#] & /@ {{{0.0, Sqrt[2]}, {0.35,
Sqrt[2]}}, {{-0.1, -Sqrt[2]}, {-0.35, -Sqrt[2]}}, {{2 Pi +
0.1, Sqrt[2]}, {2 Pi + 0.35,
Sqrt[2]}}, {{2 Pi - 0.1, -Sqrt[2]}, {2 Pi -
0.35, -Sqrt[2]}}, {{-2 Pi + 0.1, Sqrt[2]}, {-2 Pi + 0.35,
Sqrt[2]}}, {{-2 Pi - 0.1, -Sqrt[2]}, {-2 Pi -
0.35, -Sqrt[2]}}},
Arrowheads[0.015],
Arrow[#] & /@ {{{0, 1}, {0.2,
1}}, {{-0, -1}, {-0.2, -1}}, {{2 Pi + 0.1, 1}, {2 Pi + 0.2,
1}}, {{2 Pi - 0.1, -1}, {2 Pi - 0.2, -1}}, {{-2 Pi + 0.1,
1}, {-2 Pi + 0.2, 1}}, {{-2 Pi - 0.1, -1}, {-2 Pi - 0.2, -1}}},
Arrow[#] & /@ {{{0.1, 1.87}, {0.2,
1.87}}, {{-0.1, -1.87}, {-0.2, -1.87}}, {{2 Pi + 0.1,
1.87}, {2 Pi + 0.2,
1.87}}, {{2 Pi - 0.1, -1.87}, {2 Pi - 0.2, -1.87}}, {{-2 Pi +
0.1, 1.87}, {-2 Pi + 0.2,
1.87}}, {{-2 Pi - 0.1, -1.87}, {-2 Pi - 0.2, -1.87}}} }],
Graphics[
Point[#] & /@ {{0, 0}, {Pi, 0}, {-Pi, 0}, {2 Pi, 0}, {-2 Pi, 0}}],
Graphics[{Text[Style[0, textsize], {0, -0.4}],
Text[Style[\[Pi], textsize], {Pi, -0.4}],
Text[Style[-\[Pi], textsize], {-Pi, -0.4}],
Text[Style[2 \[Pi], textsize], {2 Pi, -0.4}],
Text[Style[-2 \[Pi], textsize], {-2 Pi, -0.4}]}],
ImageSize -> 500]]
Then I use Export[...,%]
on the result to create the PDF. Here is a part of it:
So, what's up with the little dots at the tips of the arrows? They are not visible in Mathematica and their size does not decrease if I decrease Arrowheads
. They only solution I have found so far is take Imagesize->1000
and then downscale the image in latex, which is not ideal because I need to control the line width across all images.
In short the problem can be reduced to:
Graphics[{[email protected], Arrow[{{-2 Pi - 0.1, -1}, {-2 Pi - 0.2, -1}}]},
AspectRatio -> 4/(3 Pi), PlotRangePadding -> 0,
PlotRange -> {{-3 Pi, 3 Pi}, {-2.5, 2.5}}]