Mathematica - Axes Plotting (simple)

Click For Summary

Discussion Overview

The discussion revolves around plotting in Mathematica, specifically addressing how to manage the y-axis in a graph related to quantum probability problems. Participants seek advice on visual enhancements and technical solutions for axis manipulation.

Discussion Character

  • Technical explanation
  • Exploratory
  • Debate/contested

Main Points Raised

  • One participant asks how to stop the y-axis after the origin to avoid interference with arrows and text in their graph.
  • Another suggests checking the help file for examples and proposes using Frame->True to enhance the graph.
  • A participant shares a method using Epilog to cover the unwanted part of the y-axis with a white rectangle, noting that this approach can obscure other graphics at that location.
  • Another participant questions the effectiveness of using Epilog and suggests using SHOW to control the order of graphic elements, indicating that it may provide a better solution for layering graphics.

Areas of Agreement / Disagreement

Participants express differing opinions on the best method to manage the y-axis and enhance the graph, with no consensus reached on a single solution.

Contextual Notes

Participants mention limitations in the help documentation regarding axis options and directives that may not be well-documented, which could affect the effectiveness of proposed solutions.

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 5 ·
Replies
5
Views
3K
  • · Replies 3 ·
Replies
3
Views
6K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 6 ·
Replies
6
Views
19K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 8 ·
Replies
8
Views
5K