Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ Metrics/ClassLength:
Style/ParallelAssignment:
Enabled: false

Style/CommentedKeyword:
Enabled: false

Style/DoubleNegation:
Enabled: false

Expand Down
2 changes: 1 addition & 1 deletion lib/rubyplot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
module Rubyplot
def self.backend
b = ENV['RUBYPLOT_BACKEND']
return b.to_sym if %w[magick ].include?(b)
return b.to_sym if %w[magick].include?(b)

:magick
end
Expand Down
13 changes: 4 additions & 9 deletions lib/rubyplot/artist/axes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,7 @@ def configure_title
@texts << Rubyplot::Artist::Text.new(
@title, self, abs_x: abs_x + width / 2, abs_y: abs_y + @title_margin,
font: @font, color: @font_color,
pointsize: @title_font_size, internal_label: 'axes title.'

)
pointsize: @title_font_size, internal_label: 'axes title.')
end

def calculate_xy_axes_origin
Expand Down Expand Up @@ -348,9 +346,6 @@ def set_yrange
@y_axis.min_val = @y_range[0]
@y_axis.max_val = @y_range[1]
end
end
# class Axes
end
# moudle Artist
end
# module Rubyplot
end # class Axes
end # moudle Artist
end # module Rubyplot
13 changes: 4 additions & 9 deletions lib/rubyplot/artist/axis/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,13 @@ def initialize axes
@lines = []
end


def draw
configure_title
@lines.each(&:draw)
@texts.each(&:draw)
end

end
# class Base
end
# class Axis
end
# class Artist
end
# module Rubyplot
end # class Base
end # class Axis
end # class Artist
end # module Rubyplot
11 changes: 4 additions & 7 deletions lib/rubyplot/artist/axis/x_axis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def initialize axes
@length = (@abs_x2 - @abs_x1).abs
configure_axis_line
end

private

def configure_axis_line
Expand All @@ -30,9 +30,6 @@ def configure_title
abs_x: @axes.origin[0] + (@abs_x2 - @abs_x1)/2
)
end
end
# class XAxis
end
# class Artist
end
# module Rubyplot
end # class XAxis
end # class Artist
end # module Rubyplot
9 changes: 3 additions & 6 deletions lib/rubyplot/artist/axis/y_axis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ def configure_title
pointsize: @axes.marker_font_size
)
end
end
# class YAxis
end
# class Artist
end
# module Rubyplot
end # class YAxis
end # class Artist
end # module Rubyplot
9 changes: 3 additions & 6 deletions lib/rubyplot/artist/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ def initialize(backend, abs_x, abs_y)
@abs_x = abs_x
@abs_y = abs_y
end
end
# class Base
end
# module Artist
end
# module Rubyplot
end # class Base
end # module Artist
end # module Rubyplot
9 changes: 3 additions & 6 deletions lib/rubyplot/artist/circle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ def draw
color: Rubyplot::Color::COLOR_INDEX[@color]
)
end
end
# class Circle
end
# module Artist
end
# module Rubyplot
end # class Circle
end # module Artist
end # module Rubyplot
9 changes: 3 additions & 6 deletions lib/rubyplot/artist/figure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ def setup_default_theme
@marker_color = @theme_options[:marker_color]
@font_color = @theme_options[:font_color] || @marker_color
end
end
# class Figure
end
# module Artist
end
# module Rubyplot
end # class Figure
end # module Artist
end # module Rubyplot
9 changes: 3 additions & 6 deletions lib/rubyplot/artist/legend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ def configure_legend_text
pointsize: @font_size
)
end
end
# class Legend
end
# class Artist
end
# module Rubyplot
end # class Legend
end # class Artist
end # module Rubyplot
9 changes: 3 additions & 6 deletions lib/rubyplot/artist/legend_box.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ def configure_legends
)
end
end
end
# class LegendBox
end
# module Artist
end
# module Rubyplot
end # class LegendBox
end # module Artist
end # module Rubyplot
9 changes: 3 additions & 6 deletions lib/rubyplot/artist/line2d.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ def draw
@backend.draw_line(x1: @abs_x1, y1: @abs_y1, x2: @abs_x2, y2: @abs_y2,
stroke_width: @stroke_width)
end
end
# class Line2D
end
# class Artist
end
# module Rubyplot
end # class Line2D
end # class Artist
end # module Rubyplot
14 changes: 5 additions & 9 deletions lib/rubyplot/artist/plot/area.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Artist
module Plot
class Area < Artist::Plot::Base
attr_accessor :sorted_data

def initialize(*)
super
@sorted_data = true
Expand Down Expand Up @@ -32,11 +32,7 @@ def draw
fill_opacity: 0.3
).draw
end
end
# class Area
end
# module Plot
end
# module Artist
end
# module Rubyplot
end # class Area
end # module Plot
end # module Artist
end # module Rubyplot
12 changes: 4 additions & 8 deletions lib/rubyplot/artist/plot/bar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,7 @@ def setup_bar_rectangles
)
end
end
end
# class Bar
end
# module Plot
end
# module Artist
end
# module Rubyplot
end # class Bar
end # module Plot
end # module Artist
end # module Rubyplot
12 changes: 4 additions & 8 deletions lib/rubyplot/artist/plot/bar_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ def draw

protected

end
# class BarType
end
# module Plot
end
# module Artist
end
# module Rubyplot
end # class BarType
end # module Plot
end # module Artist
end # module Rubyplot
12 changes: 4 additions & 8 deletions lib/rubyplot/artist/plot/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,7 @@ def normalize
end
end
end
end
# class Base
end
# module Plot
end
# module Artist
end
# module Rubyplot
end # class Base
end # module Plot
end # module Artist
end # module Rubyplot
12 changes: 4 additions & 8 deletions lib/rubyplot/artist/plot/bubble.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ def draw
end
@bubbles.each(&:draw)
end
end
# class Bubble
end
# module Plot
end
# module Artist
end
# module Rubyplot
end # class Bubble
end # module Plot
end # module Artist
end # module Rubyplot
12 changes: 4 additions & 8 deletions lib/rubyplot/artist/plot/line.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@ def draw_lines
prev_y = new_y
end
end
end
# class Line
end
# module Plot
end
# module Artist
end
# module Rubyplot
end # class Line
end # module Plot
end # module Artist
end # module Rubyplot
12 changes: 4 additions & 8 deletions lib/rubyplot/artist/plot/multi_bars.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,7 @@ def set_bar_dims bar_plot, index
bar_plot.abs_y_left[i] = @axes.origin[1] - @axes.x_axis.stroke_width
end
end
end
# class MultiBars
end
# module Plot
end
# module Artist
end
# module Rubyplot
end # class MultiBars
end # module Plot
end # module Artist
end # module Rubyplot
12 changes: 4 additions & 8 deletions lib/rubyplot/artist/plot/multi_stacked_bar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,7 @@ def set_bar_dims bar, plot_index
bar.abs_y_left[i] = (@axes.abs_y + @axes.y_axis.length) - pedestal_height
end
end
end
# class StackedBar
end
# module Plot
end
# module Artist
end
# module Rubyplot
end # class StackedBar
end # module Plot
end # module Artist
end # module Rubyplot
12 changes: 4 additions & 8 deletions lib/rubyplot/artist/plot/scatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ def draw
).draw
end
end
end
# class Scatter
end
# module Plot
end
# module Artist
end
# module Rubyplot
end # class Scatter
end # module Plot
end # module Artist
end # module Rubyplot
12 changes: 4 additions & 8 deletions lib/rubyplot/artist/plot/stacked_bar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,7 @@ def setup_bar_rectangles
)
end
end
end
# class StackedBar
end
# module Plot
end
# module Artist
end
# module Rubyplot
end # class StackedBar
end # module Plot
end # module Artist
end # module Rubyplot
9 changes: 3 additions & 6 deletions lib/rubyplot/artist/polygon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ def draw
fill_opacity: @fill_opacity
)
end
end
# class Polygon
end
# module Artist
end
# module Rubyplot
end # class Polygon
end # module Artist
end # module Rubyplot
9 changes: 3 additions & 6 deletions lib/rubyplot/artist/rectangle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ def draw
fill_color: @fill_color
)
end
end
# class Rectangle
end
# class Artist
end
# moduel Rubyplot
end # class Rectangle
end # class Artist
end # module Rubyplot
9 changes: 3 additions & 6 deletions lib/rubyplot/artist/text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ def draw
rotation: @rotation
)
end
end
# class Text
end
# class Artist
end
# module Rubyplot
end # class Text
end # class Artist
end # module Rubyplot
Loading