Message Boards Message Boards

0
|
3435 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Odd behavior when manipulating a plot.

Posted 2 years ago

The attached notebook calculates and plots four functions R0(x), R1(x), P(x) and Q(x) over the range of x from 0.0 to 1.0 as the parameter m is changed interactively from 0.01 to 0.50. The plot looks as expected at m = 0.1 using the full range of the y axis and with the labels for the x axis at the very bottom, but as m is changed this behavior is not consistent. For m < 0.1 the the data are still spread out over the y axis range, but labels for the x axis now appear in the middle of the plot rather than at the bottom. For m > 0.1 the x axis is still labeled correctly at the very bottom but now the range displayed for the y axis is excessive resulting in visual compression of the displayed functions. How do I insure consistent behavior across the full range of m?

Attachments:
POSTED BY: Kevin Ulmer
2 Replies

I think this is because you fixed the axes origin to {0,3} and for values of m<0.1 the y values go below that. If you go above your y values are much less than -3 but the plot still wants to keep the x-axes visible.

One solution is to remove AxesOrigin such that the axes are at {0,0}. Or you can and use Frame -> True, FrameTicks -> Automatic

Last solution is to make the plot, find the PlotRange and then use that to reposition the axes at the bottom.

plot = Plot[...];
Show[plot, 
 AxesOrigin -> {0, 
   1.1 First@Last[PlotRange /. AbsoluteOptions[plot, PlotRange]]}]
POSTED BY: Martijn Froeling
Posted 2 years ago

Many thanks Martijn -

Learned quite a few new things getting this to work!

Cheers -

Kevin

POSTED BY: Kevin Ulmer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract