Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: scatterhist with axis
Date: Fri, 30 Jan 2009 17:23:02 +0000 (UTC)
Organization: Universit&#228;tsSpital Z&#252;rich
Lines: 20
Message-ID: <glvd1m$pnr$1@fred.mathworks.com>
References: <65f14c0d-ecfb-445e-bfd0-8b02009abcd2@l33g2000pri.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1233336182 26363 172.30.248.35 (30 Jan 2009 17:23:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 30 Jan 2009 17:23:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 11
Xref: news.mathworks.com comp.soft-sys.matlab:515008


perfreem@gmail.com
> i am using the scatterhist command to plot a scatter plot along with
> its histogram. how can i make it so axes are added to the histogram
> (the y axis), so that i know what each bar represents...

one of the solutions

% the data
     x=randn(1000,1);
     y=randn(1000,1);
% the plot
     lh=scatterhist(x,y);
     bc=get(gcf,'color');
     set(lh(2:3),'visible','on','color',bc,'box','off');
% - x-axis hist
     set(lh(2),'xtick',[],'xcolor',bc);
% - y-axis hist
     set(lh(3),'ytick',[],'ycolor',bc);

us