Thread Subject: coloring and customizing scatter plots

Subject: coloring and customizing scatter plots

From: perfreem@gmail.com

Date: 15 Feb, 2009 21:04:21

Message: 1 of 1

hello,

suppose i have the following scatter plot:

x=5*randn(1000,1);
y=.5*randn(1000,1);
lh=scatterhist(x,y);
bc=get(gcf,'color');
set(lh(2:3),'visible','on','color',bc,'box','off');
set(lh(2),'xtick',[],'xcolor',bc);
set(lh(2),'yticklabel',abs(get(lh(2),'ytick')));
set(lh(3),'ytick',[],'ycolor',bc);
set(lh(3),'xticklabel',abs(get(lh(3),'xtick')));

how can i set the color of the scatter plot? i tried setting
'MarkerFaceColor' on the return of scatter hist but it does not work..
how can i get the scatter plot's plot handle?

also, i tried resetting the position of the axes. while:

set(lh(2), 'yaxislocation', 'right');

works, doing the same for lh(1) does not. how can i change its axis?

finally, is there a way to get the two marginal histograms to not only
use the same number of bins, but use the same bins in particular? that
way histograms can be compared

thank you.

Tags for this Thread

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.

rssFeed for this Thread

Contact us at files@mathworks.com