Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

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

share|improve this answer
    
Thanks, Hector. I forgot that little tidbit when I asked for more info. –  rcollyer Oct 16 '13 at 3:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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