Mathematica - Axes Plotting (simple)

In summary, the conversation revolves around creating a visual for a quantum problem and seeking advice on making the y-axis stop after the origin to avoid interfering with other graphics. Suggestions are given to use the Epilog or Show function to achieve this. The conversation also touches on other ways to improve the graph.
  • #1
IHateMayonnaise
94
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

  • QHO1.pdf
    67.8 KB · Views: 309
Physics news on Phys.org
  • #2
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
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
 
  • #4
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.
 
  • #5
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"
 
  • #6
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.
 

1. What is Mathematica and how is it used for axes plotting?

Mathematica is a software tool commonly used by scientists and mathematicians for various computational tasks, including axes plotting. It utilizes a programming language called Wolfram Language, which allows for easy manipulation of data and creation of high-quality plots.

2. How do I plot data on a specific axis using Mathematica?

To plot data on a specific axis in Mathematica, you can use the "Plot" function, specifying the data you want to plot and the axis you want to use. For example, Plot[{x, x^2}, {x, 0, 10}, AxesLabel -> {"x-axis", "y-axis"}] will plot the functions x and x^2 on the x-axis from 0 to 10.

3. Can I customize the appearance of my axes plot in Mathematica?

Yes, you can customize the appearance of your axes plot in Mathematica using various options such as changing the color, style, and thickness of the axes lines, adding labels and titles, and adjusting the tick marks and their labels. These options can be specified within the "Plot" function or by using the "AxesStyle" and "FrameStyle" options.

4. How can I add multiple plots to the same axes in Mathematica?

You can add multiple plots to the same axes in Mathematica by using the "Show" function. This function allows you to combine multiple plots into one, specifying the desired axes and other options. For example, Show[Plot[Sin[x], {x, 0, 2Pi}], Plot[Cos[x], {x, 0, 2Pi}]] will plot both the sine and cosine functions on the same x-axis from 0 to 2π.

5. Is it possible to export my axes plot from Mathematica to another format?

Yes, it is possible to export your axes plot from Mathematica to various formats such as PDF, PNG, or SVG. This can be done by using the "Export" function and specifying the desired file format. For example, Export["myplot.pdf", Plot[x^2, {x, 0, 5}]] will export the plot of x^2 as a PDF file named "myplot" in your current working directory.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
6K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
18K
Replies
1
Views
1K
Back
Top