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 how to make origin (0,0,0) ?

Subject: plot3 how to make origin (0,0,0) ?

From: Yusof Ghafur

Date: 10 Apr, 2010 13:59:26

Message: 1 of 3

I'm using plot3(x, y, z) to draw something.

But as shown in the picture below, my axes are messed up.
http://i21.photobucket.com/albums/b272/yusof_hardy/3dplot.png


How do I align the origin (0,0,0) ?
I also want the 3 axes to follow left-hand rule. (If your index finger points the positive direction of the x axis and middle finger points the positive direction of the y axis, then your thumb points the positive direction of the z axis).



Thanks in advance

Subject: plot3 how to make origin (0,0,0) ?

From: Yusof Ghafur

Date: 10 Apr, 2010 14:19:08

Message: 2 of 3

Correction:

(If your index finger points the positive direction of the y axis and middle finger points the positive direction of the z axis, then your thumb points the positive direction of the z axis)

Subject: plot3 how to make origin (0,0,0) ?

From: Roger Stafford

Date: 11 Apr, 2010 07:12:03

Message: 3 of 3

"Yusof Ghafur" <yusof_hardy@hotmail.com> wrote in message <hpq07u$9in$1@fred.mathworks.com>...
> I'm using plot3(x, y, z) to draw something.
>
> But as shown in the picture below, my axes are messed up.
> http://i21.photobucket.com/albums/b272/yusof_hardy/3dplot.png
>
> How do I align the origin (0,0,0) ?
> I also want the 3 axes to follow left-hand rule. (If your index finger points the positive direction of the x axis and middle finger points the positive direction of the y axis, then your thumb points the positive direction of the z axis).
> .......
-----------------
  In your image the two respective axis systems are actually in the same right-hand orientation. In either one if you point your right hand thumb along the z-axis, your fingers will curl from the x-axis toward the y-axis. The two sets of axes differ in that the one is turned around about a vertical axis roughly 180 degrees relative to the other. That brings the plot3 origin out to the lower front whereas your origin is in the rear. Otherwise they are alike. Actually the z-axis is not explicitly shown in the plot3 diagram but you can imagine that it would point straight upward from the (0,0,0) origin out at the lower front.

  You should know that matlab has a function called 'view' which will allow you to change the orientation in a plot3 diagram. The one you show is just the default setting. You can change the "azimuth" and "elevation" to any values you desire. I recommend you take some time out to experiment with different settings so as to better visualize what is being displayed. It will allow you to simulate walking around a 3D display to get a better feeling of the depth of things being plotted. A careful perusal of your matlab manual in this area is of course a must.

Roger Stafford

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