Subscribe Bookmark RSS Feed

Overlay several histograms

jeroenbornauw

Community Member

Joined:

Nov 7, 2011

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
Solution

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.

3 REPLIES
pmroz

Super User

Joined:

Jun 23, 2011

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

Joined:

Jun 23, 2011

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" )

                    )

          )

);


Solution

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.