Method: Histogram#initialize
- Defined in:
- lib/histogram/histogram.rb
#initialize(value, params) ⇒ Histogram
-
value- a vector of Float numeric value -
parms- an Hash whit parametrs value
Parms
This Hash contain parmas . List of key permitted .
-
:title- (default “A sample Graph”) Graph main title -
:x_label- (default ‘Categories’) Label of x ass -
:y_label- (default ‘Value’) Label of y ass -
:legend- (default false) Prints legend -
:vertical- (default true) The orientation of the plot -
:n_bins- (default 10) number of bins -
:height- (default 1500) Graph height -
:width- (default 800) Graph width -
:file_name- (default sample.jpg) Graph File Name/Path to save plot. You can chose jpg or pdf
Examples
Class Usage:
values = [1.0,2.0,3.0]
params = {}
plot = BarChart.new(values,params)
#To view
plot.view
#to save
plot.save
36 37 38 39 |
# File 'lib/histogram/histogram.rb', line 36 def initialize(value,params) @value=check_val(value) @params=self.check_par(params) end |