Mathematica - Problem with axes

In summary, the person is having trouble with the axes changing size when using a slider to change parameters in their plots. They are looking for a way to fix the axes at a certain size and scaling, and have tried using the PlotRange and AxesOrigin options to solve the issue. They thank the person for their help in fixing the problem.
  • #1
LouisPhilippe
2
0
Hi,

I have just started working with mathematica and I am making a few manipulable plots of differential equations. The problem is that when I use the slider to change the value of certain parameters, the size of both axes change along, which makes it difficult to compare graphs.

I would like to have my axes "fixed", meaning they cut each other in coordinate (0,0) and preferably also with a fixed scaling (for example x-axis range from 0 to 10 and y-axis range from 0 to 5)

I don't think this should be too hard but I've spent quite some time looking for this in the help documents, but I just can't seem to find it!

Help would be greatly appreciated!

Louis-Philippe
 
Physics news on Phys.org
  • #2
Try adding a PlotRange option to your Plot

Plot[x^3, {x, 0, 2}, PlotRange -> {{0, 10}, {0, 5}}]

and see if this fixes your problem
 
  • #3
Also the option http://reference.wolfram.com/mathematica/ref/AxesOrigin.html" .
 
Last edited by a moderator:
  • #4
The combination of the two fixed my problem perfectly,

Thanks for your help!

Louis-Philippe
 
  • #5


Hello Louis-Philippe,

Thank you for reaching out with your issue. It sounds like you are experiencing a common problem with axes scaling in Mathematica. To fix this, you can use the "AspectRatio" option in your plot function to set the aspect ratio of the axes to a fixed value. For example, you can use "AspectRatio -> 1/GoldenRatio" to set the ratio to the golden ratio, which is often a visually pleasing choice. You can also use "AspectRatio -> Automatic" to have Mathematica choose the aspect ratio for you. Additionally, you can use the "PlotRange" option to set the range of your axes to a specific value, such as "PlotRange -> {{0, 10}, {0, 5}}". This will ensure that the axes remain fixed and do not change when you manipulate your plot. I hope this helps! Good luck with your work in Mathematica.
 

1. What is causing my axes to not show up in my Mathematica plot?

This issue is most commonly caused by not specifying the axes option in the plot command. Make sure to include the Axes->True or AxesLabel->{x,y} option in your plot command to ensure the axes are displayed.

2. How do I change the scale of my axes in Mathematica?

To change the scale of your axes, you can use the ScalingFunctions option in the plot command. This allows you to specify a scaling function for each axis, such as Log or Exp, to change the scale of the plot.

3. Can I add a second set of axes to my Mathematica plot?

Yes, you can add a second set of axes to your plot by using the Frame->True option in the plot command. This will create a frame around the plot with a second set of axes on the top and right sides.

4. How do I adjust the font size of my axes labels in Mathematica?

To adjust the font size of your axes labels, you can use the LabelStyle option in the plot command. This allows you to specify the font size, font family, and other formatting options for your labels.

5. Is there a way to customize the appearance of my axes in Mathematica?

Yes, you can customize the appearance of your axes by using the AxesStyle option in the plot command. This allows you to specify the color, thickness, and other style options for your axes.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
248
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
957
  • MATLAB, Maple, Mathematica, LaTeX
Replies
18
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
877
Back
Top