Thread Subject: color-coded scatter 3d plot overplotted with a surface

Subject: color-coded scatter 3d plot overplotted with a surface

From: Zahra

Date: 17 Aug, 2011 23:55:11

Message: 1 of 5

Hi All,
I have two matrix that I would like to overplot. For one of the datasets I like to use surf function which nicely plots it. For the other dataset, I would like to use scattered style but want the data be color-coded the same way the first dataset is plotted using surf. Does any one know whether there is already a function which can do this?
Thanks,
Z.

Subject: color-coded scatter 3d plot overplotted with a surface

From: edward kabanyas

Date: 18 Aug, 2011 00:42:10

Message: 2 of 5

Please send your code, after that we can suggest the solution. If no, it is difficult to walk in the dark region..

EDward

"Zahra" <zahra.yamani@nrc.gc.ca> wrote in message <j2hkcv$77o$1@newscl01ah.mathworks.com>...
> Hi All,
> I have two matrix that I would like to overplot. For one of the datasets I like to use surf function which nicely plots it. For the other dataset, I would like to use scattered style but want the data be color-coded the same way the first dataset is plotted using surf. Does any one know whether there is already a function which can do this?
> Thanks,
> Z.

Subject: color-coded scatter 3d plot overplotted with a surface

From: Zahra

Date: 18 Aug, 2011 00:54:09

Message: 3 of 5

"edward kabanyas" <djuky_hmi@yahoo.com> wrote in message <j2hn52$eln$1@newscl01ah.mathworks.com>...
> Please send your code, after that we can suggest the solution. If no, it is difficult to walk in the dark region..
>
> EDward


There is really not much code, I am using simple matlab functions: The two matrices (A and B) are with the same size:

surf(A)

If I use the plot3 function to plot the second matrix B, it is not colour-coded to the same scale as the surface plot of matrix A is. I found plot3k function from the file exchange service but with that one, there seems to be a separate colour scheme for the scale than the surf plot... I hope this makes it more clear...

Subject: color-coded scatter 3d plot overplotted with a surface

From: Zahra

Date: 18 Aug, 2011 02:34:09

Message: 4 of 5

Just found the answer:

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

with the scatter function, one could overplot a scatter plot with the same colour coded as a surface plot in the graph...


"Zahra" <zahra.yamani@nrc.gc.ca> wrote in message <j2hnrh$ged$1@newscl01ah.mathworks.com>...
> "edward kabanyas" <djuky_hmi@yahoo.com> wrote in message <j2hn52$eln$1@newscl01ah.mathworks.com>...
> > Please send your code, after that we can suggest the solution. If no, it is difficult to walk in the dark region..
> >
> > EDward
>
>
> There is really not much code, I am using simple matlab functions: The two matrices (A and B) are with the same size:
>
> surf(A)
>
> If I use the plot3 function to plot the second matrix B, it is not colour-coded to the same scale as the surface plot of matrix A is. I found plot3k function from the file exchange service but with that one, there seems to be a separate colour scheme for the scale than the surf plot... I hope this makes it more clear...

Subject: color-coded scatter 3d plot overplotted with a surface

From: Steven_Lord

Date: 18 Aug, 2011 20:43:11

Message: 5 of 5



"Zahra" <zahra.yamani@nrc.gc.ca> wrote in message
news:j2htn1$31t$1@newscl01ah.mathworks.com...
> Just found the answer:
>
> http://www.mathworks.com/help/techdoc/ref/scatter.html
>
> with the scatter function, one could overplot a scatter plot with the same
> colour coded as a surface plot in the graph...

Since you're working in 3D, you probably want SCATTER3.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
colorcoded scat... Zahra 17 Aug, 2011 19:59:10
rssFeed for this Thread

Contact us at files@mathworks.com