@@ -26,7 +26,7 @@ class Axes < Base
2626 # Array of plots contained in this Axes.
2727 attr_reader :plots
2828
29- attr_reader :geometry , : font, :marker_font_size , :legend_font_size ,
29+ attr_reader :font , :marker_font_size , :legend_font_size ,
3030 :title_font_size , :scale , :font_color , :marker_color , :axes ,
3131 :legend_margin , :backend , :marker_caps_height , :marker_font_size
3232
@@ -72,7 +72,6 @@ def initialize figure
7272 @raw_rows = width * ( height /width )
7373
7474 @theme = Rubyplot ::Themes ::CLASSIC_WHITE
75- @geometry = Rubyplot ::MagickWrapper ::Plot ::Scatter ::Geometry . new
7675 vera_font_path = File . expand_path ( 'Vera.ttf' , ENV [ 'MAGICK_FONT_PATH' ] )
7776 @font = File . exist? ( vera_font_path ) ? vera_font_path : nil
7877 @font_color = "#000000"
@@ -298,41 +297,6 @@ def actually_draw
298297 @plots . each ( &:draw )
299298 end
300299
301- # Return a formatted string representing a number value that should be
302- # printed as a label.
303- def label_string ( value , increment )
304- label =
305- if increment
306- if increment >= 10 || ( increment * 1 ) == ( increment * 1 ) . to_i . to_f
307- format ( '%0i' , value )
308- elsif increment >= 1.0 || ( increment * 10 ) == ( increment * 10 ) . to_i . to_f
309- format ( '%0.1f' , value )
310- elsif increment >= 0.1 || ( increment * 100 ) == ( increment * 100 ) . to_i . to_f
311- format ( '%0.2f' , value )
312- elsif increment >= 0.01 || ( increment * 1000 ) == ( increment * 1000 ) . to_i . to_f
313- format ( '%0.3f' , value )
314- elsif increment >= 0.001 || ( increment * 10_000 ) == ( increment * 10_000 ) . to_i . to_f
315- format ( '%0.4f' , value )
316- else
317- value . to_s
318- end
319- elsif ( ( @y_spread . to_f %
320- ( @geometry . marker_count . to_f == 0 ?
321- 1 : @geometry . marker_count . to_f ) == 0 ) ||
322- !@geometry . y_axis_increment . nil? )
323- value . to_i . to_s
324- elsif @y_spread > 10.0
325- format ( '%0i' , value )
326- elsif @y_spread >= 3.0
327- format ( '%0.2f' , value )
328- else
329- value . to_s
330- end
331- parts = label . split ( '.' )
332- parts [ 0 ] . gsub! ( /(\d )(?=(\d \d \d )+(?!\d ))/ , "\\ 1#{ THOUSAND_SEPARATOR } " )
333- parts . join ( '.' )
334- end
335-
336300 def consolidate_plots
337301 bars = @plots . grep ( Rubyplot ::Artist ::Plot ::Bar )
338302 if !bars . empty?
0 commit comments