Subscribe Bookmark RSS Feed

how do I add labels to a bar chart showing the N for each mean


Community Trekker


Oct 23, 2013

vertical bar chart, where each bar represents the mean(col name)? no problem, done

now we want to show the N for each of those means, right at the top of each column

help? thanks


Super User


Jun 23, 2011

You can do this in JMP 11 with Graph Builder.  Prior to version 11 you could only label bars using the Chart platform.

Here's an example that displays the bar label in JMP 11:

dt = open("$sample_data\Bands");

dt << Graph Builder(

    Show Control Panel( 0 ),

    Variables( X( :ink type ), Y( :viscosity ), Overlay( :cylinder size ) ),

    Elements( Bar( X, Y, Legend( 2 ), Bar Style( "Side by side" ),

            Summary Statistic( "Mean" ), Label( "Value" )




In Graph Builder you use the label combobox to select Value:



Super User


Jun 23, 2011

Try using a summary table with both Mean and N, with the latter labelled. Here's an example with Chart platform.

dt = Open( "$SAMPLE_DATA/Big" );

dtsum = dt << Summary( Group( :sex ), Mean( :height ), N( :height ) );

Column( dtsum, 4 ) << label;

dtsum << Chart(

  X( :sex ),

  Y( :Name( "Mean(height)" ) ),

  Label by Row,

  Show Labels,

  Bar Chart( 1 )