examples/histogram.rb
# The alpha frequencies are shown as white dots.
The alpha frequencies are shown as white dots.
The alpha frequencies are shown as white dots .
def alpha_hist(freqs, scale, fg, bg)
      histogram = Image.new(HISTOGRAM_COLS, HISTOGRAM_ROWS) do |options|
        options.background_color = bg
        options.border_color = fg
      end
      gc = Draw.new
      gc.affine(1, 0, 0, -scale, 0, HISTOGRAM_ROWS)
      gc.fill('white')
      HISTOGRAM_COLS.times do |x|
        gc.point(x, freqs[x])
      end
      gc.draw(histogram)
      histogram['Label'] = 'Alpha'
      histogram
    end
def alpha_hist ( freqs , scale , fg , bg ) histogram = Image . new ( HISTOGRAM_COLS , HISTOGRAM_ROWS ) do | options | options . background_color = bg options . border_color = fg end gc = Draw . new gc . affine ( 1 , 0 , 0 , - scale , 0 , HISTOGRAM_ROWS ) gc . fill ( 'white' ) HISTOGRAM_COLS . times do | x | gc . point ( x , freqs [ x ] ) end gc . draw ( histogram ) histogram [ 'Label' ] = 'Alpha' histogram end
The alpha frequencies are shown as white dots.
The alpha frequencies are shown as white dots .
freqs
<not_specific>
scale
<not_specific>
fg
<not_specific>
bg
<not_specific>