How can I break the Y axis on a stairs plot?

4 visualizzazioni (ultimi 30 giorni)
Hi:
I need to plot histograms of event intensity for 6 different treatments on the same graph. I used histc and stairs. one of my samples has 7000 events that are in the first bin- and this makes it really hard to see the rest of the bins. Is there a way to break the y axis so I can see both the bottom and top portions of the graph?
this is the code I used
if true
nbins = 25;
mindat = min([intensity250 ; unlabeledintensity]);
maxdat = max([intensity250 ; unlabeledintensity]);
edges = linspace(mindat,maxdat,nbins);
x250= histc(intensity250,edges);
xunl = histc(unlabeledintensity,edges);
x125=histc(intensity125, edges);
x61=histc(intensity61,edges);
x31=histc(intensity31,edges);
x10=histc(intensity10,edges);
figure; hold on
stairs(edges,x250,'r')
stairs(edges,xunl,'b')
stairs(edges,x125, 'g')
stairs(edges,x61, 'k')
stairs(edges,x31, 'm')
stairs(edges,x10, 'c')
% code
end
  2 Commenti
dpb
dpb il 1 Ott 2014
How about
set(gca,'yscale','log')
???
Katie
Katie il 1 Ott 2014
yes! Taking the log made it much easier to visualize. Thank you.

Accedi per commentare.

Risposta accettata

Image Analyst
Image Analyst il 1 Ott 2014
Here's an option: http://www.mathworks.com/matlabcentral/fileexchange/3668-breakaxis. Not sure if that's what you're after though, or if taking the log before calling stairs is what you want.

Più risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by