COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

plotting coordinate axes in 3d plot

• Email
• Follow

```hi All

I am wondering if there is an efficient way to plot a coordinate axes (x,y, z unit vectors from common point) at a point in a 3d plot.

I am looking to plot the position and orientation of multiple coordinate systems on a single plot.

Conor
```
 0

See related articles to this posting

```Conor Walsh wrote:

> I am wondering if there is an efficient way to plot a coordinate axes
> (x,y, z unit vectors from common point) at a point in a 3d plot.

The vectors themselves:

plot3(x0+[0, 1, nan, 0, 0, nan, 0, 0],
y0+[0, 0, nan, 0, 1, nan, 0, 0],
z0+[0, 0, nan, 0, 0, nan, 0, 1] )

The annotations:

text([x0+1, x0, x0], [y0, y0+1, y0], [z0, z0, z0+1], ['+X';'+Y';'+Z']);

> I am looking to plot the position and orientation of multiple
> coordinate systems on a single plot.

The above could be adapted, by using bsxfun, to do all the lines at once for a
given list of [X,Y,Z] origins. Probably could do all the annotations at once
as well by tossing in a repmat() .
```
 0

```This is awesome, would u please be so kind to explain, where the nan and the additional zeros come from?

Thanks!

Walter Roberson <roberson@hushmail.com> wrote in message <hntvk4\$lim\$1@canopus.cc.umanitoba.ca>...
> Conor Walsh wrote:
>
> > I am wondering if there is an efficient way to plot a coordinate axes
> > (x,y, z unit vectors from common point) at a point in a 3d plot.
>
> The vectors themselves:
>
> plot3(x0+[0, 1, nan, 0, 0, nan, 0, 0],
>        y0+[0, 0, nan, 0, 1, nan, 0, 0],
>        z0+[0, 0, nan, 0, 0, nan, 0, 1] )
>
> The annotations:
>
> text([x0+1, x0, x0], [y0, y0+1, y0], [z0, z0, z0+1], ['+X';'+Y';'+Z']);
>
>
>  > I am looking to plot the position and orientation of multiple
>  > coordinate systems on a single plot.
>
> The above could be adapted, by using bsxfun, to do all the lines at once for a
> given list of [X,Y,Z] origins. Probably could do all the annotations at once
> as well by tossing in a repmat() .
```
 0
Reply jan.kappen (1) 9/10/2012 12:17:07 PM

2 Replies
661 Views

Similar Articles

12/9/2013 4:13:59 PM
[PageSpeed]