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
jmp_ingbean
Level I

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

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

2 REPLIES 2
pmroz
Super User

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

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 Data.jmp");

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:

4556_BandsDataBarGraph.png

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

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

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 Class.jmp" );

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 )

);