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:
Plot3 and axis

Subject: Plot3 and axis

From: PLH

Date: 3 Mar, 2011 13:24:05

Message: 1 of 2

Hello all,

I'm plotting several data series with plot3, and I'm having a problem with data appearing "in the distance" when I rotate my figure. I use axis() to set the x,y,z limits, but some data still appears outside/behind the grid.

My code resembles

hold on
   plot3(x , y1-2*pi , z , mrkr1 , 'markersize' , 5)
   plot3(x , y2 , z , mrkr2 , 'markersize' , 5)
   plot3(x , y3+2*pi , z , mrkr3 , 'markersize' , 5)
hold off
grid on
box on
axis([x(1) x(end) 0 2*pi 0 1])

(with judicious use of white space to help with the reading).

y is in the interval [0 2pi]
z is in the interval [0 1]
mrkr# is a string such as 'r.'

What i want to do is exclude all the data points outside a box that I define.

Has anyone had this problem before? Can someone please suggest a way to fix this?

Any help is appreciated,

Thanks,

PLH.

Subject: Plot3 and axis

From: PLH

Date: 3 Mar, 2011 13:35:07

Message: 2 of 2

Sorry, that should be

axis([x(1) x(end) -pi pi 0 1])

Tags for 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