Mathematica Mathematica - Axes Plotting (simple)

AI Thread Summary
The discussion centers on creating a visually appealing graph for a quantum mechanics problem, specifically focusing on how to adjust the y-axis to avoid cluttering with arrows and text. Users suggest various methods to enhance the graph's appearance. One recommendation is to utilize the "Frame->True" option in the Plot function, while another involves using the Epilog feature to cover unwanted axis portions with a white rectangle. However, concerns arise regarding this method obscuring other graphical elements. The conversation shifts to using the Show function to manage the layering of graphics effectively, allowing for better control over the order in which elements are displayed. Overall, the thread emphasizes the importance of manipulating graphical directives and layering techniques to achieve a clean and informative visual representation of the quantum problem.
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.
 

Similar threads

Replies
3
Views
6K
Replies
3
Views
3K
Replies
3
Views
2K
Replies
1
Views
5K
Replies
6
Views
19K
Replies
2
Views
2K
Replies
6
Views
3K
Replies
8
Views
4K
Back
Top