Mathematica - Axes Plotting (simple!)

  • #1

Main Question or Discussion Point

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

Answers and Replies

  • #2
489
0
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
 
  • #3
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
 
  • #4
Hepth
Gold Member
448
39
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 theres 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.
 
  • #5
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 theres 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"
 
  • #6
Hepth
Gold Member
448
39
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.
 

Related Threads for: Mathematica - Axes Plotting (simple!)

Replies
1
Views
4K
Replies
2
Views
2K
Replies
3
Views
6K
Replies
2
Views
4K
Replies
2
Views
6K
  • Last Post
Replies
1
Views
3K
  • Last Post
Replies
1
Views
2K
Top