Mathematica - Axes Plotting (simple)

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
5 replies · 7K views
IHateMayonnaise
Messages
87
Reaction score
0
Hi there,

Making a nice visual for a quantum problem, which is finding the probability of finding the object outside of the classically allowed region for n=0,1,2. One problem: How do I make the y-axis stop after the origin so it doesn't mess up my arrows or my text (see attached)?

Any other advice to spiffy up this graph? Thanks :)

IHateMayonnaise
 

Attachments

Physics news on Phys.org
Check out the neat examples in the help file for Plot, they do more or less the exact same thing. Another way to maybe spruce it up is go Frame->True
 
FunkyDwarf said:
Check out the neat examples in the help file for Plot, they do more or less the exact same thing. Another way to maybe spruce it up is go Frame->True

Yes that's the first place I went, but I couldn't make sense of it. Can anyone help?

IHateMayonnaise
 
You can try Epilog to hide it :

XX = Plot[0.9 - Sin[x]^2 , {x, -10, 10}, Epilog -> {White, Rectangle[{-1, -0.5}, {1, 0}]}]

This basically plots the function, then makes a white rectangle at the location, covering the axis after it has been drawn.

I looked for axis options, but there's nothing, and even changing your plot range is finicky and works or doesn't depending on other graphics and labels.
There are a lot of "directives" that work with Plot, but aren't listed in Plot's Help.
 
Hepth said:
You can try Epilog to hide it :

XX = Plot[0.9 - Sin[x]^2 , {x, -10, 10}, Epilog -> {White, Rectangle[{-1, -0.5}, {1, 0}]}]

This basically plots the function, then makes a white rectangle at the location, covering the axis after it has been drawn.

I looked for axis options, but there's nothing, and even changing your plot range is finicky and works or doesn't depending on other graphics and labels.
There are a lot of "directives" that work with Plot, but aren't listed in Plot's Help.

Thanks for the reply Hepth. The problem with that is that it will also white out all my other graphics at that location, including lines, text etc., and I can't figure out how to make it "send to back"
 
Are you using SHOW? I think it automatically draws stuff in order of back to front.

XX = Plot[Sin[x], {x, 0, 1}];
Show[Graphics[Rectangle[{0, 0}, {1, 0.5}]], XX,
Graphics[{Thick, Orange, Circle[{0.5, 0.5}, 0.1]}]]

If you change the order of SHOW itll stack them.

So don't even use prolog or epilog, just use SHOW for all your graphics and use the ordering there.