Class: CompareCompressors::RawPlotter
- Defined in:
- lib/compare_compressors/plotters/raw_plotter.rb
Overview
Plot grouped compression results to gnuplot in 3D (compression time, decompression time, and compressed size).
Constant Summary collapse
- DEFAULT_VIEW_ROT_X =
30
- DEFAULT_VIEW_ROT_Z =
350
Constants inherited from Plotter
Plotter::DEFAULT_AUTOSCALE_FIX, Plotter::DEFAULT_LMARGIN, Plotter::DEFAULT_LOGSCALE_SIZE, Plotter::DEFAULT_OUTPUT, Plotter::DEFAULT_SHOW_LABELS, Plotter::DEFAULT_TERMINAL, Plotter::DEFAULT_TITLE, Plotter::DEFAULT_USE_CPU_TIME
Instance Attribute Summary collapse
-
#view_rot_x ⇒ Object
readonly
Returns the value of attribute view_rot_x.
-
#view_rot_z ⇒ Object
readonly
Returns the value of attribute view_rot_z.
Attributes inherited from Plotter
#autoscale_fix, #group_results, #io, #lmargin, #logscale_size, #output, #show_labels, #terminal, #title, #use_cpu_time
Instance Method Summary collapse
- #column_names ⇒ Object
-
#initialize(**options) ⇒ RawPlotter
constructor
A new instance of RawPlotter.
- #points_splots ⇒ Object
- #splots ⇒ Object
- #write_labels ⇒ Object
- #write_style ⇒ Object
Methods inherited from Plotter
Constructor Details
#initialize(**options) ⇒ RawPlotter
Returns a new instance of RawPlotter.
12 13 14 15 16 |
# File 'lib/compare_compressors/plotters/raw_plotter.rb', line 12 def initialize(**) @view_rot_x = .delete(:view_rot_x) || DEFAULT_VIEW_ROT_X @view_rot_z = .delete(:view_rot_z) || DEFAULT_VIEW_ROT_Z super(**) end |
Instance Attribute Details
#view_rot_x ⇒ Object (readonly)
Returns the value of attribute view_rot_x.
18 19 20 |
# File 'lib/compare_compressors/plotters/raw_plotter.rb', line 18 def view_rot_x @view_rot_x end |
#view_rot_z ⇒ Object (readonly)
Returns the value of attribute view_rot_z.
19 20 21 |
# File 'lib/compare_compressors/plotters/raw_plotter.rb', line 19 def view_rot_z @view_rot_z end |
Instance Method Details
#column_names ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/compare_compressors/plotters/raw_plotter.rb', line 33 def column_names if use_cpu_time [ :mean_compression_cpu_hours, :mean_compressed_gibytes, :mean_decompression_cpu_hours ] else [ :mean_compression_elapsed_hours, :mean_compressed_gibytes, :mean_decompression_elapsed_hours ] end end |
#points_splots ⇒ Object
53 54 55 56 57 58 59 |
# File 'lib/compare_compressors/plotters/raw_plotter.rb', line 53 def points_splots compressor_names.map do |name| "'$#{name}' using #{column_numbers.join(':')} with points" \ " #{point_style(name)}" \ " title '#{find_display_name(name)}'" end end |
#splots ⇒ Object
49 50 51 |
# File 'lib/compare_compressors/plotters/raw_plotter.rb', line 49 def splots points_splots end |
#write_labels ⇒ Object
27 28 29 30 31 |
# File 'lib/compare_compressors/plotters/raw_plotter.rb', line 27 def write_labels io.puts "set xlabel 'Compression Time #{time_unit}' rotate parallel" io.puts 'set ylabel "Compressed Size (GiB)" rotate parallel' io.puts "set zlabel 'Decompression Time #{time_unit}' rotate parallel" end |
#write_style ⇒ Object
21 22 23 24 25 |
# File 'lib/compare_compressors/plotters/raw_plotter.rb', line 21 def write_style super io.puts format('set view %d, %d', view_rot_x, view_rot_z) io.puts 'set grid xtics ytics ztics' end |