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

Subject: Plot

From: Omkar Palsule-Desai

Date: 25 Apr, 2010 07:01:07

Message: 1 of 3


Hi,

In the "plot" command, can I do selective plotting? The limits on x and y axes are specified. I don't want zeros on y-axis to be printed. Is this kind of plotting possible?

Thank you in advance.

Omkar

Subject: Plot

From: Thomas Britton

Date: 25 Apr, 2010 10:10:05

Message: 2 of 3

Yes - look at:

doc plot
doc axes
doc axes_props

You want to look at the documentation also here:

http://www.mathworks.com/access/helpdesk/help/techdoc/creating_plots/f6-7929.html

Once you've tinkered with a figure graphically you can also (from the file menu) export as a m file to see what settings you've changed for manually inputting into your code.

Ben
"Omkar Palsule-Desai" <omkardpd@iimahd.ernet.in> wrote in message <hr0pbi$nme$1@fred.mathworks.com>...
>
> Hi,
>
> In the "plot" command, can I do selective plotting? The limits on x and y axes are specified. I don't want zeros on y-axis to be printed. Is this kind of plotting possible?
>
> Thank you in advance.
>
> Omkar

Subject: Plot

From: Walter Roberson

Date: 25 Apr, 2010 15:23:02

Message: 3 of 3

Omkar Palsule-Desai wrote:

> In the "plot" command, can I do selective plotting? The limits on x and
> y axes are specified. I don't want zeros on y-axis to be printed. Is
> this kind of plotting possible?

If the point (x,0) is within the range of both the x and y limits, then
it will be plotted. There is no option within plot to say "do not draw
points that go through the following polygon" nor "if a line would go
through the following polygon, only draw to the outside edge of the
polygon."

If 0 is within your ylimit range, but you wish such points to be
skipped, then you need to not submit the point for plotting. The easiest
way would be:

y(y==0) = nan;

This will cause a break in the lineseries where that point would have been.

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