How to include a scatterplot in figure using subplot?

Status
Not open for further replies.

Ahmed Alaa

Full Member level 5
Joined
Jul 22, 2009
Messages
317
Helped
61
Reputation
136
Reaction score
44
Trophy points
1,318
Location
Egypt
Activity points
2,965
Hi all,

Is it possible to include a scatterplot in figure using subplot? If yes, how?

Thanks,
Ahmed
 

scatterplots

I'm not too sure, but where there is a will there is a way.

type "doc scatterplot" and find the section of matlab code that actually plots... most is there for checking integrity of input.

So, create a new function file for yourself and copy that code there. But where it is says (simple) plot, you can write subplot(xyn), plot(...)

Hope this helps
 

    Ahmed Alaa

    Points: 2
    Helpful Answer Positive Rating
Re: scatterplots

subplot didn't work, I'll search this topic anyway. Thanks.
 

scatterplots

send me the new function you made. I'll try to debug it for you. At least, I'll give it a shot.

I say this because, I can't see any reason why it shouldn't work.

Oh... you can pm me the code
 

scatterplots

load load seamount

subplot(2,1,1)
scatter(x,y,5,z)
subplot(2,1,2)
scatter(x,y,5,z)

Try the above, the scatter plot can be plotted as the subplots
 

Re: scatterplots

Thanks andyutd and Communications_Engineer, but I meant scatterplot that draws a constellation not scatter. I've already tried this but it's not working:

A = [1 2 3 4 5 6];
B = [2 3 4 1 7 8];

subplot(2,1,1)
scatterplot(A)

subplot(2,1,2)
scatterplot(B)

Any suggestions.
 

scatterplots

Ahmed, I meant that we open the source code for the built-in function scatterplot and edit the code to plot the constellation as subplot.

The way you have written might not be working because maybe, I have not verified, before plotting the scatterplot uses "figure, plot"

Added after 2 minutes:

so the scatterplot is always generated in a new figure
 

Re: scatterplots

Can you give me an example for scatterplot and eyediagram on one figure or end me a modified function?

Thanks,
Ahmed
 

Re: scatterplots

Try this modified function scatterplot2.
 
Reactions: pewpew

    Ahmed Alaa

    Points: 2
    Helpful Answer Positive Rating
    V

    Points: 2
    Helpful Answer Positive Rating

    pewpew

    Points: 2
    Helpful Answer Positive Rating
Re: scatterplots

Ahmed Alaa said:
Can you give me an example for scatterplot and eyediagram on one figure or end me a modified function?

Thanks,
Ahmed



Brother Ahmed, please check your PM. I have sent you the code of the modified scatterplot.
 

    Ahmed Alaa

    Points: 2
    Helpful Answer Positive Rating
Re: scatterplots

Thanks samir67 .
Communications_engineer, thanks a lot and ramadan kareem

Added after 21 minutes:

Do any of you have a modified function for the eyediagram ??
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…