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$
0

1 Answer 1

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$
1
  • $\begingroup$ Thanks, Hector. I forgot that little tidbit when I asked for more info. $\endgroup$
    – rcollyer
    Commented Oct 16, 2013 at 3:32

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.