Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
plot scroll bars, x-axis spacing

Subject: plot scroll bars, x-axis spacing

From: radar

Date: 5 Dec, 2010 16:25:26

Message: 1 of 5

With R2010a, the default behavior for plots, with regards to the x-axis, appears to be trying to cram all data points into one graph no matter how many observations. Some signals are impossible to inspect this close together. If there a way to accomplish the following, please let me know how (thanks in advance):

1. Instead of horizontal panning, use horizontal scroll bars.

2. Have the initial figure/plot view x-axis spacing set to a value that allows more space between data points for easier horizontal inspection.

3. Use most of the available horizontal viewing space instead of having large left and right margins around a plot.

Subject: plot scroll bars, x-axis spacing

From: Steven_Lord

Date: 5 Dec, 2010 22:42:43

Message: 2 of 5



"radar" <able@tds.net> wrote in message
news:420154864.58759.1291566356778.JavaMail.root@gallium.mathforum.org...
> With R2010a, the default behavior for plots, with regards to the x-axis,
> appears to be trying to cram all data points into one graph no matter how
> many observations.

That is consistent with the default value for the axes XLimMode property,
yes.

http://www.mathworks.com/help/techdoc/ref/axes_props.html#XLimMode

> Some signals are impossible to inspect this close together. If there a way
> to accomplish the following, please let me know how (thanks in advance):
>
> 1. Instead of horizontal panning, use horizontal scroll bars.

Search the File Exchange for "scrollplotdemo" for some of the examples that
demonstrate this type of technique.

> 2. Have the initial figure/plot view x-axis spacing set to a value that
> allows more space between data points for easier horizontal inspection.

Not really possible the what I think you're describing it. You can set the
limits explicitly or you can let MATLAB determine the limits from your
plotted data; there's no real option to tell MATLAB "determine the limits
yourself, but add a margin of 10% around what you think they should be."

> 3. Use most of the available horizontal viewing space instead of having
> large left and right margins around a plot.

Change the XLim and/or Position and Units properties of the axes.

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlab.wikia.com/wiki/FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: plot scroll bars, x-axis spacing

From: radar

Date: 6 Dec, 2010 01:06:07

Message: 3 of 5

Thanks much for your advice, and nice work on the scrollplotdemo code.

Is there any means to create a figure-based plot that, initially, and w/o user interaction, has the same horizontal behavior as results from using these...

figure menu->tools->options->horizontal zoom
and
figure menu->tools->options->horizontal pan

..or must I always set these interactively? Thanks.

Subject: plot scroll bars, x-axis spacing

From: Steven_Lord

Date: 6 Dec, 2010 15:16:24

Message: 4 of 5



"radar" <able@tds.net> wrote in message
news:1583742274.60563.1291597597402.JavaMail.root@gallium.mathforum.org...
> Thanks much for your advice, and nice work on the scrollplotdemo code.
>
> Is there any means to create a figure-based plot that, initially, and w/o
> user interaction, has the same horizontal behavior as results from using
> these...
>
> figure menu->tools->options->horizontal zoom
> and
> figure menu->tools->options->horizontal pan
>
> ..or must I always set these interactively? Thanks.

Look at example 2 on each of these function reference pages:

http://www.mathworks.com/help/techdoc/ref/zoom.html

http://www.mathworks.com/help/techdoc/ref/pan.html

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlab.wikia.com/wiki/FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: plot scroll bars, x-axis spacing

From: radar

Date: 6 Dec, 2010 22:28:56

Message: 5 of 5

Thanks much.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us