top of each other? I have two vectors, and I would like to plot two histograms representing these vectors on the same plot. Any suggestions? I would like the bins of the histogram to be transparent. Also is there a way to put a CDF plot on the same Figure?
|
|
0
|
|
|
|
Reply
|
jenya
|
11/18/2010 11:17:03 PM |
|
On 10-11-18 05:17 PM, jenya polyakova wrote:
> top of each other? I have two vectors, and I would like to plot two
> histograms representing these vectors on the same plot. Any suggestions?
If you want them to overlay each other, then use the standard "hold on" .
If you want them to be offset from each other, then when you use bar() to plot
the histograms, specify {different} explicit x values if you want the
separation to be on the x axis; for separation on the y axis, you would add a
constant to the y values for the second series and then after you had created
the bar object for the second series, you would set the BaseValue property for
the series to the constant that you shifted by.
> I would like the bins of the histogram to be transparent.
In current versions of matlab, bar() returns a hggroup object that has
Children, with each child being a patch object. You can set the alpha
transparency for each of the patch objects (there will, if I recall, be one
patch object per column.)
> Also is there
> a way to put a CDF plot on the same Figure?
cdf -- sure, "hold on"
Note: the above techniques apply to reasonably recent version of Matlab; I
haven't happened to see a response from you yet about which Matlab you are
using; possibly your version uses a slightly different technique for bar plots.
|
|
0
|
|
|
|
Reply
|
Walter
|
11/18/2010 11:40:40 PM
|
|
> top of each other? I have two vectors, and I would like to plot two
> histograms representing these vectors on the same plot. Any suggestions? I
> would like the bins of the histogram to be transparent. Also is there a
> way to put a CDF plot on the same Figure?
You got advice about this, but I want to suggest using kernel density
estimates instead of histograms. They're easier to superimpose. Try this for
an example:
load fisheriris
[y,x] = ksdensity(meas(1:50,1)); plot(x,y,'b-')
hold on; [y,x] = ksdensity(meas(51:100,1)); plot(x,y,'r-')
[y,x] = ksdensity(meas(101:150,1)); plot(x,y,'g-'); hold off
-- Tom
|
|
0
|
|
|
|
Reply
|
Tom
|
11/19/2010 4:01:20 PM
|
|
|
2 Replies
392 Views
(page loaded in 0.099 seconds)
Similiar Articles: how to plot histograms on - comp.soft-sys.matlabtop of each other? I have two vectors, and I would like to plot two histograms representing these vectors on the same plot. Any suggestions? I would l... how to plot histogram in 12-bit from an 16-bit image? - comp.soft ...hi guys, so in my university project, i need to plot a histogram in 12-bit portrayal (the x-axis is from 0 - 4096 gray values) from an 16-bit image... Histogram with gplot - comp.soft-sys.sasHello I would like to create a histogram with several variables plotted against the horizontal variable. Now, this can be done using gplot and a ... cumulative histogram - comp.soft-sys.matlabhow to plot histograms on - comp.soft-sys.matlab cumulative histogram - comp.soft-sys.matlab how to plot histograms on - comp.soft-sys.matlab cumulative histogram - comp ... Stacked histogram and label - comp.graphics.apps.gnuplot ...Hi, I have plotted a simple stacked histogram using: set style histogram rowstacked plot 'mydata.dat' using 2:xticlabels(1) title column(2), \ ... histogram error bar color - comp.graphics.apps.gnuplotwhat is the keyword for how the errorbars get colored in a histogram? -Bryan ... histogram : values on top of the bars - comp.graphics.apps.gnuplot ...Hi folks, I'm calling for gnuplot specialists. Using version 4.2 here. How can I write the value on top of the bars of my histogram ? thank you... Logarithmic Bins for Histogram - comp.soft-sys.matlabHistogram with Logarithmic Bins - Coyote's Guide to IDL Programming Creating a histogram plot with logarithmic bins in IDL. ... Creating a Histogram with Logarithmic Bins. Percentage display on Y-axis of Histogram - comp.soft-sys.matlab ...Hi, I have a bunch of data and I want to plot the Histogram graph of them. However, I need to have the percentage of the number of data with respec... high density scatterplot - comp.soft-sys.matlabi have a scatter plot with of several thousand points. Needless to say I don't ... in the Matlab File Exchange, you can find a contribution for n-dimensional histograms. Histogram plot - MATLAB - MathWorks - MATLAB and Simulink for ...hist -Histogram plot. Alternatives. To graph selected variables, use the Plot Selector in the Workspace Browser, or use the Figure Palette Plot Catalog. Making Histograms - QuarkNetWhat is a Histogram? A histogram is "a representation of a frequency distribution by ... There are two peaks in this plot: a taller primary peak as well as a ... 7/29/2012 7:16:38 AM
|