Class: Charty::Plotters::HistogramPlotter

Inherits:
DistributionPlotter show all
Defined in:
lib/charty/plotters/histogram_plotter.rb

Instance Attribute Summary collapse

Attributes inherited from DistributionPlotter

#color_norm, #input_format, #legend, #plot_data, #var_types, #variables, #weights

Attributes inherited from AbstractPlotter

#color, #color_order, #data, #key_color, #palette, #title, #x, #x_label, #y, #y_label

Instance Method Summary collapse

Methods inherited from DistributionPlotter

#flat_structure, #initialize, #wide_structure

Methods inherited from AbstractPlotter

#initialize, #inspect, #processed_data, #render, #save, #to_iruby, #to_iruby_mimebundle, #var_levels

Constructor Details

This class inherits a constructor from Charty::Plotters::DistributionPlotter

Instance Attribute Details

#bin_rangeObject

TODO: bin_width



59
60
61
# File 'lib/charty/plotters/histogram_plotter.rb', line 59

def bin_range
  @bin_range
end

#binsObject

Returns the value of attribute bins.



38
39
40
# File 'lib/charty/plotters/histogram_plotter.rb', line 38

def bins
  @bins
end

#common_binsObject

TODO: discrete TODO: cumulative



90
91
92
# File 'lib/charty/plotters/histogram_plotter.rb', line 90

def common_bins
  @common_bins
end

#kdeObject

TODO: element TODO: fill TODO: shrink



126
127
128
# File 'lib/charty/plotters/histogram_plotter.rb', line 126

def kde
  @kde
end

#kde_paramsObject

Returns the value of attribute kde_params.



132
133
134
# File 'lib/charty/plotters/histogram_plotter.rb', line 132

def kde_params
  @kde_params
end

#multipleObject

TODO: common_norm



98
99
100
# File 'lib/charty/plotters/histogram_plotter.rb', line 98

def multiple
  @multiple
end

#statObject

Returns the value of attribute stat.



15
16
17
# File 'lib/charty/plotters/histogram_plotter.rb', line 15

def stat
  @stat
end

Instance Method Details

#univariate?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/charty/plotters/histogram_plotter.rb', line 4

def univariate?
  self.variables.key?(:x) != self.variables.key?(:y)
end

#univariate_variableObject



8
9
10
11
12
13
# File 'lib/charty/plotters/histogram_plotter.rb', line 8

def univariate_variable
  unless univariate?
    raise TypeError, "This is not a univariate plot"
  end
  ([:x, :y] & self.variables.keys)[0]
end