cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar

Overlay several histograms

Hi all,

I am looking for a way in JMP to overlay histograms coming from 3 different sources on one plot.

I've been trying several things but all I could do thus far is put the three histograms next to or below one another.

What I would like to have is one plot containing the different histograms in different colors.

Any pointers?

Thanx!

1 ACCEPTED SOLUTION

Accepted Solutions
XanGregg
Staff

Overlay several histograms

I haven't had good results trying to overlay histograms because one obscures the other or the details get muddied if using transparency. However, you can do it in JMP with the Right-Click in Graph > Edit > Copy Frame Contents from one graph and use Paste Frame Contents into another graph.

Another option is Compare Densities in the Oneway platform which shows overlaid (or stacked) smooth density curves.

View solution in original post

3 REPLIES 3
pmroz
Super User

Overlay several histograms

I don't think you can combine histograms onto one plot using Analyze > Distributions.

But, if your data is categorical you can simply make a bar chart of the different variables.

I'm guessing that your data is not categorical, in which case you need to bin your data into categorical columns, and then make a barchart of the categorical columns.

Can you give us a better idea of what your data looks like?

ms
Super User (Alumni) ms
Super User (Alumni)

Overlay several histograms

Below is a jsl example of PMroz' suggestion using the Chart platform or alternatively Graph Builder to generate overlaid "histograms". Both platforms leave space between bars which may not be desired. It seems not to be possible to adjust spacing as in e.g. Excel.

 

 

 

dt = Open( "$ENGLISH_SAMPLE_DATA/Big Class.jmp" );
// get bins from histogram
dist = dt << Distribution(
          Column( :Weight ),
          save( level midpoints ),
          invisible
);
dist << close window;
col = Column( dt, N Col( dt ) );
col << set modeling type( Nominal );
// Chart histogram
Chart( X( col, :sex ), Y( N ), Bar Chart( 1 ) );
// Graph Builder histogram
Graph Builder(
          Show Control Panel( 0 ),
          Variables( X( col ), Overlay( :sex ) ),
          Elements(
                    Bar(
                              X,
                              Legend( 2 ),
                              Bar Style( "Side by side" ),
                              Summary Statistic( "Mean" )
                    )
          )
);

 

 

XanGregg
Staff

Overlay several histograms

I haven't had good results trying to overlay histograms because one obscures the other or the details get muddied if using transparency. However, you can do it in JMP with the Right-Click in Graph > Edit > Copy Frame Contents from one graph and use Paste Frame Contents into another graph.

Another option is Compare Densities in the Oneway platform which shows overlaid (or stacked) smooth density curves.