3
$\begingroup$

I'm attempting a simple Plot that I want to add asymptote markers to:

Module[{p, g},
 p = Plot[1/Sqrt[1 - x^2/4], {x, -2, 2},
   PlotRange -> {{-2.2, 2.2}, {0, 5}}];
 g = Graphics[{Line[{{2, 0}, {2, 5}}], Line[{{-2, 0}, {-2, 5}}]}];
 {p, Show[g, p]}]

With just the plot I get my tick marks

with ticks

However, when I combine the plot and the pair of lines:

no ticks

the tick marks on my axes disappear? Observe that it even the vertical ticks are gone, so this isn't an issue of them being pushed off the combined image.

$\endgroup$
6
$\begingroup$

Show picks the the options from the first graph and applies them to the second graph. The two lines have no tick marks as options so it removes them from the plot.

Module[{p, g}, 
 p = Plot[1/Sqrt[1 - x^2/4], {x, -2, 2}, 
   PlotRange -> {{-2.2, 2.2}, {0, 5}}, Background -> Green];
 g = Graphics[{Line[{{2, 0}, {2, 5}}], Line[{{-2, 0}, {-2, 5}}]}, 
   Background -> Red];
 Column[{Row[{p, " + ", g, " -> ", Show[p, g]}], 
   Row[{g, " + ", p, " -> ", Show[g, p]}]}]]

enter image description here

$\endgroup$
  • $\begingroup$ Thanks, Hector. I forgot that little tidbit when I asked for more info. $\endgroup$ – rcollyer Oct 16 '13 at 3:32

Your Answer

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

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