Credits Overview Plotting Styles Commands Terminals

newhistogram

Syntax:

     newhistogram {"<title>" {font "name,size"} {tc <colorspec>}}
                  {lt <linetype>} {fs <fillstyle>} {at <x-coord>}

More than one set of histograms can appear in a single plot. In this case you can force a gap between them, and a separate label for each set, by using the newhistogram command. For example

      set style histogram  cluster
      plot newhistogram "Set A", 'a' using 1, '' using 2, '' using 3, \
           newhistogram "Set B", 'b' using 1, '' using 2, '' using 3

The labels "Set A" and "Set B" will appear beneath the respective sets of histograms, under the overall x axis label.

The newhistogram command can also be used to force histogram coloring to begin with a specific color (linetype). By default colors will continue to increment successively even across histogram boundaries. Here is an example using the same coloring for multiple histograms

      plot newhistogram "Set A" lt 4, 'a' using 1, '' using 2, '' using 3, \
           newhistogram "Set B" lt 4, 'b' using 1, '' using 2, '' using 3

Similarly you can force the next histogram to begin with a specified fillstyle. If the fillstyle is set to pattern, then the pattern used for filling will be incremented automatically.

Starting a new histogram will normally add a blank entry to the key, so that titles from this set of histogram components will be separated from those of the previous histogram. This blank line may be undesirable if the components have no individual titles. It can be suppressed by modifying the style with set style histogram nokeyseparators.

figure_newhist

The at <x-coord> option sets the x coordinate position of the following histogram to <x-coord>. For example

       set style histogram cluster
       set style data histogram
       set style fill solid 1.0 border -1
       set xtic 1 offset character 0,0.3
       plot newhistogram "Set A", \
            'file.dat' u 1 t 1, '' u 2 t 2, \
            newhistogram "Set B" at 8, \
            'file.dat' u 2 t 2, '' u 2 t 2

will position the second histogram to start at x=8.