Rank: 93063 based on 0 downloads (last 30 days) and 0 file submitted
photo

Jiaqi

E-mail
Company/University
Eindhoven University of Technology

Personal Profile:

PhD student in Chemical Engineering


 

Watch this Author's files

 

Comments and Ratings by Jiaqi View all
Updated File Comments Rating
08 Feb 2012 Plot and compare histograms; pretty by default Compares multiple sets of data elegantly. Set bins and axis bounds to be appropriate for the data. Author: Jonathan C. Lansey

very flexible by using the provided parameters. useful to draw concise but informative histgrams. Thanks for the nice work.

05 Aug 2011 export_fig Exports figures nicely to a number of vector & bitmap formats. Author: Oliver Woodford

23 Dec 2010 XMas Tree Draws a xmas tree with decorations Author: Marc L├Ątzel

Cool!

22 Dec 2010 StemBar Function similar to the matlab stem3 but drawing bars instead of lines with markers. Author: Grzegorz Knor

now it works. I need to run stembar again with color information.
%%%%%%%%%%
x=[1 3 2 1 3]';
y=[1 1 2 3 3]';
z=[8.6 6 11.1 14.1 12.4]';
h = stembar(x,y,z); % 5 bars, 30 faces
zdata = ones(length(h),4); % each face has 4 vertices
% specify the color map
k=0;
for i=1:length(h)/6
ztop = get(h(i*6),'Zdata');
ztop = ztop';
for j=1:6
zdata(6*(i-1)+j,:)=ztop;
end
end
% now give the color specification
% and run 'stembar' again
zdata = zdata';
h=stembar(x,y,z,zdata);

colormap cool
colorbar
%%%%%%%%%%%%
It is strange that it doesn't work when I use set(h,'Cdata',zdata),
maybe it's a bug in the command 'fill3'.
however set(h,'facealpha',0.5) works
and set(h,'edgecolor','b') also works.

22 Dec 2010 StemBar Function similar to the matlab stem3 but drawing bars instead of lines with markers. Author: Grzegorz Knor

I have a question: how to colormap the bars according to their heights.
I read the help of "bar3", and 'h' in 'stembar.m' returns the handle of each face. So I write the following code:
%%
zdata = ones(length(h),4);
k=0;
for i=1:length(h)/6
ztop = get(h(i*6),'Zdata');
ztop = ztop';
for j=1:6
zdata(6*(i-1)+j,:)=ztop;
k=k+1;
set(h(k),'Cdata',zdata(k,:))
end
end

colormap cool
colorbar
%%
in order to colormap the bars. But it doesn't work.
Could you help me with this problem? I think I haven't totally understand how 'Cdata' works.

Contact us