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

Attributes inherited from AbstractPlotter

#color, #color_order, #data, #key_color, #palette, #x, #y

Instance Method Summary collapse

Methods inherited from DistributionPlotter

#flat_structure, #initialize

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

#binsObject

Returns the value of attribute bins.



48
49
50
# File 'lib/charty/plotters/histogram_plotter.rb', line 48

def bins
  @bins
end

#kdeObject

TODO: element TODO: fill TODO: shrink



102
103
104
# File 'lib/charty/plotters/histogram_plotter.rb', line 102

def kde
  @kde
end

#kde_paramsObject

Returns the value of attribute kde_params.



108
109
110
# File 'lib/charty/plotters/histogram_plotter.rb', line 108

def kde_params
  @kde_params
end

#multipleObject

TODO: bin_width TODO: bin_range TODO: discrete TODO: cumulative TODO: common_bins TODO: common_norm



74
75
76
# File 'lib/charty/plotters/histogram_plotter.rb', line 74

def multiple
  @multiple
end

#statObject

Returns the value of attribute stat.



25
26
27
# File 'lib/charty/plotters/histogram_plotter.rb', line 25

def stat
  @stat
end

#weightsObject

Returns the value of attribute weights.



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

def weights
  @weights
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