diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..97c645a --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +Gemfile.lock +**/*.swp +coverage/ diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..3687797 --- /dev/null +++ b/.rspec @@ -0,0 +1,2 @@ +--require spec_helper +--color diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..be02188 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,13 @@ +require: rubocop-rspec +inherit_from: .rubocop_todo.yml + +AllCops: + TargetRubyVersion: 2.5 + +RSpec/DescribeClass: + Exclude: + - 'spec/**/*_spec.rb' + +Metrics/BlockLength: + Exclude: + - 'spec/**/*_spec.rb' diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 0000000..961b79d --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,606 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2019-11-26 16:32:38 +0000 using RuboCop version 0.73.0. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: with_first_argument, with_fixed_indentation +Layout/AlignArguments: + Exclude: + - 'lib/gnuplot.rb' + - 'test/test_gnuplot.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Layout/AlignArray: + Exclude: + - 'test/test_gnuplot.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Layout/EmptyLineAfterGuardClause: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Layout/EmptyLineAfterMagicComment: + Exclude: + - 'ruby_gnuplot.gemspec' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: AllowAdjacentOneLineDefs, NumberOfEmptyLines. +Layout/EmptyLineBetweenDefs: + Exclude: + - 'lib/gnuplot.rb' + - 'test/test_gnuplot.rb' + +# Offense count: 12 +# Cop supports --auto-correct. +Layout/EmptyLines: + Exclude: + - 'lib/gnuplot.rb' + - 'test/test_gnuplot.rb' + +# Offense count: 10 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: empty_lines, no_empty_lines +Layout/EmptyLinesAroundBlockBody: + Exclude: + - 'examples/multiple_data_sets.rb' + - 'test/arrtest.rb' + - 'test/multtest.rb' + - 'test/sinwave.rb' + +# Offense count: 11 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only +Layout/EmptyLinesAroundClassBody: + Exclude: + - 'lib/gnuplot.rb' + - 'test/test_gnuplot.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +Layout/EmptyLinesAroundMethodBody: + Exclude: + - 'lib/gnuplot.rb' + - 'test/test_gnuplot.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines +Layout/EmptyLinesAroundModuleBody: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment. +Layout/ExtraSpacing: + Exclude: + - 'test/test_gnuplot.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: IndentationWidth. +Layout/IndentAssignment: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: normal, indented_internal_methods +Layout/IndentationConsistency: + Exclude: + - 'examples/multiple_data_sets.rb' + - 'lib/gnuplot.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +# Configuration parameters: Width, IgnoredPatterns. +Layout/IndentationWidth: + Exclude: + - 'examples/3d_surface_plot.rb' + - 'lib/gnuplot.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +Layout/SpaceAfterComma: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 13 +# Cop supports --auto-correct. +Layout/SpaceAfterMethodName: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: space, no_space +Layout/SpaceAroundEqualsInParameterDefault: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 6 +# Cop supports --auto-correct. +# Configuration parameters: AllowForAlignment. +Layout/SpaceAroundOperators: + Exclude: + - 'examples/discrete_points.rb' + - 'examples/multiple_data_sets.rb' + - 'ruby_gnuplot.gemspec' + - 'test/arrtest.rb' + - 'test/histtest.rb' + - 'test/multtest.rb' + +# Offense count: 4 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces. +# SupportedStyles: space, no_space +# SupportedStylesForEmptyBraces: space, no_space +Layout/SpaceBeforeBlockBraces: + Exclude: + - 'examples/histogram.rb' + - 'lib/gnuplot.rb' + +# Offense count: 18 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBrackets. +# SupportedStyles: space, no_space, compact +# SupportedStylesForEmptyBrackets: space, no_space +Layout/SpaceInsideArrayLiteralBrackets: + Exclude: + - 'lib/gnuplot.rb' + - 'test/test_gnuplot.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Layout/SpaceInsideArrayPercentLiteral: + Exclude: + - 'examples/histogram.rb' + +# Offense count: 7 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters. +# SupportedStyles: space, no_space +# SupportedStylesForEmptyBraces: space, no_space +Layout/SpaceInsideBlockBraces: + Exclude: + - 'examples/histogram.rb' + - 'lib/gnuplot.rb' + +# Offense count: 120 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: space, no_space +Layout/SpaceInsideParens: + Enabled: false + +# Offense count: 6 +# Cop supports --auto-correct. +# Configuration parameters: IndentationWidth. +Layout/Tab: + Exclude: + - 'examples/3d_surface_plot.rb' + - 'examples/multiple_data_sets.rb' + - 'lib/gnuplot.rb' + - 'test/test_gnuplot.rb' + +# Offense count: 7 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: final_newline, final_blank_line +Layout/TrailingBlankLines: + Exclude: + - 'examples/histogram.rb' + - 'examples/sin_wave.rb' + - 'test/arrtest.rb' + - 'test/histtest.rb' + - 'test/multtest.rb' + - 'test/sinwave.rb' + - 'test/test_gnuplot.rb' + +# Offense count: 27 +# Cop supports --auto-correct. +# Configuration parameters: AllowInHeredoc. +Layout/TrailingWhitespace: + Exclude: + - 'examples/discrete_points.rb' + - 'examples/histogram.rb' + - 'examples/multiple_data_sets.rb' + - 'examples/output_image_file.rb' + - 'examples/sin_wave.rb' + +# Offense count: 1 +Lint/AmbiguousOperator: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 2 +Lint/ShadowingOuterLocalVariable: + Exclude: + - 'test/test_gnuplot.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. +Lint/UnusedBlockArgument: + Exclude: + - 'test/histtest.rb' + +# Offense count: 1 +Lint/UselessAssignment: + Exclude: + - 'test/test_gnuplot.rb' + +# Offense count: 3 +Metrics/AbcSize: + Max: 23 + +# Offense count: 9 +# Configuration parameters: CountComments, ExcludedMethods. +# ExcludedMethods: refine +Metrics/BlockLength: + Max: 143 + +# Offense count: 1 +Metrics/CyclomaticComplexity: + Max: 13 + +# Offense count: 8 +# Configuration parameters: CountComments, ExcludedMethods. +Metrics/MethodLength: + Max: 22 + +# Offense count: 1 +Metrics/PerceivedComplexity: + Max: 12 + +# Offense count: 1 +# Configuration parameters: EnforcedStyleForLeadingUnderscores. +# SupportedStylesForLeadingUnderscores: disallowed, required, optional +Naming/MemoizedInstanceVariableName: + Exclude: + - 'Rakefile' + +# Offense count: 4 +# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. +# AllowedNames: io, id, to, by, on, in, at, ip, db +Naming/UncommunicativeMethodParamName: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 1 +# Configuration parameters: EnforcedStyle. +# SupportedStyles: snake_case, camelCase +Naming/VariableName: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 1 +Security/Eval: + Exclude: + - 'Rakefile' + +# Offense count: 16 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: prefer_alias, prefer_alias_method +Style/Alias: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: always, conditionals +Style/AndOr: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 6 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods, AllowBracesOnProceduralOneLiners. +# SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces +# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object +# FunctionalMethods: let, let!, subject, watch +# IgnoredMethods: lambda, proc, it +Style/BlockDelimiters: + Exclude: + - 'examples/multiple_data_sets.rb' + - 'lib/gnuplot.rb' + - 'test/multtest.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: is_a?, kind_of? +Style/ClassCheck: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +Style/ClassMethods: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 9 +# Cop supports --auto-correct. +Style/ColonMethodCall: + Exclude: + - 'lib/gnuplot.rb' + - 'test/test_gnuplot.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions. +# SupportedStyles: assign_to_condition, assign_inside_condition +Style/ConditionalAssignment: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 7 +Style/Documentation: + Exclude: + - 'spec/**/*' + - 'test/**/*' + - 'lib/gnuplot.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/Encoding: + Exclude: + - 'ruby_gnuplot.gemspec' + +# Offense count: 9 +# Cop supports --auto-correct. +Style/ExpandPathArguments: + Exclude: + - 'Rakefile' + - 'examples/3d_surface_plot.rb' + - 'examples/discrete_points.rb' + - 'examples/histogram.rb' + - 'examples/multiple_data_sets.rb' + - 'examples/output_image_file.rb' + - 'examples/sin_wave.rb' + - 'ruby_gnuplot.gemspec' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: each, for +Style/For: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 23 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: always, never +Style/FrozenStringLiteralComment: + Enabled: false + +# Offense count: 1 +# Configuration parameters: MinBodyLength. +Style/GuardClause: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. +# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys +Style/HashSyntax: + EnforcedStyle: hash_rockets + +# Offense count: 3 +# Cop supports --auto-correct. +Style/IfUnlessModifier: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 1 +Style/IfUnlessModifierOfIfUnless: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: IgnoredMethods. +Style/MethodCallWithoutArgsParentheses: + Exclude: + - 'test/histtest.rb' + +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: require_parentheses, require_no_parentheses, require_no_parentheses_except_multiline +Style/MethodDefParentheses: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 1 +Style/MethodMissingSuper: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 1 +Style/MissingRespondToMissing: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 3 +# Cop supports --auto-correct. +Style/MultilineIfThen: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 3 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: literals, strict +Style/MutableConstant: + Exclude: + - 'lib/gnuplot.rb' + - 'lib/ruby_gnuplot/version.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: both, prefix, postfix +Style/NegatedIf: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/NestedModifier: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/Not: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 18 +# Cop supports --auto-correct. +# Configuration parameters: Strict. +Style/NumericLiterals: + MinDigits: 7 + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods. +# SupportedStyles: predicate, comparison +Style/NumericPredicate: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 3 +# Cop supports --auto-correct. +# Configuration parameters: AllowSafeAssignment, AllowInMultilineConditions. +Style/ParenthesesAroundCondition: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: PreferredDelimiters. +Style/PercentLiteralDelimiters: + Exclude: + - 'examples/histogram.rb' + +# Offense count: 3 +# Cop supports --auto-correct. +# Configuration parameters: AllowMultipleReturnValues. +Style/RedundantReturn: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 5 +# Cop supports --auto-correct. +Style/RedundantSelf: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: use_perl_names, use_english_names +Style/SpecialGlobalVars: + Exclude: + - 'ruby_gnuplot.gemspec' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/StderrPuts: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 235 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline. +# SupportedStyles: single_quotes, double_quotes +Style/StringLiterals: + Enabled: false + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: MinSize. +# SupportedStyles: percent, brackets +Style/SymbolArray: + EnforcedStyle: brackets + +# Offense count: 7 +# Cop supports --auto-correct. +# Configuration parameters: IgnoredMethods. +# IgnoredMethods: respond_to, define_method +Style/SymbolProc: + Exclude: + - 'examples/discrete_points.rb' + - 'examples/histogram.rb' + - 'examples/multiple_data_sets.rb' + - 'lib/gnuplot.rb' + - 'test/arrtest.rb' + - 'test/multtest.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, AllowSafeAssignment. +# SupportedStyles: require_parentheses, require_no_parentheses, require_parentheses_when_complex +Style/TernaryParentheses: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyleForMultiline. +# SupportedStylesForMultiline: comma, consistent_comma, no_comma +Style/TrailingCommaInArrayLiteral: + Exclude: + - 'examples/histogram.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: WordRegex. +# SupportedStyles: percent, brackets +Style/WordArray: + EnforcedStyle: percent + MinSize: 10 + +# Offense count: 3 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: forbid_for_all_comparison_operators, forbid_for_equality_operators_only, require_for_all_comparison_operators, require_for_equality_operators_only +Style/YodaCondition: + Exclude: + - 'test/test_gnuplot.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Style/ZeroLengthPredicate: + Exclude: + - 'lib/gnuplot.rb' + +# Offense count: 9 +# Cop supports --auto-correct. +# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. +# URISchemes: http, https +Metrics/LineLength: + Max: 115 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8123674 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM ruby:2.5.0 as base + +RUN apt-get update && apt-get install -y gnuplot + +RUN useradd -u 1000 gnuplot; \ + mkdir -p /home/gnuplot/gnuplot; \ + chown gnuplot.gnuplot -R /home/gnuplot + +WORKDIR /home/gnuplot/gnuplot + +USER gnuplot + +COPY lib/ ./lib/ +COPY *.gemspec ./ +COPY Gemfile ./ + +RUN gem install bundler; bundle install diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..3ef8ff9 --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +source 'https://rubygems.org' + +# Specify your gem's dependencies in ruby_gnuplot.gemspec +gemspec diff --git a/README.textile b/README.textile index 4ec5086..3757e4e 100644 --- a/README.textile +++ b/README.textile @@ -16,10 +16,10 @@ h2. History and Background h2. Pre-requisites and Installation - 1. Install XQuartz from here: + 1. (mac) Install XQuartz from here: @http://xquartz.macosforge.org/landing/@ - 2. Install gnuplot with homebrew: + 2. Install gnuplot with homebrew (not OS X? install it using your package manager): @brew install gnuplot --with-x11@ 3. Install gnuplot gem: @@ -188,6 +188,8 @@ File.open( "gnuplot.dat", "w") do |gp| end +h3. Miscellanrous + You can also add arbitrary lines to the output
@@ -196,3 +198,9 @@ plot.arbitrary_lines << "set ylabel \"y label\" font \"Helvetica,20\""
See more in the examples folder. Also since this is basically just a wrapper for gnuplot itself, you should be able to do anything that it can do (demos:
http://gnuplot.sourceforge.net/demo_4.4/ )
+
+h3. Security
+
+Note that if you pass any user-controlled strings to the gem, it's possible for an attacker to run arbitrary commands.
+
+In addition to title, any other graph properties that accept strings should be affected too. they're all passed to the system command. So only use strings you trust.
diff --git a/Rakefile b/Rakefile
index d8ae9ee..bc3514b 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,21 +1,23 @@
-require 'jeweler2'
-Jeweler::Tasks.new do |s|
- s.name = 'gnuplot'
- s.description = s.summary = "Utility library to aid in interacting with gnuplot from ruby"
- s.version = "2.6.1"
- s.authors='roger pack'
- s.email = "rogerpack2005@gmail.com"
- s.homepage = "http://github.com/rdp/ruby_gnuplot/tree/master"
-end
+require "bundler/gem_tasks"
+require 'rake'
+require 'rake/clean'
+require 'rake/testtask'
+require 'rubygems/package_task'
-task :default => :test
+require_relative 'lib/ruby_gnuplot/version'
desc 'run unit tests'
-task :test do
- Dir.chdir 'test'
- for file in Dir['*']
- system("ruby #{file}")
- end
+task :default => :test
+
+Rake::TestTask.new do |t|
+ t.libs << "lib" << 'spec/support'
+ t.test_files = FileList['test/**/*.rb']
+ t.verbose = false
+ t.warning = false
+end
+
+def gemspec
+ @clean_gemspec ||= eval(File.read(File.expand_path('../ruby_gnuplot.gemspec', __FILE__)))
end
-Jeweler::RubygemsDotOrgTasks.new
\ No newline at end of file
+Gem::PackageTask.new(gemspec) { |pkg| }
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..61d4e71
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,9 @@
+version: '3'
+services:
+ ruby_gnuplot:
+ build: .
+ working_dir: /home/gnuplot/gnuplot
+ container_name: ruby_gnuplot
+ command: /bin/bash
+ volumes:
+ - .:/home/gnuplot/gnuplot
diff --git a/lib/gnuplot.rb b/lib/gnuplot.rb
index 592b3e6..21ca23d 100644
--- a/lib/gnuplot.rb
+++ b/lib/gnuplot.rb
@@ -140,7 +140,7 @@ def unset ( var )
# gnuplot process.
def [] ( var )
- v = @settings.rassoc( var )
+ v = @settings.reverse.rassoc( var )
if v.nil? or v.first == :unset
nil
else
diff --git a/lib/ruby_gnuplot/version.rb b/lib/ruby_gnuplot/version.rb
new file mode 100644
index 0000000..ba6c60b
--- /dev/null
+++ b/lib/ruby_gnuplot/version.rb
@@ -0,0 +1,3 @@
+module RubyGnuplot
+ VERSION = "2.6.1"
+end
diff --git a/ruby_gnuplot.gemspec b/ruby_gnuplot.gemspec
new file mode 100644
index 0000000..97239a1
--- /dev/null
+++ b/ruby_gnuplot.gemspec
@@ -0,0 +1,25 @@
+# coding: utf-8
+lib = File.expand_path('../lib', __FILE__)
+$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
+require 'ruby_gnuplot/version'
+
+Gem::Specification.new do |s|
+ s.name = 'gnuplot'
+ s.description = s.summary = "Utility library to aid in interacting with gnuplot from ruby"
+ s.version = RubyGnuplot::VERSION
+ s.authors='roger pack'
+ s.email = "rogerpack2005@gmail.com"
+ s.homepage = "http://github.com/rdp/ruby_gnuplot/tree/master"
+ s.license = "BSD"
+
+ s.files = `git ls-files`.split($/)
+ s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
+ s.test_files = s.files.grep(%r{^(test|spec|features)/})
+ s.require_paths = ["lib"]
+
+ s.add_development_dependency 'minitest'
+ s.add_development_dependency 'rspec', '3.9.0'
+ s.add_development_dependency 'rubocop', '0.73.0'
+ s.add_development_dependency 'rubocop-rspec', '1.33.0'
+ s.add_development_dependency 'simplecov', '0.17.0'
+end
diff --git a/spec/fixtures/plots/array_plot.eps b/spec/fixtures/plots/array_plot.eps
new file mode 100644
index 0000000..98b8de1
--- /dev/null
+++ b/spec/fixtures/plots/array_plot.eps
@@ -0,0 +1,810 @@
+%!PS-Adobe-2.0 EPSF-2.0
+%%Title: spec/tmp/array_plot.eps
+%%Creator: gnuplot 5.0 patchlevel 5
+%%CreationDate: Wed Nov 6 21:24:07 2019
+%%DocumentFonts: (atend)
+%%BoundingBox: 50 50 410 302
+%%EndComments
+%%BeginProlog
+/gnudict 256 dict def
+gnudict begin
+%
+% The following true/false flags may be edited by hand if desired.
+% The unit line width and grayscale image gamma correction may also be changed.
+%
+/Color false def
+/Blacktext false def
+/Solid false def
+/Dashlength 1 def
+/Landscape false def
+/Level1 false def
+/Level3 false def
+/Rounded false def
+/ClipToBoundingBox false def
+/SuppressPDFMark false def
+/TransparentPatterns false def
+/gnulinewidth 5.000 def
+/userlinewidth gnulinewidth def
+/Gamma 1.0 def
+/BackgroundColor {-1.000 -1.000 -1.000} def
+%
+/vshift -46 def
+/dl1 {
+ 10.0 Dashlength userlinewidth gnulinewidth div mul mul mul
+ Rounded { currentlinewidth 0.75 mul sub dup 0 le { pop 0.01 } if } if
+} def
+/dl2 {
+ 10.0 Dashlength userlinewidth gnulinewidth div mul mul mul
+ Rounded { currentlinewidth 0.75 mul add } if
+} def
+/hpt_ 31.5 def
+/vpt_ 31.5 def
+/hpt hpt_ def
+/vpt vpt_ def
+/doclip {
+ ClipToBoundingBox {
+ newpath 50 50 moveto 410 50 lineto 410 302 lineto 50 302 lineto closepath
+ clip
+ } if
+} def
+%
+% Gnuplot Prolog Version 5.1 (Oct 2015)
+%
+%/SuppressPDFMark true def
+%
+/M {moveto} bind def
+/L {lineto} bind def
+/R {rmoveto} bind def
+/V {rlineto} bind def
+/N {newpath moveto} bind def
+/Z {closepath} bind def
+/C {setrgbcolor} bind def
+/f {rlineto fill} bind def
+/g {setgray} bind def
+/Gshow {show} def % May be redefined later in the file to support UTF-8
+/vpt2 vpt 2 mul def
+/hpt2 hpt 2 mul def
+/Lshow {currentpoint stroke M 0 vshift R
+ Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def
+/Rshow {currentpoint stroke M dup stringwidth pop neg vshift R
+ Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def
+/Cshow {currentpoint stroke M dup stringwidth pop -2 div vshift R
+ Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def
+/UP {dup vpt_ mul /vpt exch def hpt_ mul /hpt exch def
+ /hpt2 hpt 2 mul def /vpt2 vpt 2 mul def} def
+/DL {Color {setrgbcolor Solid {pop []} if 0 setdash}
+ {pop pop pop 0 setgray Solid {pop []} if 0 setdash} ifelse} def
+/BL {stroke userlinewidth 2 mul setlinewidth
+ Rounded {1 setlinejoin 1 setlinecap} if} def
+/AL {stroke userlinewidth 2 div setlinewidth
+ Rounded {1 setlinejoin 1 setlinecap} if} def
+/UL {dup gnulinewidth mul /userlinewidth exch def
+ dup 1 lt {pop 1} if 10 mul /udl exch def} def
+/PL {stroke userlinewidth setlinewidth
+ Rounded {1 setlinejoin 1 setlinecap} if} def
+3.8 setmiterlimit
+% Classic Line colors (version 5.0)
+/LCw {1 1 1} def
+/LCb {0 0 0} def
+/LCa {0 0 0} def
+/LC0 {1 0 0} def
+/LC1 {0 1 0} def
+/LC2 {0 0 1} def
+/LC3 {1 0 1} def
+/LC4 {0 1 1} def
+/LC5 {1 1 0} def
+/LC6 {0 0 0} def
+/LC7 {1 0.3 0} def
+/LC8 {0.5 0.5 0.5} def
+% Default dash patterns (version 5.0)
+/LTB {BL [] LCb DL} def
+/LTw {PL [] 1 setgray} def
+/LTb {PL [] LCb DL} def
+/LTa {AL [1 udl mul 2 udl mul] 0 setdash LCa setrgbcolor} def
+/LT0 {PL [] LC0 DL} def
+/LT1 {PL [2 dl1 3 dl2] LC1 DL} def
+/LT2 {PL [1 dl1 1.5 dl2] LC2 DL} def
+/LT3 {PL [6 dl1 2 dl2 1 dl1 2 dl2] LC3 DL} def
+/LT4 {PL [1 dl1 2 dl2 6 dl1 2 dl2 1 dl1 2 dl2] LC4 DL} def
+/LT5 {PL [4 dl1 2 dl2] LC5 DL} def
+/LT6 {PL [1.5 dl1 1.5 dl2 1.5 dl1 1.5 dl2 1.5 dl1 6 dl2] LC6 DL} def
+/LT7 {PL [3 dl1 3 dl2 1 dl1 3 dl2] LC7 DL} def
+/LT8 {PL [2 dl1 2 dl2 2 dl1 6 dl2] LC8 DL} def
+/SL {[] 0 setdash} def
+/Pnt {stroke [] 0 setdash gsave 1 setlinecap M 0 0 V stroke grestore} def
+/Dia {stroke [] 0 setdash 2 copy vpt add M
+ hpt neg vpt neg V hpt vpt neg V
+ hpt vpt V hpt neg vpt V closepath stroke
+ Pnt} def
+/Pls {stroke [] 0 setdash vpt sub M 0 vpt2 V
+ currentpoint stroke M
+ hpt neg vpt neg R hpt2 0 V stroke
+ } def
+/Box {stroke [] 0 setdash 2 copy exch hpt sub exch vpt add M
+ 0 vpt2 neg V hpt2 0 V 0 vpt2 V
+ hpt2 neg 0 V closepath stroke
+ Pnt} def
+/Crs {stroke [] 0 setdash exch hpt sub exch vpt add M
+ hpt2 vpt2 neg V currentpoint stroke M
+ hpt2 neg 0 R hpt2 vpt2 V stroke} def
+/TriU {stroke [] 0 setdash 2 copy vpt 1.12 mul add M
+ hpt neg vpt -1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt 1.62 mul V closepath stroke
+ Pnt} def
+/Star {2 copy Pls Crs} def
+/BoxF {stroke [] 0 setdash exch hpt sub exch vpt add M
+ 0 vpt2 neg V hpt2 0 V 0 vpt2 V
+ hpt2 neg 0 V closepath fill} def
+/TriUF {stroke [] 0 setdash vpt 1.12 mul add M
+ hpt neg vpt -1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt 1.62 mul V closepath fill} def
+/TriD {stroke [] 0 setdash 2 copy vpt 1.12 mul sub M
+ hpt neg vpt 1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt -1.62 mul V closepath stroke
+ Pnt} def
+/TriDF {stroke [] 0 setdash vpt 1.12 mul sub M
+ hpt neg vpt 1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt -1.62 mul V closepath fill} def
+/DiaF {stroke [] 0 setdash vpt add M
+ hpt neg vpt neg V hpt vpt neg V
+ hpt vpt V hpt neg vpt V closepath fill} def
+/Pent {stroke [] 0 setdash 2 copy gsave
+ translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
+ closepath stroke grestore Pnt} def
+/PentF {stroke [] 0 setdash gsave
+ translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
+ closepath fill grestore} def
+/Circle {stroke [] 0 setdash 2 copy
+ hpt 0 360 arc stroke Pnt} def
+/CircleF {stroke [] 0 setdash hpt 0 360 arc fill} def
+/C0 {BL [] 0 setdash 2 copy moveto vpt 90 450 arc} bind def
+/C1 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 0 90 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C2 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 90 180 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C3 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 0 180 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C4 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 180 270 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C5 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 0 90 arc
+ 2 copy moveto
+ 2 copy vpt 180 270 arc closepath fill
+ vpt 0 360 arc} bind def
+/C6 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 90 270 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C7 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 0 270 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C8 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 270 360 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C9 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 270 450 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C10 {BL [] 0 setdash 2 copy 2 copy moveto vpt 270 360 arc closepath fill
+ 2 copy moveto
+ 2 copy vpt 90 180 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C11 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 0 180 arc closepath fill
+ 2 copy moveto
+ 2 copy vpt 270 360 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C12 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 180 360 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C13 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 0 90 arc closepath fill
+ 2 copy moveto
+ 2 copy vpt 180 360 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C14 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 90 360 arc closepath fill
+ vpt 0 360 arc} bind def
+/C15 {BL [] 0 setdash 2 copy vpt 0 360 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/Rec {newpath 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto
+ neg 0 rlineto closepath} bind def
+/Square {dup Rec} bind def
+/Bsquare {vpt sub exch vpt sub exch vpt2 Square} bind def
+/S0 {BL [] 0 setdash 2 copy moveto 0 vpt rlineto BL Bsquare} bind def
+/S1 {BL [] 0 setdash 2 copy vpt Square fill Bsquare} bind def
+/S2 {BL [] 0 setdash 2 copy exch vpt sub exch vpt Square fill Bsquare} bind def
+/S3 {BL [] 0 setdash 2 copy exch vpt sub exch vpt2 vpt Rec fill Bsquare} bind def
+/S4 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt Square fill Bsquare} bind def
+/S5 {BL [] 0 setdash 2 copy 2 copy vpt Square fill
+ exch vpt sub exch vpt sub vpt Square fill Bsquare} bind def
+/S6 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill Bsquare} bind def
+/S7 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill
+ 2 copy vpt Square fill Bsquare} bind def
+/S8 {BL [] 0 setdash 2 copy vpt sub vpt Square fill Bsquare} bind def
+/S9 {BL [] 0 setdash 2 copy vpt sub vpt vpt2 Rec fill Bsquare} bind def
+/S10 {BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt Square fill
+ Bsquare} bind def
+/S11 {BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt2 vpt Rec fill
+ Bsquare} bind def
+/S12 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill Bsquare} bind def
+/S13 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill
+ 2 copy vpt Square fill Bsquare} bind def
+/S14 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill
+ 2 copy exch vpt sub exch vpt Square fill Bsquare} bind def
+/S15 {BL [] 0 setdash 2 copy Bsquare fill Bsquare} bind def
+/D0 {gsave translate 45 rotate 0 0 S0 stroke grestore} bind def
+/D1 {gsave translate 45 rotate 0 0 S1 stroke grestore} bind def
+/D2 {gsave translate 45 rotate 0 0 S2 stroke grestore} bind def
+/D3 {gsave translate 45 rotate 0 0 S3 stroke grestore} bind def
+/D4 {gsave translate 45 rotate 0 0 S4 stroke grestore} bind def
+/D5 {gsave translate 45 rotate 0 0 S5 stroke grestore} bind def
+/D6 {gsave translate 45 rotate 0 0 S6 stroke grestore} bind def
+/D7 {gsave translate 45 rotate 0 0 S7 stroke grestore} bind def
+/D8 {gsave translate 45 rotate 0 0 S8 stroke grestore} bind def
+/D9 {gsave translate 45 rotate 0 0 S9 stroke grestore} bind def
+/D10 {gsave translate 45 rotate 0 0 S10 stroke grestore} bind def
+/D11 {gsave translate 45 rotate 0 0 S11 stroke grestore} bind def
+/D12 {gsave translate 45 rotate 0 0 S12 stroke grestore} bind def
+/D13 {gsave translate 45 rotate 0 0 S13 stroke grestore} bind def
+/D14 {gsave translate 45 rotate 0 0 S14 stroke grestore} bind def
+/D15 {gsave translate 45 rotate 0 0 S15 stroke grestore} bind def
+/DiaE {stroke [] 0 setdash vpt add M
+ hpt neg vpt neg V hpt vpt neg V
+ hpt vpt V hpt neg vpt V closepath stroke} def
+/BoxE {stroke [] 0 setdash exch hpt sub exch vpt add M
+ 0 vpt2 neg V hpt2 0 V 0 vpt2 V
+ hpt2 neg 0 V closepath stroke} def
+/TriUE {stroke [] 0 setdash vpt 1.12 mul add M
+ hpt neg vpt -1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt 1.62 mul V closepath stroke} def
+/TriDE {stroke [] 0 setdash vpt 1.12 mul sub M
+ hpt neg vpt 1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt -1.62 mul V closepath stroke} def
+/PentE {stroke [] 0 setdash gsave
+ translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
+ closepath stroke grestore} def
+/CircE {stroke [] 0 setdash
+ hpt 0 360 arc stroke} def
+/Opaque {gsave closepath 1 setgray fill grestore 0 setgray closepath} def
+/DiaW {stroke [] 0 setdash vpt add M
+ hpt neg vpt neg V hpt vpt neg V
+ hpt vpt V hpt neg vpt V Opaque stroke} def
+/BoxW {stroke [] 0 setdash exch hpt sub exch vpt add M
+ 0 vpt2 neg V hpt2 0 V 0 vpt2 V
+ hpt2 neg 0 V Opaque stroke} def
+/TriUW {stroke [] 0 setdash vpt 1.12 mul add M
+ hpt neg vpt -1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt 1.62 mul V Opaque stroke} def
+/TriDW {stroke [] 0 setdash vpt 1.12 mul sub M
+ hpt neg vpt 1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt -1.62 mul V Opaque stroke} def
+/PentW {stroke [] 0 setdash gsave
+ translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
+ Opaque stroke grestore} def
+/CircW {stroke [] 0 setdash
+ hpt 0 360 arc Opaque stroke} def
+/BoxFill {gsave Rec 1 setgray fill grestore} def
+/Density {
+ /Fillden exch def
+ currentrgbcolor
+ /ColB exch def /ColG exch def /ColR exch def
+ /ColR ColR Fillden mul Fillden sub 1 add def
+ /ColG ColG Fillden mul Fillden sub 1 add def
+ /ColB ColB Fillden mul Fillden sub 1 add def
+ ColR ColG ColB setrgbcolor} def
+/BoxColFill {gsave Rec PolyFill} def
+/PolyFill {gsave Density fill grestore grestore} def
+/h {rlineto rlineto rlineto gsave closepath fill grestore} bind def
+%
+% PostScript Level 1 Pattern Fill routine for rectangles
+% Usage: x y w h s a XX PatternFill
+% x,y = lower left corner of box to be filled
+% w,h = width and height of box
+% a = angle in degrees between lines and x-axis
+% XX = 0/1 for no/yes cross-hatch
+%
+/PatternFill {gsave /PFa [ 9 2 roll ] def
+ PFa 0 get PFa 2 get 2 div add PFa 1 get PFa 3 get 2 div add translate
+ PFa 2 get -2 div PFa 3 get -2 div PFa 2 get PFa 3 get Rec
+ TransparentPatterns {} {gsave 1 setgray fill grestore} ifelse
+ clip
+ currentlinewidth 0.5 mul setlinewidth
+ /PFs PFa 2 get dup mul PFa 3 get dup mul add sqrt def
+ 0 0 M PFa 5 get rotate PFs -2 div dup translate
+ 0 1 PFs PFa 4 get div 1 add floor cvi
+ {PFa 4 get mul 0 M 0 PFs V} for
+ 0 PFa 6 get ne {
+ 0 1 PFs PFa 4 get div 1 add floor cvi
+ {PFa 4 get mul 0 2 1 roll M PFs 0 V} for
+ } if
+ stroke grestore} def
+%
+/languagelevel where
+ {pop languagelevel} {1} ifelse
+dup 2 lt
+ {/InterpretLevel1 true def
+ /InterpretLevel3 false def}
+ {/InterpretLevel1 Level1 def
+ 2 gt
+ {/InterpretLevel3 Level3 def}
+ {/InterpretLevel3 false def}
+ ifelse }
+ ifelse
+%
+% PostScript level 2 pattern fill definitions
+%
+/Level2PatternFill {
+/Tile8x8 {/PaintType 2 /PatternType 1 /TilingType 1 /BBox [0 0 8 8] /XStep 8 /YStep 8}
+ bind def
+/KeepColor {currentrgbcolor [/Pattern /DeviceRGB] setcolorspace} bind def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop 0 0 M 8 8 L 0 8 M 8 0 L stroke}
+>> matrix makepattern
+/Pat1 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop 0 0 M 8 8 L 0 8 M 8 0 L stroke
+ 0 4 M 4 8 L 8 4 L 4 0 L 0 4 L stroke}
+>> matrix makepattern
+/Pat2 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop 0 0 M 0 8 L
+ 8 8 L 8 0 L 0 0 L fill}
+>> matrix makepattern
+/Pat3 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop -4 8 M 8 -4 L
+ 0 12 M 12 0 L stroke}
+>> matrix makepattern
+/Pat4 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop -4 0 M 8 12 L
+ 0 -4 M 12 8 L stroke}
+>> matrix makepattern
+/Pat5 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop -2 8 M 4 -4 L
+ 0 12 M 8 -4 L 4 12 M 10 0 L stroke}
+>> matrix makepattern
+/Pat6 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop -2 0 M 4 12 L
+ 0 -4 M 8 12 L 4 -4 M 10 8 L stroke}
+>> matrix makepattern
+/Pat7 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop 8 -2 M -4 4 L
+ 12 0 M -4 8 L 12 4 M 0 10 L stroke}
+>> matrix makepattern
+/Pat8 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop 0 -2 M 12 4 L
+ -4 0 M 12 8 L -4 4 M 8 10 L stroke}
+>> matrix makepattern
+/Pat9 exch def
+/Pattern1 {PatternBgnd KeepColor Pat1 setpattern} bind def
+/Pattern2 {PatternBgnd KeepColor Pat2 setpattern} bind def
+/Pattern3 {PatternBgnd KeepColor Pat3 setpattern} bind def
+/Pattern4 {PatternBgnd KeepColor Landscape {Pat5} {Pat4} ifelse setpattern} bind def
+/Pattern5 {PatternBgnd KeepColor Landscape {Pat4} {Pat5} ifelse setpattern} bind def
+/Pattern6 {PatternBgnd KeepColor Landscape {Pat9} {Pat6} ifelse setpattern} bind def
+/Pattern7 {PatternBgnd KeepColor Landscape {Pat8} {Pat7} ifelse setpattern} bind def
+} def
+%
+%
+%End of PostScript Level 2 code
+%
+/PatternBgnd {
+ TransparentPatterns {} {gsave 1 setgray fill grestore} ifelse
+} def
+%
+% Substitute for Level 2 pattern fill codes with
+% grayscale if Level 2 support is not selected.
+%
+/Level1PatternFill {
+/Pattern1 {0.250 Density} bind def
+/Pattern2 {0.500 Density} bind def
+/Pattern3 {0.750 Density} bind def
+/Pattern4 {0.125 Density} bind def
+/Pattern5 {0.375 Density} bind def
+/Pattern6 {0.625 Density} bind def
+/Pattern7 {0.875 Density} bind def
+} def
+%
+% Now test for support of Level 2 code
+%
+Level1 {Level1PatternFill} {Level2PatternFill} ifelse
+%
+/Symbol-Oblique /Symbol findfont [1 0 .167 1 0 0] makefont
+dup length dict begin {1 index /FID eq {pop pop} {def} ifelse} forall
+currentdict end definefont pop
+%
+/MFshow {
+ { dup 5 get 3 ge
+ { 5 get 3 eq {gsave} {grestore} ifelse }
+ {dup dup 0 get findfont exch 1 get scalefont setfont
+ [ currentpoint ] exch dup 2 get 0 exch R dup 5 get 2 ne {dup dup 6
+ get exch 4 get {textshow} {stringwidth pop 0 R} ifelse }if dup 5 get 0 eq
+ {dup 3 get {2 get neg 0 exch R pop} {pop aload pop M} ifelse} {dup 5
+ get 1 eq {dup 2 get exch dup 3 get exch 6 get stringwidth pop -2 div
+ dup 0 R} {dup 6 get stringwidth pop -2 div 0 R 6 get
+ textshow 2 index {aload pop M neg 3 -1 roll neg R pop pop} {pop pop pop
+ pop aload pop M} ifelse }ifelse }ifelse }
+ ifelse }
+ forall} def
+/Gswidth {dup type /stringtype eq {stringwidth} {pop (n) stringwidth} ifelse} def
+/MFwidth {0 exch { dup 5 get 3 ge { 5 get 3 eq { 0 } { pop } ifelse }
+ {dup 3 get{dup dup 0 get findfont exch 1 get scalefont setfont
+ 6 get Gswidth pop add} {pop} ifelse} ifelse} forall} def
+/MLshow { currentpoint stroke M
+ 0 exch R
+ Blacktext {gsave 0 setgray MFshow grestore} {MFshow} ifelse } bind def
+/MRshow { currentpoint stroke M
+ exch dup MFwidth neg 3 -1 roll R
+ Blacktext {gsave 0 setgray MFshow grestore} {MFshow} ifelse } bind def
+/MCshow { currentpoint stroke M
+ exch dup MFwidth -2 div 3 -1 roll R
+ Blacktext {gsave 0 setgray MFshow grestore} {MFshow} ifelse } bind def
+/XYsave { [( ) 1 2 true false 3 ()] } bind def
+/XYrestore { [( ) 1 2 true false 4 ()] } bind def
+Level1 SuppressPDFMark or
+{} {
+/SDict 10 dict def
+systemdict /pdfmark known not {
+ userdict /pdfmark systemdict /cleartomark get put
+} if
+SDict begin [
+ /Title (spec/tmp/array_plot.eps)
+ /Subject (gnuplot plot)
+ /Creator (gnuplot 5.0 patchlevel 5)
+% /Producer (gnuplot)
+% /Keywords ()
+ /CreationDate (Wed Nov 6 21:24:07 2019)
+ /DOCINFO pdfmark
+end
+} ifelse
+%
+% Support for boxed text - Ethan A Merritt May 2005
+%
+/InitTextBox { userdict /TBy2 3 -1 roll put userdict /TBx2 3 -1 roll put
+ userdict /TBy1 3 -1 roll put userdict /TBx1 3 -1 roll put
+ /Boxing true def } def
+/ExtendTextBox { Boxing
+ { gsave dup false charpath pathbbox
+ dup TBy2 gt {userdict /TBy2 3 -1 roll put} {pop} ifelse
+ dup TBx2 gt {userdict /TBx2 3 -1 roll put} {pop} ifelse
+ dup TBy1 lt {userdict /TBy1 3 -1 roll put} {pop} ifelse
+ dup TBx1 lt {userdict /TBx1 3 -1 roll put} {pop} ifelse
+ grestore } if } def
+/PopTextBox { newpath TBx1 TBxmargin sub TBy1 TBymargin sub M
+ TBx1 TBxmargin sub TBy2 TBymargin add L
+ TBx2 TBxmargin add TBy2 TBymargin add L
+ TBx2 TBxmargin add TBy1 TBymargin sub L closepath } def
+/DrawTextBox { PopTextBox stroke /Boxing false def} def
+/FillTextBox { gsave PopTextBox 1 1 1 setrgbcolor fill grestore /Boxing false def} def
+0 0 0 0 InitTextBox
+/TBxmargin 20 def
+/TBymargin 20 def
+/Boxing false def
+/textshow { ExtendTextBox Gshow } def
+%
+% redundant definitions for compatibility with prologue.ps older than 5.0.2
+/LTB {BL [] LCb DL} def
+/LTb {PL [] LCb DL} def
+end
+%%EndProlog
+%%Page: 1 1
+gnudict begin
+gsave
+doclip
+50 50 translate
+0.050 0.050 scale
+0 setgray
+newpath
+(Helvetica) findfont 140 scalefont setfont
+BackgroundColor 0 lt 3 1 roll 0 lt exch 0 lt or or not {BackgroundColor C 1.000 0 0 7200.00 5040.00 BoxColFill} if
+1.000 UL
+LTb
+LCb setrgbcolor
+770 588 M
+63 0 V
+6114 0 R
+-63 0 V
+stroke
+686 588 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 0)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+770 1394 M
+63 0 V
+6114 0 R
+-63 0 V
+stroke
+686 1394 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 500)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+770 2200 M
+63 0 V
+6114 0 R
+-63 0 V
+stroke
+686 2200 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 1000)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+770 3007 M
+63 0 V
+6114 0 R
+-63 0 V
+stroke
+686 3007 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 1500)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+770 3813 M
+63 0 V
+6114 0 R
+-63 0 V
+stroke
+686 3813 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 2000)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+770 4619 M
+63 0 V
+6114 0 R
+-63 0 V
+stroke
+686 4619 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 2500)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+770 588 M
+0 63 V
+0 3968 R
+0 -63 V
+stroke
+770 448 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 0)]
+] -46.7 MCshow
+1.000 UL
+LTb
+LCb setrgbcolor
+2005 588 M
+0 63 V
+0 3968 R
+0 -63 V
+stroke
+2005 448 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 10)]
+] -46.7 MCshow
+1.000 UL
+LTb
+LCb setrgbcolor
+3241 588 M
+0 63 V
+0 3968 R
+0 -63 V
+stroke
+3241 448 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 20)]
+] -46.7 MCshow
+1.000 UL
+LTb
+LCb setrgbcolor
+4476 588 M
+0 63 V
+0 3968 R
+0 -63 V
+stroke
+4476 448 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 30)]
+] -46.7 MCshow
+1.000 UL
+LTb
+LCb setrgbcolor
+5712 588 M
+0 63 V
+0 3968 R
+0 -63 V
+stroke
+5712 448 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 40)]
+] -46.7 MCshow
+1.000 UL
+LTb
+LCb setrgbcolor
+6947 588 M
+0 63 V
+0 3968 R
+0 -63 V
+stroke
+6947 448 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 50)]
+] -46.7 MCshow
+1.000 UL
+LTb
+LCb setrgbcolor
+1.000 UL
+LTB
+LCb setrgbcolor
+770 4619 N
+770 588 L
+6177 0 V
+0 4031 V
+-6177 0 V
+Z stroke
+1.000 UP
+1.000 UL
+LTb
+LCb setrgbcolor
+LCb setrgbcolor
+112 2603 M
+currentpoint gsave translate -270 rotate 0 0 moveto
+[ [(Helvetica) 140.0 0.0 true true 0 (x)]
+] -46.7 MCshow
+grestore
+LTb
+LCb setrgbcolor
+3858 238 M
+[ [(Helvetica) 140.0 0.0 true true 0 (x)]
+[(Helvetica) 112.0 70.0 true true 0 (2)]
+] -60.7 MCshow
+LTb
+LCb setrgbcolor
+3858 4829 M
+[ [(Helvetica) 140.0 0.0 true true 0 (Array Plot Example)]
+] -46.7 MCshow
+% Begin plot #1
+1.000 UP
+1.000 UL
+LTb
+LCb setrgbcolor
+770 588 M
+124 2 V
+123 4 V
+124 9 V
+123 11 V
+124 14 V
+123 18 V
+124 21 V
+123 24 V
+124 28 V
+123 30 V
+124 34 V
+123 37 V
+124 40 V
+124 44 V
+123 47 V
+124 50 V
+123 53 V
+124 56 V
+123 60 V
+124 63 V
+123 66 V
+124 69 V
+123 73 V
+124 76 V
+124 79 V
+123 82 V
+124 85 V
+123 89 V
+124 92 V
+123 95 V
+124 99 V
+123 101 V
+124 105 V
+123 108 V
+124 111 V
+123 115 V
+124 117 V
+124 121 V
+123 124 V
+124 128 V
+123 130 V
+124 134 V
+123 137 V
+124 141 V
+123 143 V
+124 147 V
+123 150 V
+124 153 V
+123 156 V
+124 160 V
+770 588 Pls
+894 590 Pls
+1017 594 Pls
+1141 603 Pls
+1264 614 Pls
+1388 628 Pls
+1511 646 Pls
+1635 667 Pls
+1758 691 Pls
+1882 719 Pls
+2005 749 Pls
+2129 783 Pls
+2252 820 Pls
+2376 860 Pls
+2500 904 Pls
+2623 951 Pls
+2747 1001 Pls
+2870 1054 Pls
+2994 1110 Pls
+3117 1170 Pls
+3241 1233 Pls
+3364 1299 Pls
+3488 1368 Pls
+3611 1441 Pls
+3735 1517 Pls
+3859 1596 Pls
+3982 1678 Pls
+4106 1763 Pls
+4229 1852 Pls
+4353 1944 Pls
+4476 2039 Pls
+4600 2138 Pls
+4723 2239 Pls
+4847 2344 Pls
+4970 2452 Pls
+5094 2563 Pls
+5217 2678 Pls
+5341 2795 Pls
+5465 2916 Pls
+5588 3040 Pls
+5712 3168 Pls
+5835 3298 Pls
+5959 3432 Pls
+6082 3569 Pls
+6206 3710 Pls
+6329 3853 Pls
+6453 4000 Pls
+6576 4150 Pls
+6700 4303 Pls
+6823 4459 Pls
+6947 4619 Pls
+% End plot #1
+2.000 UL
+LTb
+LCb setrgbcolor
+1.000 UL
+LTB
+LCb setrgbcolor
+770 4619 N
+770 588 L
+6177 0 V
+0 4031 V
+-6177 0 V
+Z stroke
+1.000 UP
+1.000 UL
+LTb
+LCb setrgbcolor
+stroke
+grestore
+end
+showpage
+%%Trailer
+%%DocumentFonts: Helvetica
diff --git a/spec/fixtures/plots/histogram_plot.eps b/spec/fixtures/plots/histogram_plot.eps
new file mode 100644
index 0000000..c2edc90
--- /dev/null
+++ b/spec/fixtures/plots/histogram_plot.eps
@@ -0,0 +1,889 @@
+%!PS-Adobe-2.0 EPSF-2.0
+%%Title: spec/tmp/histogram_plot.eps
+%%Creator: gnuplot 5.0 patchlevel 5
+%%CreationDate: Fri Nov 22 22:11:02 2019
+%%DocumentFonts: (atend)
+%%BoundingBox: 50 50 410 302
+%%EndComments
+%%BeginProlog
+/gnudict 256 dict def
+gnudict begin
+%
+% The following true/false flags may be edited by hand if desired.
+% The unit line width and grayscale image gamma correction may also be changed.
+%
+/Color false def
+/Blacktext false def
+/Solid false def
+/Dashlength 1 def
+/Landscape false def
+/Level1 false def
+/Level3 false def
+/Rounded false def
+/ClipToBoundingBox false def
+/SuppressPDFMark false def
+/TransparentPatterns false def
+/gnulinewidth 5.000 def
+/userlinewidth gnulinewidth def
+/Gamma 1.0 def
+/BackgroundColor {-1.000 -1.000 -1.000} def
+%
+/vshift -46 def
+/dl1 {
+ 10.0 Dashlength userlinewidth gnulinewidth div mul mul mul
+ Rounded { currentlinewidth 0.75 mul sub dup 0 le { pop 0.01 } if } if
+} def
+/dl2 {
+ 10.0 Dashlength userlinewidth gnulinewidth div mul mul mul
+ Rounded { currentlinewidth 0.75 mul add } if
+} def
+/hpt_ 31.5 def
+/vpt_ 31.5 def
+/hpt hpt_ def
+/vpt vpt_ def
+/doclip {
+ ClipToBoundingBox {
+ newpath 50 50 moveto 410 50 lineto 410 302 lineto 50 302 lineto closepath
+ clip
+ } if
+} def
+%
+% Gnuplot Prolog Version 5.1 (Oct 2015)
+%
+%/SuppressPDFMark true def
+%
+/M {moveto} bind def
+/L {lineto} bind def
+/R {rmoveto} bind def
+/V {rlineto} bind def
+/N {newpath moveto} bind def
+/Z {closepath} bind def
+/C {setrgbcolor} bind def
+/f {rlineto fill} bind def
+/g {setgray} bind def
+/Gshow {show} def % May be redefined later in the file to support UTF-8
+/vpt2 vpt 2 mul def
+/hpt2 hpt 2 mul def
+/Lshow {currentpoint stroke M 0 vshift R
+ Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def
+/Rshow {currentpoint stroke M dup stringwidth pop neg vshift R
+ Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def
+/Cshow {currentpoint stroke M dup stringwidth pop -2 div vshift R
+ Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def
+/UP {dup vpt_ mul /vpt exch def hpt_ mul /hpt exch def
+ /hpt2 hpt 2 mul def /vpt2 vpt 2 mul def} def
+/DL {Color {setrgbcolor Solid {pop []} if 0 setdash}
+ {pop pop pop 0 setgray Solid {pop []} if 0 setdash} ifelse} def
+/BL {stroke userlinewidth 2 mul setlinewidth
+ Rounded {1 setlinejoin 1 setlinecap} if} def
+/AL {stroke userlinewidth 2 div setlinewidth
+ Rounded {1 setlinejoin 1 setlinecap} if} def
+/UL {dup gnulinewidth mul /userlinewidth exch def
+ dup 1 lt {pop 1} if 10 mul /udl exch def} def
+/PL {stroke userlinewidth setlinewidth
+ Rounded {1 setlinejoin 1 setlinecap} if} def
+3.8 setmiterlimit
+% Classic Line colors (version 5.0)
+/LCw {1 1 1} def
+/LCb {0 0 0} def
+/LCa {0 0 0} def
+/LC0 {1 0 0} def
+/LC1 {0 1 0} def
+/LC2 {0 0 1} def
+/LC3 {1 0 1} def
+/LC4 {0 1 1} def
+/LC5 {1 1 0} def
+/LC6 {0 0 0} def
+/LC7 {1 0.3 0} def
+/LC8 {0.5 0.5 0.5} def
+% Default dash patterns (version 5.0)
+/LTB {BL [] LCb DL} def
+/LTw {PL [] 1 setgray} def
+/LTb {PL [] LCb DL} def
+/LTa {AL [1 udl mul 2 udl mul] 0 setdash LCa setrgbcolor} def
+/LT0 {PL [] LC0 DL} def
+/LT1 {PL [2 dl1 3 dl2] LC1 DL} def
+/LT2 {PL [1 dl1 1.5 dl2] LC2 DL} def
+/LT3 {PL [6 dl1 2 dl2 1 dl1 2 dl2] LC3 DL} def
+/LT4 {PL [1 dl1 2 dl2 6 dl1 2 dl2 1 dl1 2 dl2] LC4 DL} def
+/LT5 {PL [4 dl1 2 dl2] LC5 DL} def
+/LT6 {PL [1.5 dl1 1.5 dl2 1.5 dl1 1.5 dl2 1.5 dl1 6 dl2] LC6 DL} def
+/LT7 {PL [3 dl1 3 dl2 1 dl1 3 dl2] LC7 DL} def
+/LT8 {PL [2 dl1 2 dl2 2 dl1 6 dl2] LC8 DL} def
+/SL {[] 0 setdash} def
+/Pnt {stroke [] 0 setdash gsave 1 setlinecap M 0 0 V stroke grestore} def
+/Dia {stroke [] 0 setdash 2 copy vpt add M
+ hpt neg vpt neg V hpt vpt neg V
+ hpt vpt V hpt neg vpt V closepath stroke
+ Pnt} def
+/Pls {stroke [] 0 setdash vpt sub M 0 vpt2 V
+ currentpoint stroke M
+ hpt neg vpt neg R hpt2 0 V stroke
+ } def
+/Box {stroke [] 0 setdash 2 copy exch hpt sub exch vpt add M
+ 0 vpt2 neg V hpt2 0 V 0 vpt2 V
+ hpt2 neg 0 V closepath stroke
+ Pnt} def
+/Crs {stroke [] 0 setdash exch hpt sub exch vpt add M
+ hpt2 vpt2 neg V currentpoint stroke M
+ hpt2 neg 0 R hpt2 vpt2 V stroke} def
+/TriU {stroke [] 0 setdash 2 copy vpt 1.12 mul add M
+ hpt neg vpt -1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt 1.62 mul V closepath stroke
+ Pnt} def
+/Star {2 copy Pls Crs} def
+/BoxF {stroke [] 0 setdash exch hpt sub exch vpt add M
+ 0 vpt2 neg V hpt2 0 V 0 vpt2 V
+ hpt2 neg 0 V closepath fill} def
+/TriUF {stroke [] 0 setdash vpt 1.12 mul add M
+ hpt neg vpt -1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt 1.62 mul V closepath fill} def
+/TriD {stroke [] 0 setdash 2 copy vpt 1.12 mul sub M
+ hpt neg vpt 1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt -1.62 mul V closepath stroke
+ Pnt} def
+/TriDF {stroke [] 0 setdash vpt 1.12 mul sub M
+ hpt neg vpt 1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt -1.62 mul V closepath fill} def
+/DiaF {stroke [] 0 setdash vpt add M
+ hpt neg vpt neg V hpt vpt neg V
+ hpt vpt V hpt neg vpt V closepath fill} def
+/Pent {stroke [] 0 setdash 2 copy gsave
+ translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
+ closepath stroke grestore Pnt} def
+/PentF {stroke [] 0 setdash gsave
+ translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
+ closepath fill grestore} def
+/Circle {stroke [] 0 setdash 2 copy
+ hpt 0 360 arc stroke Pnt} def
+/CircleF {stroke [] 0 setdash hpt 0 360 arc fill} def
+/C0 {BL [] 0 setdash 2 copy moveto vpt 90 450 arc} bind def
+/C1 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 0 90 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C2 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 90 180 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C3 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 0 180 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C4 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 180 270 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C5 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 0 90 arc
+ 2 copy moveto
+ 2 copy vpt 180 270 arc closepath fill
+ vpt 0 360 arc} bind def
+/C6 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 90 270 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C7 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 0 270 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C8 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 270 360 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C9 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 270 450 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C10 {BL [] 0 setdash 2 copy 2 copy moveto vpt 270 360 arc closepath fill
+ 2 copy moveto
+ 2 copy vpt 90 180 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C11 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 0 180 arc closepath fill
+ 2 copy moveto
+ 2 copy vpt 270 360 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C12 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 180 360 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C13 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 0 90 arc closepath fill
+ 2 copy moveto
+ 2 copy vpt 180 360 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C14 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 90 360 arc closepath fill
+ vpt 0 360 arc} bind def
+/C15 {BL [] 0 setdash 2 copy vpt 0 360 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/Rec {newpath 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto
+ neg 0 rlineto closepath} bind def
+/Square {dup Rec} bind def
+/Bsquare {vpt sub exch vpt sub exch vpt2 Square} bind def
+/S0 {BL [] 0 setdash 2 copy moveto 0 vpt rlineto BL Bsquare} bind def
+/S1 {BL [] 0 setdash 2 copy vpt Square fill Bsquare} bind def
+/S2 {BL [] 0 setdash 2 copy exch vpt sub exch vpt Square fill Bsquare} bind def
+/S3 {BL [] 0 setdash 2 copy exch vpt sub exch vpt2 vpt Rec fill Bsquare} bind def
+/S4 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt Square fill Bsquare} bind def
+/S5 {BL [] 0 setdash 2 copy 2 copy vpt Square fill
+ exch vpt sub exch vpt sub vpt Square fill Bsquare} bind def
+/S6 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill Bsquare} bind def
+/S7 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill
+ 2 copy vpt Square fill Bsquare} bind def
+/S8 {BL [] 0 setdash 2 copy vpt sub vpt Square fill Bsquare} bind def
+/S9 {BL [] 0 setdash 2 copy vpt sub vpt vpt2 Rec fill Bsquare} bind def
+/S10 {BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt Square fill
+ Bsquare} bind def
+/S11 {BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt2 vpt Rec fill
+ Bsquare} bind def
+/S12 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill Bsquare} bind def
+/S13 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill
+ 2 copy vpt Square fill Bsquare} bind def
+/S14 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill
+ 2 copy exch vpt sub exch vpt Square fill Bsquare} bind def
+/S15 {BL [] 0 setdash 2 copy Bsquare fill Bsquare} bind def
+/D0 {gsave translate 45 rotate 0 0 S0 stroke grestore} bind def
+/D1 {gsave translate 45 rotate 0 0 S1 stroke grestore} bind def
+/D2 {gsave translate 45 rotate 0 0 S2 stroke grestore} bind def
+/D3 {gsave translate 45 rotate 0 0 S3 stroke grestore} bind def
+/D4 {gsave translate 45 rotate 0 0 S4 stroke grestore} bind def
+/D5 {gsave translate 45 rotate 0 0 S5 stroke grestore} bind def
+/D6 {gsave translate 45 rotate 0 0 S6 stroke grestore} bind def
+/D7 {gsave translate 45 rotate 0 0 S7 stroke grestore} bind def
+/D8 {gsave translate 45 rotate 0 0 S8 stroke grestore} bind def
+/D9 {gsave translate 45 rotate 0 0 S9 stroke grestore} bind def
+/D10 {gsave translate 45 rotate 0 0 S10 stroke grestore} bind def
+/D11 {gsave translate 45 rotate 0 0 S11 stroke grestore} bind def
+/D12 {gsave translate 45 rotate 0 0 S12 stroke grestore} bind def
+/D13 {gsave translate 45 rotate 0 0 S13 stroke grestore} bind def
+/D14 {gsave translate 45 rotate 0 0 S14 stroke grestore} bind def
+/D15 {gsave translate 45 rotate 0 0 S15 stroke grestore} bind def
+/DiaE {stroke [] 0 setdash vpt add M
+ hpt neg vpt neg V hpt vpt neg V
+ hpt vpt V hpt neg vpt V closepath stroke} def
+/BoxE {stroke [] 0 setdash exch hpt sub exch vpt add M
+ 0 vpt2 neg V hpt2 0 V 0 vpt2 V
+ hpt2 neg 0 V closepath stroke} def
+/TriUE {stroke [] 0 setdash vpt 1.12 mul add M
+ hpt neg vpt -1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt 1.62 mul V closepath stroke} def
+/TriDE {stroke [] 0 setdash vpt 1.12 mul sub M
+ hpt neg vpt 1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt -1.62 mul V closepath stroke} def
+/PentE {stroke [] 0 setdash gsave
+ translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
+ closepath stroke grestore} def
+/CircE {stroke [] 0 setdash
+ hpt 0 360 arc stroke} def
+/Opaque {gsave closepath 1 setgray fill grestore 0 setgray closepath} def
+/DiaW {stroke [] 0 setdash vpt add M
+ hpt neg vpt neg V hpt vpt neg V
+ hpt vpt V hpt neg vpt V Opaque stroke} def
+/BoxW {stroke [] 0 setdash exch hpt sub exch vpt add M
+ 0 vpt2 neg V hpt2 0 V 0 vpt2 V
+ hpt2 neg 0 V Opaque stroke} def
+/TriUW {stroke [] 0 setdash vpt 1.12 mul add M
+ hpt neg vpt -1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt 1.62 mul V Opaque stroke} def
+/TriDW {stroke [] 0 setdash vpt 1.12 mul sub M
+ hpt neg vpt 1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt -1.62 mul V Opaque stroke} def
+/PentW {stroke [] 0 setdash gsave
+ translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
+ Opaque stroke grestore} def
+/CircW {stroke [] 0 setdash
+ hpt 0 360 arc Opaque stroke} def
+/BoxFill {gsave Rec 1 setgray fill grestore} def
+/Density {
+ /Fillden exch def
+ currentrgbcolor
+ /ColB exch def /ColG exch def /ColR exch def
+ /ColR ColR Fillden mul Fillden sub 1 add def
+ /ColG ColG Fillden mul Fillden sub 1 add def
+ /ColB ColB Fillden mul Fillden sub 1 add def
+ ColR ColG ColB setrgbcolor} def
+/BoxColFill {gsave Rec PolyFill} def
+/PolyFill {gsave Density fill grestore grestore} def
+/h {rlineto rlineto rlineto gsave closepath fill grestore} bind def
+%
+% PostScript Level 1 Pattern Fill routine for rectangles
+% Usage: x y w h s a XX PatternFill
+% x,y = lower left corner of box to be filled
+% w,h = width and height of box
+% a = angle in degrees between lines and x-axis
+% XX = 0/1 for no/yes cross-hatch
+%
+/PatternFill {gsave /PFa [ 9 2 roll ] def
+ PFa 0 get PFa 2 get 2 div add PFa 1 get PFa 3 get 2 div add translate
+ PFa 2 get -2 div PFa 3 get -2 div PFa 2 get PFa 3 get Rec
+ TransparentPatterns {} {gsave 1 setgray fill grestore} ifelse
+ clip
+ currentlinewidth 0.5 mul setlinewidth
+ /PFs PFa 2 get dup mul PFa 3 get dup mul add sqrt def
+ 0 0 M PFa 5 get rotate PFs -2 div dup translate
+ 0 1 PFs PFa 4 get div 1 add floor cvi
+ {PFa 4 get mul 0 M 0 PFs V} for
+ 0 PFa 6 get ne {
+ 0 1 PFs PFa 4 get div 1 add floor cvi
+ {PFa 4 get mul 0 2 1 roll M PFs 0 V} for
+ } if
+ stroke grestore} def
+%
+/languagelevel where
+ {pop languagelevel} {1} ifelse
+dup 2 lt
+ {/InterpretLevel1 true def
+ /InterpretLevel3 false def}
+ {/InterpretLevel1 Level1 def
+ 2 gt
+ {/InterpretLevel3 Level3 def}
+ {/InterpretLevel3 false def}
+ ifelse }
+ ifelse
+%
+% PostScript level 2 pattern fill definitions
+%
+/Level2PatternFill {
+/Tile8x8 {/PaintType 2 /PatternType 1 /TilingType 1 /BBox [0 0 8 8] /XStep 8 /YStep 8}
+ bind def
+/KeepColor {currentrgbcolor [/Pattern /DeviceRGB] setcolorspace} bind def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop 0 0 M 8 8 L 0 8 M 8 0 L stroke}
+>> matrix makepattern
+/Pat1 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop 0 0 M 8 8 L 0 8 M 8 0 L stroke
+ 0 4 M 4 8 L 8 4 L 4 0 L 0 4 L stroke}
+>> matrix makepattern
+/Pat2 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop 0 0 M 0 8 L
+ 8 8 L 8 0 L 0 0 L fill}
+>> matrix makepattern
+/Pat3 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop -4 8 M 8 -4 L
+ 0 12 M 12 0 L stroke}
+>> matrix makepattern
+/Pat4 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop -4 0 M 8 12 L
+ 0 -4 M 12 8 L stroke}
+>> matrix makepattern
+/Pat5 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop -2 8 M 4 -4 L
+ 0 12 M 8 -4 L 4 12 M 10 0 L stroke}
+>> matrix makepattern
+/Pat6 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop -2 0 M 4 12 L
+ 0 -4 M 8 12 L 4 -4 M 10 8 L stroke}
+>> matrix makepattern
+/Pat7 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop 8 -2 M -4 4 L
+ 12 0 M -4 8 L 12 4 M 0 10 L stroke}
+>> matrix makepattern
+/Pat8 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop 0 -2 M 12 4 L
+ -4 0 M 12 8 L -4 4 M 8 10 L stroke}
+>> matrix makepattern
+/Pat9 exch def
+/Pattern1 {PatternBgnd KeepColor Pat1 setpattern} bind def
+/Pattern2 {PatternBgnd KeepColor Pat2 setpattern} bind def
+/Pattern3 {PatternBgnd KeepColor Pat3 setpattern} bind def
+/Pattern4 {PatternBgnd KeepColor Landscape {Pat5} {Pat4} ifelse setpattern} bind def
+/Pattern5 {PatternBgnd KeepColor Landscape {Pat4} {Pat5} ifelse setpattern} bind def
+/Pattern6 {PatternBgnd KeepColor Landscape {Pat9} {Pat6} ifelse setpattern} bind def
+/Pattern7 {PatternBgnd KeepColor Landscape {Pat8} {Pat7} ifelse setpattern} bind def
+} def
+%
+%
+%End of PostScript Level 2 code
+%
+/PatternBgnd {
+ TransparentPatterns {} {gsave 1 setgray fill grestore} ifelse
+} def
+%
+% Substitute for Level 2 pattern fill codes with
+% grayscale if Level 2 support is not selected.
+%
+/Level1PatternFill {
+/Pattern1 {0.250 Density} bind def
+/Pattern2 {0.500 Density} bind def
+/Pattern3 {0.750 Density} bind def
+/Pattern4 {0.125 Density} bind def
+/Pattern5 {0.375 Density} bind def
+/Pattern6 {0.625 Density} bind def
+/Pattern7 {0.875 Density} bind def
+} def
+%
+% Now test for support of Level 2 code
+%
+Level1 {Level1PatternFill} {Level2PatternFill} ifelse
+%
+/Symbol-Oblique /Symbol findfont [1 0 .167 1 0 0] makefont
+dup length dict begin {1 index /FID eq {pop pop} {def} ifelse} forall
+currentdict end definefont pop
+%
+/MFshow {
+ { dup 5 get 3 ge
+ { 5 get 3 eq {gsave} {grestore} ifelse }
+ {dup dup 0 get findfont exch 1 get scalefont setfont
+ [ currentpoint ] exch dup 2 get 0 exch R dup 5 get 2 ne {dup dup 6
+ get exch 4 get {textshow} {stringwidth pop 0 R} ifelse }if dup 5 get 0 eq
+ {dup 3 get {2 get neg 0 exch R pop} {pop aload pop M} ifelse} {dup 5
+ get 1 eq {dup 2 get exch dup 3 get exch 6 get stringwidth pop -2 div
+ dup 0 R} {dup 6 get stringwidth pop -2 div 0 R 6 get
+ textshow 2 index {aload pop M neg 3 -1 roll neg R pop pop} {pop pop pop
+ pop aload pop M} ifelse }ifelse }ifelse }
+ ifelse }
+ forall} def
+/Gswidth {dup type /stringtype eq {stringwidth} {pop (n) stringwidth} ifelse} def
+/MFwidth {0 exch { dup 5 get 3 ge { 5 get 3 eq { 0 } { pop } ifelse }
+ {dup 3 get{dup dup 0 get findfont exch 1 get scalefont setfont
+ 6 get Gswidth pop add} {pop} ifelse} ifelse} forall} def
+/MLshow { currentpoint stroke M
+ 0 exch R
+ Blacktext {gsave 0 setgray MFshow grestore} {MFshow} ifelse } bind def
+/MRshow { currentpoint stroke M
+ exch dup MFwidth neg 3 -1 roll R
+ Blacktext {gsave 0 setgray MFshow grestore} {MFshow} ifelse } bind def
+/MCshow { currentpoint stroke M
+ exch dup MFwidth -2 div 3 -1 roll R
+ Blacktext {gsave 0 setgray MFshow grestore} {MFshow} ifelse } bind def
+/XYsave { [( ) 1 2 true false 3 ()] } bind def
+/XYrestore { [( ) 1 2 true false 4 ()] } bind def
+Level1 SuppressPDFMark or
+{} {
+/SDict 10 dict def
+systemdict /pdfmark known not {
+ userdict /pdfmark systemdict /cleartomark get put
+} if
+SDict begin [
+ /Title (spec/tmp/histogram_plot.eps)
+ /Subject (gnuplot plot)
+ /Creator (gnuplot 5.0 patchlevel 5)
+% /Producer (gnuplot)
+% /Keywords ()
+ /CreationDate (Fri Nov 22 22:11:02 2019)
+ /DOCINFO pdfmark
+end
+} ifelse
+%
+% Support for boxed text - Ethan A Merritt May 2005
+%
+/InitTextBox { userdict /TBy2 3 -1 roll put userdict /TBx2 3 -1 roll put
+ userdict /TBy1 3 -1 roll put userdict /TBx1 3 -1 roll put
+ /Boxing true def } def
+/ExtendTextBox { Boxing
+ { gsave dup false charpath pathbbox
+ dup TBy2 gt {userdict /TBy2 3 -1 roll put} {pop} ifelse
+ dup TBx2 gt {userdict /TBx2 3 -1 roll put} {pop} ifelse
+ dup TBy1 lt {userdict /TBy1 3 -1 roll put} {pop} ifelse
+ dup TBx1 lt {userdict /TBx1 3 -1 roll put} {pop} ifelse
+ grestore } if } def
+/PopTextBox { newpath TBx1 TBxmargin sub TBy1 TBymargin sub M
+ TBx1 TBxmargin sub TBy2 TBymargin add L
+ TBx2 TBxmargin add TBy2 TBymargin add L
+ TBx2 TBxmargin add TBy1 TBymargin sub L closepath } def
+/DrawTextBox { PopTextBox stroke /Boxing false def} def
+/FillTextBox { gsave PopTextBox 1 1 1 setrgbcolor fill grestore /Boxing false def} def
+0 0 0 0 InitTextBox
+/TBxmargin 20 def
+/TBymargin 20 def
+/Boxing false def
+/textshow { ExtendTextBox Gshow } def
+%
+% redundant definitions for compatibility with prologue.ps older than 5.0.2
+/LTB {BL [] LCb DL} def
+/LTb {PL [] LCb DL} def
+end
+%%EndProlog
+%%Page: 1 1
+gnudict begin
+gsave
+doclip
+50 50 translate
+0.050 0.050 scale
+0 setgray
+newpath
+(Helvetica) findfont 140 scalefont setfont
+BackgroundColor 0 lt 3 1 roll 0 lt exch 0 lt or or not {BackgroundColor C 1.000 0 0 7200.00 5040.00 BoxColFill} if
+1.000 UL
+LTb
+LCb setrgbcolor
+686 448 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 448 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 0)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 911 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 911 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 20)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 1375 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 1375 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 40)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 1838 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 1838 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 60)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 2302 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 2302 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 80)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 2765 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 2765 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 100)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 3229 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 3229 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 120)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 3692 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 3692 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 140)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 4156 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 4156 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 160)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 4619 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 4619 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 180)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 448 M
+0 63 V
+0 4108 R
+0 -63 V
+stroke
+686 308 M
+[ [(Helvetica) 140.0 0.0 true true 0 (-0.1)]
+] -46.7 MCshow
+1.000 UL
+LTb
+LCb setrgbcolor
+1938 448 M
+0 63 V
+0 4108 R
+0 -63 V
+stroke
+1938 308 M
+[ [(Helvetica) 140.0 0.0 true true 0 (-0.05)]
+] -46.7 MCshow
+1.000 UL
+LTb
+LCb setrgbcolor
+3190 448 M
+0 63 V
+0 4108 R
+0 -63 V
+stroke
+3190 308 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 0)]
+] -46.7 MCshow
+1.000 UL
+LTb
+LCb setrgbcolor
+4443 448 M
+0 63 V
+0 4108 R
+0 -63 V
+stroke
+4443 308 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 0.05)]
+] -46.7 MCshow
+1.000 UL
+LTb
+LCb setrgbcolor
+5695 448 M
+0 63 V
+0 4108 R
+0 -63 V
+stroke
+5695 308 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 0.1)]
+] -46.7 MCshow
+1.000 UL
+LTb
+LCb setrgbcolor
+6947 448 M
+0 63 V
+0 4108 R
+0 -63 V
+stroke
+6947 308 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 0.15)]
+] -46.7 MCshow
+1.000 UL
+LTb
+LCb setrgbcolor
+1.000 UL
+LTB
+LCb setrgbcolor
+686 4619 N
+686 448 L
+6261 0 V
+0 4171 V
+-6261 0 V
+Z stroke
+1.000 UP
+1.000 UL
+LTb
+LCb setrgbcolor
+LCb setrgbcolor
+112 2533 M
+currentpoint gsave translate -270 rotate 0 0 moveto
+[ [(Helvetica) 140.0 0.0 true true 0 (frequency)]
+] -46.7 MCshow
+grestore
+LTb
+LCb setrgbcolor
+3816 98 M
+[ [(Helvetica) 140.0 0.0 true true 0 (x)]
+] -46.7 MCshow
+LTb
+LCb setrgbcolor
+3816 4829 M
+[ [(Helvetica) 140.0 0.0 true true 0 (Histogram)]
+] -46.7 MCshow
+% Begin plot #1
+1.000 UL
+LTb
+LCb setrgbcolor
+LCb setrgbcolor
+6296 4486 M
+[ [(Helvetica) 140.0 0.0 true true 0 (smooth frequency)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+6380 4451 N
+399 0 V
+0 70 V
+-399 0 V
+0 -70 V
+Z stroke
+811 448 N
+0 371 V
+251 0 V
+0 -371 V
+-251 0 V
+Z stroke
+1062 448 N
+0 209 V
+250 0 V
+0 -209 V
+-250 0 V
+Z stroke
+1312 448 N
+0 301 V
+251 0 V
+0 -301 V
+-251 0 V
+Z stroke
+1563 448 N
+0 255 V
+250 0 V
+0 -255 V
+-250 0 V
+Z stroke
+1813 448 N
+0 116 V
+250 0 V
+0 -116 V
+-250 0 V
+Z stroke
+2063 448 N
+0 209 V
+251 0 V
+0 -209 V
+-251 0 V
+Z stroke
+2314 448 N
+0 487 V
+250 0 V
+0 -487 V
+-250 0 V
+Z stroke
+2564 448 N
+0 417 V
+251 0 V
+0 -417 V
+-251 0 V
+Z stroke
+2815 448 N
+0 602 V
+250 0 V
+0 -602 V
+-250 0 V
+Z stroke
+3065 448 N
+0 3754 V
+251 0 V
+0 -3754 V
+-251 0 V
+Z stroke
+3316 448 N
+0 742 V
+250 0 V
+0 -742 V
+-250 0 V
+Z stroke
+3566 448 N
+0 440 V
+251 0 V
+0 -440 V
+-251 0 V
+Z stroke
+3817 448 N
+0 417 V
+250 0 V
+0 -417 V
+-250 0 V
+Z stroke
+4067 448 N
+0 301 V
+250 0 V
+0 -301 V
+-250 0 V
+Z stroke
+4317 448 N
+0 324 V
+251 0 V
+0 -324 V
+-251 0 V
+Z stroke
+4568 448 N
+0 278 V
+250 0 V
+0 -278 V
+-250 0 V
+Z stroke
+4818 448 N
+0 348 V
+251 0 V
+0 -348 V
+-251 0 V
+Z stroke
+5069 448 N
+0 394 V
+250 0 V
+0 -394 V
+-250 0 V
+Z stroke
+5319 448 N
+0 348 V
+251 0 V
+0 -348 V
+-251 0 V
+Z stroke
+5570 448 N
+0 463 V
+250 0 V
+0 -463 V
+-250 0 V
+Z stroke
+5820 448 N
+0 834 V
+125 0 V
+0 -834 V
+-125 0 V
+Z stroke
+% End plot #1
+2.000 UL
+LTb
+LCb setrgbcolor
+1.000 UL
+LTB
+LCb setrgbcolor
+686 4619 N
+686 448 L
+6261 0 V
+0 4171 V
+-6261 0 V
+Z stroke
+1.000 UP
+1.000 UL
+LTb
+LCb setrgbcolor
+stroke
+grestore
+end
+showpage
+%%Trailer
+%%DocumentFonts: Helvetica
diff --git a/spec/fixtures/plots/multtest_plot.eps b/spec/fixtures/plots/multtest_plot.eps
new file mode 100644
index 0000000..7575c79
--- /dev/null
+++ b/spec/fixtures/plots/multtest_plot.eps
@@ -0,0 +1,857 @@
+%!PS-Adobe-2.0 EPSF-2.0
+%%Title: spec/tmp/multtest_plot.eps
+%%Creator: gnuplot 5.0 patchlevel 5
+%%CreationDate: Fri Nov 22 22:28:48 2019
+%%DocumentFonts: (atend)
+%%BoundingBox: 50 50 410 302
+%%EndComments
+%%BeginProlog
+/gnudict 256 dict def
+gnudict begin
+%
+% The following true/false flags may be edited by hand if desired.
+% The unit line width and grayscale image gamma correction may also be changed.
+%
+/Color false def
+/Blacktext false def
+/Solid false def
+/Dashlength 1 def
+/Landscape false def
+/Level1 false def
+/Level3 false def
+/Rounded false def
+/ClipToBoundingBox false def
+/SuppressPDFMark false def
+/TransparentPatterns false def
+/gnulinewidth 5.000 def
+/userlinewidth gnulinewidth def
+/Gamma 1.0 def
+/BackgroundColor {-1.000 -1.000 -1.000} def
+%
+/vshift -46 def
+/dl1 {
+ 10.0 Dashlength userlinewidth gnulinewidth div mul mul mul
+ Rounded { currentlinewidth 0.75 mul sub dup 0 le { pop 0.01 } if } if
+} def
+/dl2 {
+ 10.0 Dashlength userlinewidth gnulinewidth div mul mul mul
+ Rounded { currentlinewidth 0.75 mul add } if
+} def
+/hpt_ 31.5 def
+/vpt_ 31.5 def
+/hpt hpt_ def
+/vpt vpt_ def
+/doclip {
+ ClipToBoundingBox {
+ newpath 50 50 moveto 410 50 lineto 410 302 lineto 50 302 lineto closepath
+ clip
+ } if
+} def
+%
+% Gnuplot Prolog Version 5.1 (Oct 2015)
+%
+%/SuppressPDFMark true def
+%
+/M {moveto} bind def
+/L {lineto} bind def
+/R {rmoveto} bind def
+/V {rlineto} bind def
+/N {newpath moveto} bind def
+/Z {closepath} bind def
+/C {setrgbcolor} bind def
+/f {rlineto fill} bind def
+/g {setgray} bind def
+/Gshow {show} def % May be redefined later in the file to support UTF-8
+/vpt2 vpt 2 mul def
+/hpt2 hpt 2 mul def
+/Lshow {currentpoint stroke M 0 vshift R
+ Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def
+/Rshow {currentpoint stroke M dup stringwidth pop neg vshift R
+ Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def
+/Cshow {currentpoint stroke M dup stringwidth pop -2 div vshift R
+ Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def
+/UP {dup vpt_ mul /vpt exch def hpt_ mul /hpt exch def
+ /hpt2 hpt 2 mul def /vpt2 vpt 2 mul def} def
+/DL {Color {setrgbcolor Solid {pop []} if 0 setdash}
+ {pop pop pop 0 setgray Solid {pop []} if 0 setdash} ifelse} def
+/BL {stroke userlinewidth 2 mul setlinewidth
+ Rounded {1 setlinejoin 1 setlinecap} if} def
+/AL {stroke userlinewidth 2 div setlinewidth
+ Rounded {1 setlinejoin 1 setlinecap} if} def
+/UL {dup gnulinewidth mul /userlinewidth exch def
+ dup 1 lt {pop 1} if 10 mul /udl exch def} def
+/PL {stroke userlinewidth setlinewidth
+ Rounded {1 setlinejoin 1 setlinecap} if} def
+3.8 setmiterlimit
+% Classic Line colors (version 5.0)
+/LCw {1 1 1} def
+/LCb {0 0 0} def
+/LCa {0 0 0} def
+/LC0 {1 0 0} def
+/LC1 {0 1 0} def
+/LC2 {0 0 1} def
+/LC3 {1 0 1} def
+/LC4 {0 1 1} def
+/LC5 {1 1 0} def
+/LC6 {0 0 0} def
+/LC7 {1 0.3 0} def
+/LC8 {0.5 0.5 0.5} def
+% Default dash patterns (version 5.0)
+/LTB {BL [] LCb DL} def
+/LTw {PL [] 1 setgray} def
+/LTb {PL [] LCb DL} def
+/LTa {AL [1 udl mul 2 udl mul] 0 setdash LCa setrgbcolor} def
+/LT0 {PL [] LC0 DL} def
+/LT1 {PL [2 dl1 3 dl2] LC1 DL} def
+/LT2 {PL [1 dl1 1.5 dl2] LC2 DL} def
+/LT3 {PL [6 dl1 2 dl2 1 dl1 2 dl2] LC3 DL} def
+/LT4 {PL [1 dl1 2 dl2 6 dl1 2 dl2 1 dl1 2 dl2] LC4 DL} def
+/LT5 {PL [4 dl1 2 dl2] LC5 DL} def
+/LT6 {PL [1.5 dl1 1.5 dl2 1.5 dl1 1.5 dl2 1.5 dl1 6 dl2] LC6 DL} def
+/LT7 {PL [3 dl1 3 dl2 1 dl1 3 dl2] LC7 DL} def
+/LT8 {PL [2 dl1 2 dl2 2 dl1 6 dl2] LC8 DL} def
+/SL {[] 0 setdash} def
+/Pnt {stroke [] 0 setdash gsave 1 setlinecap M 0 0 V stroke grestore} def
+/Dia {stroke [] 0 setdash 2 copy vpt add M
+ hpt neg vpt neg V hpt vpt neg V
+ hpt vpt V hpt neg vpt V closepath stroke
+ Pnt} def
+/Pls {stroke [] 0 setdash vpt sub M 0 vpt2 V
+ currentpoint stroke M
+ hpt neg vpt neg R hpt2 0 V stroke
+ } def
+/Box {stroke [] 0 setdash 2 copy exch hpt sub exch vpt add M
+ 0 vpt2 neg V hpt2 0 V 0 vpt2 V
+ hpt2 neg 0 V closepath stroke
+ Pnt} def
+/Crs {stroke [] 0 setdash exch hpt sub exch vpt add M
+ hpt2 vpt2 neg V currentpoint stroke M
+ hpt2 neg 0 R hpt2 vpt2 V stroke} def
+/TriU {stroke [] 0 setdash 2 copy vpt 1.12 mul add M
+ hpt neg vpt -1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt 1.62 mul V closepath stroke
+ Pnt} def
+/Star {2 copy Pls Crs} def
+/BoxF {stroke [] 0 setdash exch hpt sub exch vpt add M
+ 0 vpt2 neg V hpt2 0 V 0 vpt2 V
+ hpt2 neg 0 V closepath fill} def
+/TriUF {stroke [] 0 setdash vpt 1.12 mul add M
+ hpt neg vpt -1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt 1.62 mul V closepath fill} def
+/TriD {stroke [] 0 setdash 2 copy vpt 1.12 mul sub M
+ hpt neg vpt 1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt -1.62 mul V closepath stroke
+ Pnt} def
+/TriDF {stroke [] 0 setdash vpt 1.12 mul sub M
+ hpt neg vpt 1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt -1.62 mul V closepath fill} def
+/DiaF {stroke [] 0 setdash vpt add M
+ hpt neg vpt neg V hpt vpt neg V
+ hpt vpt V hpt neg vpt V closepath fill} def
+/Pent {stroke [] 0 setdash 2 copy gsave
+ translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
+ closepath stroke grestore Pnt} def
+/PentF {stroke [] 0 setdash gsave
+ translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
+ closepath fill grestore} def
+/Circle {stroke [] 0 setdash 2 copy
+ hpt 0 360 arc stroke Pnt} def
+/CircleF {stroke [] 0 setdash hpt 0 360 arc fill} def
+/C0 {BL [] 0 setdash 2 copy moveto vpt 90 450 arc} bind def
+/C1 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 0 90 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C2 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 90 180 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C3 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 0 180 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C4 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 180 270 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C5 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 0 90 arc
+ 2 copy moveto
+ 2 copy vpt 180 270 arc closepath fill
+ vpt 0 360 arc} bind def
+/C6 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 90 270 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C7 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 0 270 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C8 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 270 360 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C9 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 270 450 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C10 {BL [] 0 setdash 2 copy 2 copy moveto vpt 270 360 arc closepath fill
+ 2 copy moveto
+ 2 copy vpt 90 180 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C11 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 0 180 arc closepath fill
+ 2 copy moveto
+ 2 copy vpt 270 360 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C12 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 180 360 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C13 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 0 90 arc closepath fill
+ 2 copy moveto
+ 2 copy vpt 180 360 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C14 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 90 360 arc closepath fill
+ vpt 0 360 arc} bind def
+/C15 {BL [] 0 setdash 2 copy vpt 0 360 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/Rec {newpath 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto
+ neg 0 rlineto closepath} bind def
+/Square {dup Rec} bind def
+/Bsquare {vpt sub exch vpt sub exch vpt2 Square} bind def
+/S0 {BL [] 0 setdash 2 copy moveto 0 vpt rlineto BL Bsquare} bind def
+/S1 {BL [] 0 setdash 2 copy vpt Square fill Bsquare} bind def
+/S2 {BL [] 0 setdash 2 copy exch vpt sub exch vpt Square fill Bsquare} bind def
+/S3 {BL [] 0 setdash 2 copy exch vpt sub exch vpt2 vpt Rec fill Bsquare} bind def
+/S4 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt Square fill Bsquare} bind def
+/S5 {BL [] 0 setdash 2 copy 2 copy vpt Square fill
+ exch vpt sub exch vpt sub vpt Square fill Bsquare} bind def
+/S6 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill Bsquare} bind def
+/S7 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill
+ 2 copy vpt Square fill Bsquare} bind def
+/S8 {BL [] 0 setdash 2 copy vpt sub vpt Square fill Bsquare} bind def
+/S9 {BL [] 0 setdash 2 copy vpt sub vpt vpt2 Rec fill Bsquare} bind def
+/S10 {BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt Square fill
+ Bsquare} bind def
+/S11 {BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt2 vpt Rec fill
+ Bsquare} bind def
+/S12 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill Bsquare} bind def
+/S13 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill
+ 2 copy vpt Square fill Bsquare} bind def
+/S14 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill
+ 2 copy exch vpt sub exch vpt Square fill Bsquare} bind def
+/S15 {BL [] 0 setdash 2 copy Bsquare fill Bsquare} bind def
+/D0 {gsave translate 45 rotate 0 0 S0 stroke grestore} bind def
+/D1 {gsave translate 45 rotate 0 0 S1 stroke grestore} bind def
+/D2 {gsave translate 45 rotate 0 0 S2 stroke grestore} bind def
+/D3 {gsave translate 45 rotate 0 0 S3 stroke grestore} bind def
+/D4 {gsave translate 45 rotate 0 0 S4 stroke grestore} bind def
+/D5 {gsave translate 45 rotate 0 0 S5 stroke grestore} bind def
+/D6 {gsave translate 45 rotate 0 0 S6 stroke grestore} bind def
+/D7 {gsave translate 45 rotate 0 0 S7 stroke grestore} bind def
+/D8 {gsave translate 45 rotate 0 0 S8 stroke grestore} bind def
+/D9 {gsave translate 45 rotate 0 0 S9 stroke grestore} bind def
+/D10 {gsave translate 45 rotate 0 0 S10 stroke grestore} bind def
+/D11 {gsave translate 45 rotate 0 0 S11 stroke grestore} bind def
+/D12 {gsave translate 45 rotate 0 0 S12 stroke grestore} bind def
+/D13 {gsave translate 45 rotate 0 0 S13 stroke grestore} bind def
+/D14 {gsave translate 45 rotate 0 0 S14 stroke grestore} bind def
+/D15 {gsave translate 45 rotate 0 0 S15 stroke grestore} bind def
+/DiaE {stroke [] 0 setdash vpt add M
+ hpt neg vpt neg V hpt vpt neg V
+ hpt vpt V hpt neg vpt V closepath stroke} def
+/BoxE {stroke [] 0 setdash exch hpt sub exch vpt add M
+ 0 vpt2 neg V hpt2 0 V 0 vpt2 V
+ hpt2 neg 0 V closepath stroke} def
+/TriUE {stroke [] 0 setdash vpt 1.12 mul add M
+ hpt neg vpt -1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt 1.62 mul V closepath stroke} def
+/TriDE {stroke [] 0 setdash vpt 1.12 mul sub M
+ hpt neg vpt 1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt -1.62 mul V closepath stroke} def
+/PentE {stroke [] 0 setdash gsave
+ translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
+ closepath stroke grestore} def
+/CircE {stroke [] 0 setdash
+ hpt 0 360 arc stroke} def
+/Opaque {gsave closepath 1 setgray fill grestore 0 setgray closepath} def
+/DiaW {stroke [] 0 setdash vpt add M
+ hpt neg vpt neg V hpt vpt neg V
+ hpt vpt V hpt neg vpt V Opaque stroke} def
+/BoxW {stroke [] 0 setdash exch hpt sub exch vpt add M
+ 0 vpt2 neg V hpt2 0 V 0 vpt2 V
+ hpt2 neg 0 V Opaque stroke} def
+/TriUW {stroke [] 0 setdash vpt 1.12 mul add M
+ hpt neg vpt -1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt 1.62 mul V Opaque stroke} def
+/TriDW {stroke [] 0 setdash vpt 1.12 mul sub M
+ hpt neg vpt 1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt -1.62 mul V Opaque stroke} def
+/PentW {stroke [] 0 setdash gsave
+ translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
+ Opaque stroke grestore} def
+/CircW {stroke [] 0 setdash
+ hpt 0 360 arc Opaque stroke} def
+/BoxFill {gsave Rec 1 setgray fill grestore} def
+/Density {
+ /Fillden exch def
+ currentrgbcolor
+ /ColB exch def /ColG exch def /ColR exch def
+ /ColR ColR Fillden mul Fillden sub 1 add def
+ /ColG ColG Fillden mul Fillden sub 1 add def
+ /ColB ColB Fillden mul Fillden sub 1 add def
+ ColR ColG ColB setrgbcolor} def
+/BoxColFill {gsave Rec PolyFill} def
+/PolyFill {gsave Density fill grestore grestore} def
+/h {rlineto rlineto rlineto gsave closepath fill grestore} bind def
+%
+% PostScript Level 1 Pattern Fill routine for rectangles
+% Usage: x y w h s a XX PatternFill
+% x,y = lower left corner of box to be filled
+% w,h = width and height of box
+% a = angle in degrees between lines and x-axis
+% XX = 0/1 for no/yes cross-hatch
+%
+/PatternFill {gsave /PFa [ 9 2 roll ] def
+ PFa 0 get PFa 2 get 2 div add PFa 1 get PFa 3 get 2 div add translate
+ PFa 2 get -2 div PFa 3 get -2 div PFa 2 get PFa 3 get Rec
+ TransparentPatterns {} {gsave 1 setgray fill grestore} ifelse
+ clip
+ currentlinewidth 0.5 mul setlinewidth
+ /PFs PFa 2 get dup mul PFa 3 get dup mul add sqrt def
+ 0 0 M PFa 5 get rotate PFs -2 div dup translate
+ 0 1 PFs PFa 4 get div 1 add floor cvi
+ {PFa 4 get mul 0 M 0 PFs V} for
+ 0 PFa 6 get ne {
+ 0 1 PFs PFa 4 get div 1 add floor cvi
+ {PFa 4 get mul 0 2 1 roll M PFs 0 V} for
+ } if
+ stroke grestore} def
+%
+/languagelevel where
+ {pop languagelevel} {1} ifelse
+dup 2 lt
+ {/InterpretLevel1 true def
+ /InterpretLevel3 false def}
+ {/InterpretLevel1 Level1 def
+ 2 gt
+ {/InterpretLevel3 Level3 def}
+ {/InterpretLevel3 false def}
+ ifelse }
+ ifelse
+%
+% PostScript level 2 pattern fill definitions
+%
+/Level2PatternFill {
+/Tile8x8 {/PaintType 2 /PatternType 1 /TilingType 1 /BBox [0 0 8 8] /XStep 8 /YStep 8}
+ bind def
+/KeepColor {currentrgbcolor [/Pattern /DeviceRGB] setcolorspace} bind def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop 0 0 M 8 8 L 0 8 M 8 0 L stroke}
+>> matrix makepattern
+/Pat1 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop 0 0 M 8 8 L 0 8 M 8 0 L stroke
+ 0 4 M 4 8 L 8 4 L 4 0 L 0 4 L stroke}
+>> matrix makepattern
+/Pat2 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop 0 0 M 0 8 L
+ 8 8 L 8 0 L 0 0 L fill}
+>> matrix makepattern
+/Pat3 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop -4 8 M 8 -4 L
+ 0 12 M 12 0 L stroke}
+>> matrix makepattern
+/Pat4 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop -4 0 M 8 12 L
+ 0 -4 M 12 8 L stroke}
+>> matrix makepattern
+/Pat5 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop -2 8 M 4 -4 L
+ 0 12 M 8 -4 L 4 12 M 10 0 L stroke}
+>> matrix makepattern
+/Pat6 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop -2 0 M 4 12 L
+ 0 -4 M 8 12 L 4 -4 M 10 8 L stroke}
+>> matrix makepattern
+/Pat7 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop 8 -2 M -4 4 L
+ 12 0 M -4 8 L 12 4 M 0 10 L stroke}
+>> matrix makepattern
+/Pat8 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop 0 -2 M 12 4 L
+ -4 0 M 12 8 L -4 4 M 8 10 L stroke}
+>> matrix makepattern
+/Pat9 exch def
+/Pattern1 {PatternBgnd KeepColor Pat1 setpattern} bind def
+/Pattern2 {PatternBgnd KeepColor Pat2 setpattern} bind def
+/Pattern3 {PatternBgnd KeepColor Pat3 setpattern} bind def
+/Pattern4 {PatternBgnd KeepColor Landscape {Pat5} {Pat4} ifelse setpattern} bind def
+/Pattern5 {PatternBgnd KeepColor Landscape {Pat4} {Pat5} ifelse setpattern} bind def
+/Pattern6 {PatternBgnd KeepColor Landscape {Pat9} {Pat6} ifelse setpattern} bind def
+/Pattern7 {PatternBgnd KeepColor Landscape {Pat8} {Pat7} ifelse setpattern} bind def
+} def
+%
+%
+%End of PostScript Level 2 code
+%
+/PatternBgnd {
+ TransparentPatterns {} {gsave 1 setgray fill grestore} ifelse
+} def
+%
+% Substitute for Level 2 pattern fill codes with
+% grayscale if Level 2 support is not selected.
+%
+/Level1PatternFill {
+/Pattern1 {0.250 Density} bind def
+/Pattern2 {0.500 Density} bind def
+/Pattern3 {0.750 Density} bind def
+/Pattern4 {0.125 Density} bind def
+/Pattern5 {0.375 Density} bind def
+/Pattern6 {0.625 Density} bind def
+/Pattern7 {0.875 Density} bind def
+} def
+%
+% Now test for support of Level 2 code
+%
+Level1 {Level1PatternFill} {Level2PatternFill} ifelse
+%
+/Symbol-Oblique /Symbol findfont [1 0 .167 1 0 0] makefont
+dup length dict begin {1 index /FID eq {pop pop} {def} ifelse} forall
+currentdict end definefont pop
+%
+/MFshow {
+ { dup 5 get 3 ge
+ { 5 get 3 eq {gsave} {grestore} ifelse }
+ {dup dup 0 get findfont exch 1 get scalefont setfont
+ [ currentpoint ] exch dup 2 get 0 exch R dup 5 get 2 ne {dup dup 6
+ get exch 4 get {textshow} {stringwidth pop 0 R} ifelse }if dup 5 get 0 eq
+ {dup 3 get {2 get neg 0 exch R pop} {pop aload pop M} ifelse} {dup 5
+ get 1 eq {dup 2 get exch dup 3 get exch 6 get stringwidth pop -2 div
+ dup 0 R} {dup 6 get stringwidth pop -2 div 0 R 6 get
+ textshow 2 index {aload pop M neg 3 -1 roll neg R pop pop} {pop pop pop
+ pop aload pop M} ifelse }ifelse }ifelse }
+ ifelse }
+ forall} def
+/Gswidth {dup type /stringtype eq {stringwidth} {pop (n) stringwidth} ifelse} def
+/MFwidth {0 exch { dup 5 get 3 ge { 5 get 3 eq { 0 } { pop } ifelse }
+ {dup 3 get{dup dup 0 get findfont exch 1 get scalefont setfont
+ 6 get Gswidth pop add} {pop} ifelse} ifelse} forall} def
+/MLshow { currentpoint stroke M
+ 0 exch R
+ Blacktext {gsave 0 setgray MFshow grestore} {MFshow} ifelse } bind def
+/MRshow { currentpoint stroke M
+ exch dup MFwidth neg 3 -1 roll R
+ Blacktext {gsave 0 setgray MFshow grestore} {MFshow} ifelse } bind def
+/MCshow { currentpoint stroke M
+ exch dup MFwidth -2 div 3 -1 roll R
+ Blacktext {gsave 0 setgray MFshow grestore} {MFshow} ifelse } bind def
+/XYsave { [( ) 1 2 true false 3 ()] } bind def
+/XYrestore { [( ) 1 2 true false 4 ()] } bind def
+Level1 SuppressPDFMark or
+{} {
+/SDict 10 dict def
+systemdict /pdfmark known not {
+ userdict /pdfmark systemdict /cleartomark get put
+} if
+SDict begin [
+ /Title (spec/tmp/multtest_plot.eps)
+ /Subject (gnuplot plot)
+ /Creator (gnuplot 5.0 patchlevel 5)
+% /Producer (gnuplot)
+% /Keywords ()
+ /CreationDate (Fri Nov 22 22:28:48 2019)
+ /DOCINFO pdfmark
+end
+} ifelse
+%
+% Support for boxed text - Ethan A Merritt May 2005
+%
+/InitTextBox { userdict /TBy2 3 -1 roll put userdict /TBx2 3 -1 roll put
+ userdict /TBy1 3 -1 roll put userdict /TBx1 3 -1 roll put
+ /Boxing true def } def
+/ExtendTextBox { Boxing
+ { gsave dup false charpath pathbbox
+ dup TBy2 gt {userdict /TBy2 3 -1 roll put} {pop} ifelse
+ dup TBx2 gt {userdict /TBx2 3 -1 roll put} {pop} ifelse
+ dup TBy1 lt {userdict /TBy1 3 -1 roll put} {pop} ifelse
+ dup TBx1 lt {userdict /TBx1 3 -1 roll put} {pop} ifelse
+ grestore } if } def
+/PopTextBox { newpath TBx1 TBxmargin sub TBy1 TBymargin sub M
+ TBx1 TBxmargin sub TBy2 TBymargin add L
+ TBx2 TBxmargin add TBy2 TBymargin add L
+ TBx2 TBxmargin add TBy1 TBymargin sub L closepath } def
+/DrawTextBox { PopTextBox stroke /Boxing false def} def
+/FillTextBox { gsave PopTextBox 1 1 1 setrgbcolor fill grestore /Boxing false def} def
+0 0 0 0 InitTextBox
+/TBxmargin 20 def
+/TBymargin 20 def
+/Boxing false def
+/textshow { ExtendTextBox Gshow } def
+%
+% redundant definitions for compatibility with prologue.ps older than 5.0.2
+/LTB {BL [] LCb DL} def
+/LTb {PL [] LCb DL} def
+end
+%%EndProlog
+%%Page: 1 1
+gnudict begin
+gsave
+doclip
+50 50 translate
+0.050 0.050 scale
+0 setgray
+newpath
+(Helvetica) findfont 140 scalefont setfont
+BackgroundColor 0 lt 3 1 roll 0 lt exch 0 lt or or not {BackgroundColor C 1.000 0 0 7200.00 5040.00 BoxColFill} if
+1.000 UL
+LTb
+LCb setrgbcolor
+686 448 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 448 M
+[ [(Helvetica) 140.0 0.0 true true 0 (-20)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 1143 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 1143 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 0)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 1838 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 1838 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 20)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 2534 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 2534 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 40)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 3229 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 3229 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 60)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 3924 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 3924 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 80)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 4619 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 4619 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 100)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 448 M
+0 63 V
+0 4108 R
+0 -63 V
+stroke
+686 308 M
+[ [(Helvetica) 140.0 0.0 true true 0 (-10)]
+] -46.7 MCshow
+1.000 UL
+LTb
+LCb setrgbcolor
+2251 448 M
+0 63 V
+0 4108 R
+0 -63 V
+stroke
+2251 308 M
+[ [(Helvetica) 140.0 0.0 true true 0 (-5)]
+] -46.7 MCshow
+1.000 UL
+LTb
+LCb setrgbcolor
+3817 448 M
+0 63 V
+0 4108 R
+0 -63 V
+stroke
+3817 308 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 0)]
+] -46.7 MCshow
+1.000 UL
+LTb
+LCb setrgbcolor
+5382 448 M
+0 63 V
+0 4108 R
+0 -63 V
+stroke
+5382 308 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 5)]
+] -46.7 MCshow
+1.000 UL
+LTb
+LCb setrgbcolor
+6947 448 M
+0 63 V
+0 4108 R
+0 -63 V
+stroke
+6947 308 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 10)]
+] -46.7 MCshow
+1.000 UL
+LTb
+LCb setrgbcolor
+1.000 UL
+LTB
+LCb setrgbcolor
+686 4619 N
+686 448 L
+6261 0 V
+0 4171 V
+-6261 0 V
+Z stroke
+1.000 UP
+1.000 UL
+LTb
+LCb setrgbcolor
+LCb setrgbcolor
+112 2533 M
+currentpoint gsave translate -270 rotate 0 0 moveto
+[ [(Helvetica) 140.0 0.0 true true 0 (x)]
+] -46.7 MCshow
+grestore
+LTb
+LCb setrgbcolor
+3816 98 M
+[ [(Helvetica) 140.0 0.0 true true 0 (sin\(x\))]
+] -46.7 MCshow
+LTb
+LCb setrgbcolor
+3816 4829 M
+[ [(Helvetica) 140.0 0.0 true true 0 (Sin Wave Example)]
+] -46.7 MCshow
+% Begin plot #1
+4.000 UL
+LTb
+LCb setrgbcolor
+LCb setrgbcolor
+6296 4486 M
+[ [(Helvetica) 140.0 0.0 true true 0 (String function)]
+] -46.7 MRshow
+4.000 UL
+LTb
+LCb setrgbcolor
+6380 4486 M
+399 0 V
+686 1162 M
+63 -6 V
+63 -7 V
+64 -7 V
+63 -7 V
+63 -6 V
+63 -7 V
+64 -5 V
+63 -4 V
+63 -3 V
+63 -1 V
+64 0 V
+63 1 V
+63 2 V
+63 4 V
+64 5 V
+63 6 V
+63 6 V
+63 7 V
+64 7 V
+63 7 V
+63 7 V
+63 5 V
+64 5 V
+63 4 V
+63 2 V
+63 1 V
+64 -1 V
+63 -1 V
+63 -4 V
+63 -4 V
+64 -5 V
+63 -6 V
+63 -7 V
+63 -7 V
+63 -7 V
+64 -7 V
+63 -6 V
+63 -5 V
+63 -4 V
+64 -4 V
+63 -1 V
+63 -1 V
+63 2 V
+64 2 V
+63 4 V
+63 5 V
+63 5 V
+64 7 V
+63 7 V
+63 7 V
+63 7 V
+64 6 V
+63 6 V
+63 5 V
+63 3 V
+64 3 V
+63 1 V
+63 0 V
+63 -2 V
+64 -3 V
+63 -4 V
+63 -6 V
+63 -6 V
+64 -7 V
+63 -6 V
+63 -7 V
+63 -7 V
+63 -6 V
+64 -6 V
+63 -4 V
+63 -3 V
+63 -2 V
+64 -1 V
+63 1 V
+63 3 V
+63 3 V
+64 5 V
+63 6 V
+63 6 V
+63 7 V
+64 7 V
+63 7 V
+63 6 V
+63 6 V
+64 5 V
+63 4 V
+63 3 V
+63 1 V
+64 0 V
+63 -2 V
+63 -3 V
+63 -4 V
+64 -5 V
+63 -6 V
+63 -7 V
+63 -7 V
+64 -7 V
+63 -7 V
+63 -6 V
+% End plot #1
+% Begin plot #2
+1.000 UP
+stroke
+1.000 UL
+LTb
+LT1
+LCb setrgbcolor
+LCb setrgbcolor
+6296 4346 M
+[ [(Helvetica) 140.0 0.0 true true 0 (Array data)]
+] -46.7 MRshow
+1.000 UP
+1.000 UL
+LTb
+LT1
+LCb setrgbcolor
+6380 4346 M
+399 0 V
+3817 1143 M
+313 35 V
+313 104 V
+313 174 V
+313 243 V
+313 313 V
+313 382 V
+313 452 V
+313 522 V
+313 591 V
+313 660 V
+3817 1143 Pls
+4130 1178 Pls
+4443 1282 Pls
+4756 1456 Pls
+5069 1699 Pls
+5382 2012 Pls
+5695 2394 Pls
+6008 2846 Pls
+6321 3368 Pls
+6634 3959 Pls
+6947 4619 Pls
+6579 4346 Pls
+% End plot #2
+2.000 UL
+LTb
+LCb setrgbcolor
+1.000 UL
+LTB
+LCb setrgbcolor
+686 4619 N
+686 448 L
+6261 0 V
+0 4171 V
+-6261 0 V
+Z stroke
+1.000 UP
+1.000 UL
+LTb
+LCb setrgbcolor
+stroke
+grestore
+end
+showpage
+%%Trailer
+%%DocumentFonts: Helvetica
diff --git a/spec/fixtures/plots/sin_wave_plot.eps b/spec/fixtures/plots/sin_wave_plot.eps
new file mode 100644
index 0000000..f30514a
--- /dev/null
+++ b/spec/fixtures/plots/sin_wave_plot.eps
@@ -0,0 +1,862 @@
+%!PS-Adobe-2.0 EPSF-2.0
+%%Title: spec/tmp/sin_wave_plot.eps
+%%Creator: gnuplot 5.0 patchlevel 5
+%%CreationDate: Fri Nov 22 22:30:52 2019
+%%DocumentFonts: (atend)
+%%BoundingBox: 50 50 410 302
+%%EndComments
+%%BeginProlog
+/gnudict 256 dict def
+gnudict begin
+%
+% The following true/false flags may be edited by hand if desired.
+% The unit line width and grayscale image gamma correction may also be changed.
+%
+/Color false def
+/Blacktext false def
+/Solid false def
+/Dashlength 1 def
+/Landscape false def
+/Level1 false def
+/Level3 false def
+/Rounded false def
+/ClipToBoundingBox false def
+/SuppressPDFMark false def
+/TransparentPatterns false def
+/gnulinewidth 5.000 def
+/userlinewidth gnulinewidth def
+/Gamma 1.0 def
+/BackgroundColor {-1.000 -1.000 -1.000} def
+%
+/vshift -46 def
+/dl1 {
+ 10.0 Dashlength userlinewidth gnulinewidth div mul mul mul
+ Rounded { currentlinewidth 0.75 mul sub dup 0 le { pop 0.01 } if } if
+} def
+/dl2 {
+ 10.0 Dashlength userlinewidth gnulinewidth div mul mul mul
+ Rounded { currentlinewidth 0.75 mul add } if
+} def
+/hpt_ 31.5 def
+/vpt_ 31.5 def
+/hpt hpt_ def
+/vpt vpt_ def
+/doclip {
+ ClipToBoundingBox {
+ newpath 50 50 moveto 410 50 lineto 410 302 lineto 50 302 lineto closepath
+ clip
+ } if
+} def
+%
+% Gnuplot Prolog Version 5.1 (Oct 2015)
+%
+%/SuppressPDFMark true def
+%
+/M {moveto} bind def
+/L {lineto} bind def
+/R {rmoveto} bind def
+/V {rlineto} bind def
+/N {newpath moveto} bind def
+/Z {closepath} bind def
+/C {setrgbcolor} bind def
+/f {rlineto fill} bind def
+/g {setgray} bind def
+/Gshow {show} def % May be redefined later in the file to support UTF-8
+/vpt2 vpt 2 mul def
+/hpt2 hpt 2 mul def
+/Lshow {currentpoint stroke M 0 vshift R
+ Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def
+/Rshow {currentpoint stroke M dup stringwidth pop neg vshift R
+ Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def
+/Cshow {currentpoint stroke M dup stringwidth pop -2 div vshift R
+ Blacktext {gsave 0 setgray textshow grestore} {textshow} ifelse} def
+/UP {dup vpt_ mul /vpt exch def hpt_ mul /hpt exch def
+ /hpt2 hpt 2 mul def /vpt2 vpt 2 mul def} def
+/DL {Color {setrgbcolor Solid {pop []} if 0 setdash}
+ {pop pop pop 0 setgray Solid {pop []} if 0 setdash} ifelse} def
+/BL {stroke userlinewidth 2 mul setlinewidth
+ Rounded {1 setlinejoin 1 setlinecap} if} def
+/AL {stroke userlinewidth 2 div setlinewidth
+ Rounded {1 setlinejoin 1 setlinecap} if} def
+/UL {dup gnulinewidth mul /userlinewidth exch def
+ dup 1 lt {pop 1} if 10 mul /udl exch def} def
+/PL {stroke userlinewidth setlinewidth
+ Rounded {1 setlinejoin 1 setlinecap} if} def
+3.8 setmiterlimit
+% Classic Line colors (version 5.0)
+/LCw {1 1 1} def
+/LCb {0 0 0} def
+/LCa {0 0 0} def
+/LC0 {1 0 0} def
+/LC1 {0 1 0} def
+/LC2 {0 0 1} def
+/LC3 {1 0 1} def
+/LC4 {0 1 1} def
+/LC5 {1 1 0} def
+/LC6 {0 0 0} def
+/LC7 {1 0.3 0} def
+/LC8 {0.5 0.5 0.5} def
+% Default dash patterns (version 5.0)
+/LTB {BL [] LCb DL} def
+/LTw {PL [] 1 setgray} def
+/LTb {PL [] LCb DL} def
+/LTa {AL [1 udl mul 2 udl mul] 0 setdash LCa setrgbcolor} def
+/LT0 {PL [] LC0 DL} def
+/LT1 {PL [2 dl1 3 dl2] LC1 DL} def
+/LT2 {PL [1 dl1 1.5 dl2] LC2 DL} def
+/LT3 {PL [6 dl1 2 dl2 1 dl1 2 dl2] LC3 DL} def
+/LT4 {PL [1 dl1 2 dl2 6 dl1 2 dl2 1 dl1 2 dl2] LC4 DL} def
+/LT5 {PL [4 dl1 2 dl2] LC5 DL} def
+/LT6 {PL [1.5 dl1 1.5 dl2 1.5 dl1 1.5 dl2 1.5 dl1 6 dl2] LC6 DL} def
+/LT7 {PL [3 dl1 3 dl2 1 dl1 3 dl2] LC7 DL} def
+/LT8 {PL [2 dl1 2 dl2 2 dl1 6 dl2] LC8 DL} def
+/SL {[] 0 setdash} def
+/Pnt {stroke [] 0 setdash gsave 1 setlinecap M 0 0 V stroke grestore} def
+/Dia {stroke [] 0 setdash 2 copy vpt add M
+ hpt neg vpt neg V hpt vpt neg V
+ hpt vpt V hpt neg vpt V closepath stroke
+ Pnt} def
+/Pls {stroke [] 0 setdash vpt sub M 0 vpt2 V
+ currentpoint stroke M
+ hpt neg vpt neg R hpt2 0 V stroke
+ } def
+/Box {stroke [] 0 setdash 2 copy exch hpt sub exch vpt add M
+ 0 vpt2 neg V hpt2 0 V 0 vpt2 V
+ hpt2 neg 0 V closepath stroke
+ Pnt} def
+/Crs {stroke [] 0 setdash exch hpt sub exch vpt add M
+ hpt2 vpt2 neg V currentpoint stroke M
+ hpt2 neg 0 R hpt2 vpt2 V stroke} def
+/TriU {stroke [] 0 setdash 2 copy vpt 1.12 mul add M
+ hpt neg vpt -1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt 1.62 mul V closepath stroke
+ Pnt} def
+/Star {2 copy Pls Crs} def
+/BoxF {stroke [] 0 setdash exch hpt sub exch vpt add M
+ 0 vpt2 neg V hpt2 0 V 0 vpt2 V
+ hpt2 neg 0 V closepath fill} def
+/TriUF {stroke [] 0 setdash vpt 1.12 mul add M
+ hpt neg vpt -1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt 1.62 mul V closepath fill} def
+/TriD {stroke [] 0 setdash 2 copy vpt 1.12 mul sub M
+ hpt neg vpt 1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt -1.62 mul V closepath stroke
+ Pnt} def
+/TriDF {stroke [] 0 setdash vpt 1.12 mul sub M
+ hpt neg vpt 1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt -1.62 mul V closepath fill} def
+/DiaF {stroke [] 0 setdash vpt add M
+ hpt neg vpt neg V hpt vpt neg V
+ hpt vpt V hpt neg vpt V closepath fill} def
+/Pent {stroke [] 0 setdash 2 copy gsave
+ translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
+ closepath stroke grestore Pnt} def
+/PentF {stroke [] 0 setdash gsave
+ translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
+ closepath fill grestore} def
+/Circle {stroke [] 0 setdash 2 copy
+ hpt 0 360 arc stroke Pnt} def
+/CircleF {stroke [] 0 setdash hpt 0 360 arc fill} def
+/C0 {BL [] 0 setdash 2 copy moveto vpt 90 450 arc} bind def
+/C1 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 0 90 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C2 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 90 180 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C3 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 0 180 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C4 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 180 270 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C5 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 0 90 arc
+ 2 copy moveto
+ 2 copy vpt 180 270 arc closepath fill
+ vpt 0 360 arc} bind def
+/C6 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 90 270 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C7 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 0 270 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C8 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 270 360 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C9 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 270 450 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C10 {BL [] 0 setdash 2 copy 2 copy moveto vpt 270 360 arc closepath fill
+ 2 copy moveto
+ 2 copy vpt 90 180 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C11 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 0 180 arc closepath fill
+ 2 copy moveto
+ 2 copy vpt 270 360 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C12 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 180 360 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C13 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 0 90 arc closepath fill
+ 2 copy moveto
+ 2 copy vpt 180 360 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/C14 {BL [] 0 setdash 2 copy moveto
+ 2 copy vpt 90 360 arc closepath fill
+ vpt 0 360 arc} bind def
+/C15 {BL [] 0 setdash 2 copy vpt 0 360 arc closepath fill
+ vpt 0 360 arc closepath} bind def
+/Rec {newpath 4 2 roll moveto 1 index 0 rlineto 0 exch rlineto
+ neg 0 rlineto closepath} bind def
+/Square {dup Rec} bind def
+/Bsquare {vpt sub exch vpt sub exch vpt2 Square} bind def
+/S0 {BL [] 0 setdash 2 copy moveto 0 vpt rlineto BL Bsquare} bind def
+/S1 {BL [] 0 setdash 2 copy vpt Square fill Bsquare} bind def
+/S2 {BL [] 0 setdash 2 copy exch vpt sub exch vpt Square fill Bsquare} bind def
+/S3 {BL [] 0 setdash 2 copy exch vpt sub exch vpt2 vpt Rec fill Bsquare} bind def
+/S4 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt Square fill Bsquare} bind def
+/S5 {BL [] 0 setdash 2 copy 2 copy vpt Square fill
+ exch vpt sub exch vpt sub vpt Square fill Bsquare} bind def
+/S6 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill Bsquare} bind def
+/S7 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt vpt2 Rec fill
+ 2 copy vpt Square fill Bsquare} bind def
+/S8 {BL [] 0 setdash 2 copy vpt sub vpt Square fill Bsquare} bind def
+/S9 {BL [] 0 setdash 2 copy vpt sub vpt vpt2 Rec fill Bsquare} bind def
+/S10 {BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt Square fill
+ Bsquare} bind def
+/S11 {BL [] 0 setdash 2 copy vpt sub vpt Square fill 2 copy exch vpt sub exch vpt2 vpt Rec fill
+ Bsquare} bind def
+/S12 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill Bsquare} bind def
+/S13 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill
+ 2 copy vpt Square fill Bsquare} bind def
+/S14 {BL [] 0 setdash 2 copy exch vpt sub exch vpt sub vpt2 vpt Rec fill
+ 2 copy exch vpt sub exch vpt Square fill Bsquare} bind def
+/S15 {BL [] 0 setdash 2 copy Bsquare fill Bsquare} bind def
+/D0 {gsave translate 45 rotate 0 0 S0 stroke grestore} bind def
+/D1 {gsave translate 45 rotate 0 0 S1 stroke grestore} bind def
+/D2 {gsave translate 45 rotate 0 0 S2 stroke grestore} bind def
+/D3 {gsave translate 45 rotate 0 0 S3 stroke grestore} bind def
+/D4 {gsave translate 45 rotate 0 0 S4 stroke grestore} bind def
+/D5 {gsave translate 45 rotate 0 0 S5 stroke grestore} bind def
+/D6 {gsave translate 45 rotate 0 0 S6 stroke grestore} bind def
+/D7 {gsave translate 45 rotate 0 0 S7 stroke grestore} bind def
+/D8 {gsave translate 45 rotate 0 0 S8 stroke grestore} bind def
+/D9 {gsave translate 45 rotate 0 0 S9 stroke grestore} bind def
+/D10 {gsave translate 45 rotate 0 0 S10 stroke grestore} bind def
+/D11 {gsave translate 45 rotate 0 0 S11 stroke grestore} bind def
+/D12 {gsave translate 45 rotate 0 0 S12 stroke grestore} bind def
+/D13 {gsave translate 45 rotate 0 0 S13 stroke grestore} bind def
+/D14 {gsave translate 45 rotate 0 0 S14 stroke grestore} bind def
+/D15 {gsave translate 45 rotate 0 0 S15 stroke grestore} bind def
+/DiaE {stroke [] 0 setdash vpt add M
+ hpt neg vpt neg V hpt vpt neg V
+ hpt vpt V hpt neg vpt V closepath stroke} def
+/BoxE {stroke [] 0 setdash exch hpt sub exch vpt add M
+ 0 vpt2 neg V hpt2 0 V 0 vpt2 V
+ hpt2 neg 0 V closepath stroke} def
+/TriUE {stroke [] 0 setdash vpt 1.12 mul add M
+ hpt neg vpt -1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt 1.62 mul V closepath stroke} def
+/TriDE {stroke [] 0 setdash vpt 1.12 mul sub M
+ hpt neg vpt 1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt -1.62 mul V closepath stroke} def
+/PentE {stroke [] 0 setdash gsave
+ translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
+ closepath stroke grestore} def
+/CircE {stroke [] 0 setdash
+ hpt 0 360 arc stroke} def
+/Opaque {gsave closepath 1 setgray fill grestore 0 setgray closepath} def
+/DiaW {stroke [] 0 setdash vpt add M
+ hpt neg vpt neg V hpt vpt neg V
+ hpt vpt V hpt neg vpt V Opaque stroke} def
+/BoxW {stroke [] 0 setdash exch hpt sub exch vpt add M
+ 0 vpt2 neg V hpt2 0 V 0 vpt2 V
+ hpt2 neg 0 V Opaque stroke} def
+/TriUW {stroke [] 0 setdash vpt 1.12 mul add M
+ hpt neg vpt -1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt 1.62 mul V Opaque stroke} def
+/TriDW {stroke [] 0 setdash vpt 1.12 mul sub M
+ hpt neg vpt 1.62 mul V
+ hpt 2 mul 0 V
+ hpt neg vpt -1.62 mul V Opaque stroke} def
+/PentW {stroke [] 0 setdash gsave
+ translate 0 hpt M 4 {72 rotate 0 hpt L} repeat
+ Opaque stroke grestore} def
+/CircW {stroke [] 0 setdash
+ hpt 0 360 arc Opaque stroke} def
+/BoxFill {gsave Rec 1 setgray fill grestore} def
+/Density {
+ /Fillden exch def
+ currentrgbcolor
+ /ColB exch def /ColG exch def /ColR exch def
+ /ColR ColR Fillden mul Fillden sub 1 add def
+ /ColG ColG Fillden mul Fillden sub 1 add def
+ /ColB ColB Fillden mul Fillden sub 1 add def
+ ColR ColG ColB setrgbcolor} def
+/BoxColFill {gsave Rec PolyFill} def
+/PolyFill {gsave Density fill grestore grestore} def
+/h {rlineto rlineto rlineto gsave closepath fill grestore} bind def
+%
+% PostScript Level 1 Pattern Fill routine for rectangles
+% Usage: x y w h s a XX PatternFill
+% x,y = lower left corner of box to be filled
+% w,h = width and height of box
+% a = angle in degrees between lines and x-axis
+% XX = 0/1 for no/yes cross-hatch
+%
+/PatternFill {gsave /PFa [ 9 2 roll ] def
+ PFa 0 get PFa 2 get 2 div add PFa 1 get PFa 3 get 2 div add translate
+ PFa 2 get -2 div PFa 3 get -2 div PFa 2 get PFa 3 get Rec
+ TransparentPatterns {} {gsave 1 setgray fill grestore} ifelse
+ clip
+ currentlinewidth 0.5 mul setlinewidth
+ /PFs PFa 2 get dup mul PFa 3 get dup mul add sqrt def
+ 0 0 M PFa 5 get rotate PFs -2 div dup translate
+ 0 1 PFs PFa 4 get div 1 add floor cvi
+ {PFa 4 get mul 0 M 0 PFs V} for
+ 0 PFa 6 get ne {
+ 0 1 PFs PFa 4 get div 1 add floor cvi
+ {PFa 4 get mul 0 2 1 roll M PFs 0 V} for
+ } if
+ stroke grestore} def
+%
+/languagelevel where
+ {pop languagelevel} {1} ifelse
+dup 2 lt
+ {/InterpretLevel1 true def
+ /InterpretLevel3 false def}
+ {/InterpretLevel1 Level1 def
+ 2 gt
+ {/InterpretLevel3 Level3 def}
+ {/InterpretLevel3 false def}
+ ifelse }
+ ifelse
+%
+% PostScript level 2 pattern fill definitions
+%
+/Level2PatternFill {
+/Tile8x8 {/PaintType 2 /PatternType 1 /TilingType 1 /BBox [0 0 8 8] /XStep 8 /YStep 8}
+ bind def
+/KeepColor {currentrgbcolor [/Pattern /DeviceRGB] setcolorspace} bind def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop 0 0 M 8 8 L 0 8 M 8 0 L stroke}
+>> matrix makepattern
+/Pat1 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop 0 0 M 8 8 L 0 8 M 8 0 L stroke
+ 0 4 M 4 8 L 8 4 L 4 0 L 0 4 L stroke}
+>> matrix makepattern
+/Pat2 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop 0 0 M 0 8 L
+ 8 8 L 8 0 L 0 0 L fill}
+>> matrix makepattern
+/Pat3 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop -4 8 M 8 -4 L
+ 0 12 M 12 0 L stroke}
+>> matrix makepattern
+/Pat4 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop -4 0 M 8 12 L
+ 0 -4 M 12 8 L stroke}
+>> matrix makepattern
+/Pat5 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop -2 8 M 4 -4 L
+ 0 12 M 8 -4 L 4 12 M 10 0 L stroke}
+>> matrix makepattern
+/Pat6 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop -2 0 M 4 12 L
+ 0 -4 M 8 12 L 4 -4 M 10 8 L stroke}
+>> matrix makepattern
+/Pat7 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop 8 -2 M -4 4 L
+ 12 0 M -4 8 L 12 4 M 0 10 L stroke}
+>> matrix makepattern
+/Pat8 exch def
+<< Tile8x8
+ /PaintProc {0.5 setlinewidth pop 0 -2 M 12 4 L
+ -4 0 M 12 8 L -4 4 M 8 10 L stroke}
+>> matrix makepattern
+/Pat9 exch def
+/Pattern1 {PatternBgnd KeepColor Pat1 setpattern} bind def
+/Pattern2 {PatternBgnd KeepColor Pat2 setpattern} bind def
+/Pattern3 {PatternBgnd KeepColor Pat3 setpattern} bind def
+/Pattern4 {PatternBgnd KeepColor Landscape {Pat5} {Pat4} ifelse setpattern} bind def
+/Pattern5 {PatternBgnd KeepColor Landscape {Pat4} {Pat5} ifelse setpattern} bind def
+/Pattern6 {PatternBgnd KeepColor Landscape {Pat9} {Pat6} ifelse setpattern} bind def
+/Pattern7 {PatternBgnd KeepColor Landscape {Pat8} {Pat7} ifelse setpattern} bind def
+} def
+%
+%
+%End of PostScript Level 2 code
+%
+/PatternBgnd {
+ TransparentPatterns {} {gsave 1 setgray fill grestore} ifelse
+} def
+%
+% Substitute for Level 2 pattern fill codes with
+% grayscale if Level 2 support is not selected.
+%
+/Level1PatternFill {
+/Pattern1 {0.250 Density} bind def
+/Pattern2 {0.500 Density} bind def
+/Pattern3 {0.750 Density} bind def
+/Pattern4 {0.125 Density} bind def
+/Pattern5 {0.375 Density} bind def
+/Pattern6 {0.625 Density} bind def
+/Pattern7 {0.875 Density} bind def
+} def
+%
+% Now test for support of Level 2 code
+%
+Level1 {Level1PatternFill} {Level2PatternFill} ifelse
+%
+/Symbol-Oblique /Symbol findfont [1 0 .167 1 0 0] makefont
+dup length dict begin {1 index /FID eq {pop pop} {def} ifelse} forall
+currentdict end definefont pop
+%
+/MFshow {
+ { dup 5 get 3 ge
+ { 5 get 3 eq {gsave} {grestore} ifelse }
+ {dup dup 0 get findfont exch 1 get scalefont setfont
+ [ currentpoint ] exch dup 2 get 0 exch R dup 5 get 2 ne {dup dup 6
+ get exch 4 get {textshow} {stringwidth pop 0 R} ifelse }if dup 5 get 0 eq
+ {dup 3 get {2 get neg 0 exch R pop} {pop aload pop M} ifelse} {dup 5
+ get 1 eq {dup 2 get exch dup 3 get exch 6 get stringwidth pop -2 div
+ dup 0 R} {dup 6 get stringwidth pop -2 div 0 R 6 get
+ textshow 2 index {aload pop M neg 3 -1 roll neg R pop pop} {pop pop pop
+ pop aload pop M} ifelse }ifelse }ifelse }
+ ifelse }
+ forall} def
+/Gswidth {dup type /stringtype eq {stringwidth} {pop (n) stringwidth} ifelse} def
+/MFwidth {0 exch { dup 5 get 3 ge { 5 get 3 eq { 0 } { pop } ifelse }
+ {dup 3 get{dup dup 0 get findfont exch 1 get scalefont setfont
+ 6 get Gswidth pop add} {pop} ifelse} ifelse} forall} def
+/MLshow { currentpoint stroke M
+ 0 exch R
+ Blacktext {gsave 0 setgray MFshow grestore} {MFshow} ifelse } bind def
+/MRshow { currentpoint stroke M
+ exch dup MFwidth neg 3 -1 roll R
+ Blacktext {gsave 0 setgray MFshow grestore} {MFshow} ifelse } bind def
+/MCshow { currentpoint stroke M
+ exch dup MFwidth -2 div 3 -1 roll R
+ Blacktext {gsave 0 setgray MFshow grestore} {MFshow} ifelse } bind def
+/XYsave { [( ) 1 2 true false 3 ()] } bind def
+/XYrestore { [( ) 1 2 true false 4 ()] } bind def
+Level1 SuppressPDFMark or
+{} {
+/SDict 10 dict def
+systemdict /pdfmark known not {
+ userdict /pdfmark systemdict /cleartomark get put
+} if
+SDict begin [
+ /Title (spec/tmp/sin_wave_plot.eps)
+ /Subject (gnuplot plot)
+ /Creator (gnuplot 5.0 patchlevel 5)
+% /Producer (gnuplot)
+% /Keywords ()
+ /CreationDate (Fri Nov 22 22:30:52 2019)
+ /DOCINFO pdfmark
+end
+} ifelse
+%
+% Support for boxed text - Ethan A Merritt May 2005
+%
+/InitTextBox { userdict /TBy2 3 -1 roll put userdict /TBx2 3 -1 roll put
+ userdict /TBy1 3 -1 roll put userdict /TBx1 3 -1 roll put
+ /Boxing true def } def
+/ExtendTextBox { Boxing
+ { gsave dup false charpath pathbbox
+ dup TBy2 gt {userdict /TBy2 3 -1 roll put} {pop} ifelse
+ dup TBx2 gt {userdict /TBx2 3 -1 roll put} {pop} ifelse
+ dup TBy1 lt {userdict /TBy1 3 -1 roll put} {pop} ifelse
+ dup TBx1 lt {userdict /TBx1 3 -1 roll put} {pop} ifelse
+ grestore } if } def
+/PopTextBox { newpath TBx1 TBxmargin sub TBy1 TBymargin sub M
+ TBx1 TBxmargin sub TBy2 TBymargin add L
+ TBx2 TBxmargin add TBy2 TBymargin add L
+ TBx2 TBxmargin add TBy1 TBymargin sub L closepath } def
+/DrawTextBox { PopTextBox stroke /Boxing false def} def
+/FillTextBox { gsave PopTextBox 1 1 1 setrgbcolor fill grestore /Boxing false def} def
+0 0 0 0 InitTextBox
+/TBxmargin 20 def
+/TBymargin 20 def
+/Boxing false def
+/textshow { ExtendTextBox Gshow } def
+%
+% redundant definitions for compatibility with prologue.ps older than 5.0.2
+/LTB {BL [] LCb DL} def
+/LTb {PL [] LCb DL} def
+end
+%%EndProlog
+%%Page: 1 1
+gnudict begin
+gsave
+doclip
+50 50 translate
+0.050 0.050 scale
+0 setgray
+newpath
+(Helvetica) findfont 140 scalefont setfont
+BackgroundColor 0 lt 3 1 roll 0 lt exch 0 lt or or not {BackgroundColor C 1.000 0 0 7200.00 5040.00 BoxColFill} if
+/Helvetica findfont 140 scalefont setfont
+/vshift -46 def
+1.000 UL
+LTb
+LCb setrgbcolor
+686 448 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 448 M
+[ [(Helvetica) 140.0 0.0 true true 0 (-1)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 865 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 865 M
+[ [(Helvetica) 140.0 0.0 true true 0 (-0.8)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 1282 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 1282 M
+[ [(Helvetica) 140.0 0.0 true true 0 (-0.6)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 1699 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 1699 M
+[ [(Helvetica) 140.0 0.0 true true 0 (-0.4)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 2116 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 2116 M
+[ [(Helvetica) 140.0 0.0 true true 0 (-0.2)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 2534 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 2534 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 0)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 2951 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 2951 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 0.2)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 3368 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 3368 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 0.4)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 3785 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 3785 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 0.6)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 4202 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 4202 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 0.8)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 4619 M
+63 0 V
+6198 0 R
+-63 0 V
+stroke
+602 4619 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 1)]
+] -46.7 MRshow
+1.000 UL
+LTb
+LCb setrgbcolor
+686 448 M
+0 63 V
+0 4108 R
+0 -63 V
+stroke
+686 308 M
+[ [(Helvetica) 140.0 0.0 true true 0 (-10)]
+] -46.7 MCshow
+1.000 UL
+LTb
+LCb setrgbcolor
+2251 448 M
+0 63 V
+0 4108 R
+0 -63 V
+stroke
+2251 308 M
+[ [(Helvetica) 140.0 0.0 true true 0 (-5)]
+] -46.7 MCshow
+1.000 UL
+LTb
+LCb setrgbcolor
+3817 448 M
+0 63 V
+0 4108 R
+0 -63 V
+stroke
+3817 308 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 0)]
+] -46.7 MCshow
+1.000 UL
+LTb
+LCb setrgbcolor
+5382 448 M
+0 63 V
+0 4108 R
+0 -63 V
+stroke
+5382 308 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 5)]
+] -46.7 MCshow
+1.000 UL
+LTb
+LCb setrgbcolor
+6947 448 M
+0 63 V
+0 4108 R
+0 -63 V
+stroke
+6947 308 M
+[ [(Helvetica) 140.0 0.0 true true 0 ( 10)]
+] -46.7 MCshow
+1.000 UL
+LTb
+LCb setrgbcolor
+1.000 UL
+LTB
+LCb setrgbcolor
+686 4619 N
+686 448 L
+6261 0 V
+0 4171 V
+-6261 0 V
+Z stroke
+1.000 UP
+1.000 UL
+LTb
+LCb setrgbcolor
+LCb setrgbcolor
+112 2533 M
+currentpoint gsave translate -270 rotate 0 0 moveto
+[ [(Helvetica) 140.0 0.0 true true 0 (x)]
+] -46.7 MCshow
+grestore
+LTb
+LCb setrgbcolor
+3816 98 M
+[ [(Helvetica) 140.0 0.0 true true 0 (sin\(x\))]
+] -46.7 MCshow
+LTb
+LCb setrgbcolor
+3816 4829 M
+[ [(Helvetica) 140.0 0.0 true true 0 (Sin Wave Example)]
+] -46.7 MCshow
+% Begin plot #1
+4.000 UL
+LTb
+LCb setrgbcolor
+/Helvetica findfont 140 scalefont setfont
+LCb setrgbcolor
+6296 4486 M
+(sin\(x\)) Rshow
+4.000 UL
+LTb
+LCb setrgbcolor
+6380 4486 M
+399 0 V
+686 3668 M
+63 -374 V
+63 -405 V
+64 -420 V
+63 -417 V
+63 -397 V
+63 -362 V
+64 -311 V
+63 -248 V
+63 -175 V
+63 -95 V
+64 -10 V
+63 74 V
+63 156 V
+63 231 V
+64 297 V
+63 350 V
+63 390 V
+63 414 V
+64 420 V
+63 411 V
+63 383 V
+63 341 V
+64 284 V
+63 216 V
+63 140 V
+63 57 V
+64 -28 V
+63 -111 V
+63 -191 V
+63 -262 V
+64 -322 V
+63 -370 V
+63 -403 V
+63 -419 V
+63 -418 V
+64 -400 V
+63 -366 V
+63 -317 V
+63 -255 V
+64 -183 V
+63 -103 V
+63 -19 V
+63 66 V
+64 147 V
+63 224 V
+63 291 V
+63 345 V
+64 387 V
+63 412 V
+63 421 V
+63 412 V
+64 387 V
+63 345 V
+63 291 V
+63 224 V
+64 147 V
+63 66 V
+63 -19 V
+63 -103 V
+64 -183 V
+63 -255 V
+63 -317 V
+63 -366 V
+64 -400 V
+63 -418 V
+63 -419 V
+63 -403 V
+63 -370 V
+64 -322 V
+63 -262 V
+63 -191 V
+63 -111 V
+64 -28 V
+63 57 V
+63 140 V
+63 216 V
+64 284 V
+63 341 V
+63 383 V
+63 411 V
+64 420 V
+63 414 V
+63 390 V
+63 350 V
+64 297 V
+63 231 V
+63 156 V
+63 74 V
+64 -10 V
+63 -95 V
+63 -175 V
+63 -248 V
+64 -311 V
+63 -362 V
+63 -397 V
+63 -417 V
+64 -420 V
+63 -405 V
+63 -374 V
+% End plot #1
+stroke
+2.000 UL
+LTb
+LCb setrgbcolor
+1.000 UL
+LTB
+LCb setrgbcolor
+686 4619 N
+686 448 L
+6261 0 V
+0 4171 V
+-6261 0 V
+Z stroke
+1.000 UP
+1.000 UL
+LTb
+LCb setrgbcolor
+stroke
+grestore
+end
+showpage
+%%Trailer
+%%DocumentFonts: Helvetica
diff --git a/spec/integration/arrtest_spec.rb b/spec/integration/arrtest_spec.rb
new file mode 100644
index 0000000..49485f4
--- /dev/null
+++ b/spec/integration/arrtest_spec.rb
@@ -0,0 +1,42 @@
+describe "Array Plot Example" do
+ let(:file_path) { 'spec/tmp/array_plot.eps' }
+ let(:fixture_path) { 'spec/fixtures/plots/array_plot.eps' }
+
+ let(:file_content) do
+ File.read(file_path).gsub(/CreationDate.*/, "")
+ end
+
+ let(:fixture_content) do
+ File.read(fixture_path).gsub(/CreationDate.*/, "")
+ end
+
+ before do
+ path = file_path
+
+ Gnuplot.open do |gp|
+ Gnuplot::Plot.new( gp ) do |plot|
+ plot.title "Array Plot Example"
+ plot.ylabel "x"
+ plot.xlabel "x^2"
+ plot.term "postscript eps"
+ plot.output path
+
+ x = (0..50).collect(&:to_f)
+ y = x.collect { |v| v**2 }
+
+ plot.data << Gnuplot::DataSet.new( [x, y] ) do |ds|
+ ds.with = "linespoints"
+ ds.notitle
+ end
+ end
+ end
+ end
+
+ after do
+ File.delete(file_path)
+ end
+
+ it "plots expected file" do
+ expect(file_content).to eq(fixture_content)
+ end
+end
diff --git a/spec/integration/histtest_spec.rb b/spec/integration/histtest_spec.rb
new file mode 100644
index 0000000..7301023
--- /dev/null
+++ b/spec/integration/histtest_spec.rb
@@ -0,0 +1,49 @@
+describe "Histogram Plot Example" do
+ let(:file_path) { 'spec/tmp/histogram_plot.eps' }
+ let(:fixture_path) { 'spec/fixtures/plots/histogram_plot.eps' }
+
+ let(:file_content) do
+ File.read(file_path).gsub(/CreationDate.*/, "")
+ end
+
+ let(:fixture_content) do
+ File.read(fixture_path).gsub(/CreationDate.*/, "")
+ end
+
+ before do
+ path = file_path
+ RandomGenerator.seed(0.17)
+
+ collection = (0..500).collect do
+ (RandomGenerator.rand - 0.5)**3
+ end
+
+ Gnuplot.open do |gp|
+ gp << "bin(x, s) = s*int(x/s)\n"
+
+ Gnuplot::Plot.new( gp ) do |plot|
+ plot.title "Histogram"
+ plot.xlabel "x"
+ plot.ylabel "frequency"
+
+ plot.data << Gnuplot::DataSet.new( [collection] ) do |ds|
+ ds.title = "smooth frequency"
+ ds.using = "(bin($1,.01)):(1.)"
+ ds.smooth = "freq"
+ ds.with = "boxes"
+ end
+
+ plot.term "postscript eps"
+ plot.output path
+ end
+ end
+ end
+
+ after do
+ File.delete(file_path)
+ end
+
+ it "plots expected file" do
+ expect(file_content).to eq(fixture_content)
+ end
+end
diff --git a/spec/integration/multtest_spec.rb b/spec/integration/multtest_spec.rb
new file mode 100644
index 0000000..3da4043
--- /dev/null
+++ b/spec/integration/multtest_spec.rb
@@ -0,0 +1,52 @@
+describe "Multtest Plot Example" do
+ let(:file_path) { 'spec/tmp/multtest_plot.eps' }
+ let(:fixture_path) { 'spec/fixtures/plots/multtest_plot.eps' }
+
+ let(:file_content) do
+ File.read(file_path).gsub(/CreationDate.*/, "")
+ end
+
+ let(:fixture_content) do
+ File.read(fixture_path).gsub(/CreationDate.*/, "")
+ end
+
+ before do
+ path = file_path
+
+ Gnuplot.open do |gp|
+ Gnuplot::Plot.new( gp ) do |plot|
+ plot.xrange "[-10:10]"
+ plot.title "Sin Wave Example"
+ plot.ylabel "x"
+ plot.xlabel "sin(x)"
+
+ plot.term "postscript eps"
+ plot.output path
+
+ x = (0..50).collect(&:to_f)
+ y = x.collect { |v| v**2 }
+
+ plot.data = [
+ Gnuplot::DataSet.new( "sin(x)" ) do |ds|
+ ds.with = "lines"
+ ds.title = "String function"
+ ds.linewidth = 4
+ end,
+
+ Gnuplot::DataSet.new( [x, y] ) do |ds|
+ ds.with = "linespoints"
+ ds.title = "Array data"
+ end
+ ]
+ end
+ end
+ end
+
+ after do
+ File.delete(file_path)
+ end
+
+ it "plots expected file" do
+ expect(file_content).to eq(fixture_content)
+ end
+end
diff --git a/spec/integration/sinwave_spec.rb b/spec/integration/sinwave_spec.rb
new file mode 100644
index 0000000..c27e7f5
--- /dev/null
+++ b/spec/integration/sinwave_spec.rb
@@ -0,0 +1,41 @@
+describe "Sin Wave Plot Example" do
+ let(:file_path) { 'spec/tmp/sin_wave_plot.eps' }
+ let(:fixture_path) { 'spec/fixtures/plots/sin_wave_plot.eps' }
+
+ let(:file_content) do
+ File.read(file_path).gsub(/CreationDate.*/, "")
+ end
+
+ let(:fixture_content) do
+ File.read(fixture_path).gsub(/CreationDate.*/, "")
+ end
+
+ before do
+ path = file_path
+
+ Gnuplot.open do |gp|
+ Gnuplot::Plot.new( gp ) do |plot|
+ plot.xrange "[-10:10]"
+ plot.title "Sin Wave Example"
+ plot.ylabel "x"
+ plot.xlabel "sin(x)"
+
+ plot.term "postscript eps"
+ plot.output path
+
+ plot.data << Gnuplot::DataSet.new( "sin(x)" ) do |ds|
+ ds.with = "lines"
+ ds.linewidth = 4
+ end
+ end
+ end
+ end
+
+ after do
+ File.delete(file_path)
+ end
+
+ it "plots expected file" do
+ expect(file_content).to eq(fixture_content)
+ end
+end
diff --git a/spec/lib/ruby_gnuplot/data_set_spec.rb b/spec/lib/ruby_gnuplot/data_set_spec.rb
new file mode 100644
index 0000000..efb96f8
--- /dev/null
+++ b/spec/lib/ruby_gnuplot/data_set_spec.rb
@@ -0,0 +1,89 @@
+require 'spec_helper'
+
+describe Gnuplot::DataSet do
+ subject(:data_set) { described_class.new(data) }
+
+ let(:data) { nil }
+
+ describe '#to_gplot' do
+ context 'when data is an empty array' do
+ let(:data) { [] }
+
+ it do
+ expect(data_set.to_gplot).to eq('')
+ end
+ end
+
+ context 'when data is an array of numbers' do
+ let(:data) { [1, 10.0, 2.3] }
+
+ it 'converts to gplot format' do
+ expect(data_set.to_gplot).to eq("1\n10.0\n2.3")
+ end
+ end
+
+ context 'when data is a matrix of numbers' do
+ let(:data) { [[1, 10.0], [0, 2]] }
+
+ it 'converts to gplot matrix format' do
+ expect(data_set.to_gplot).to eq("1 0\n10.0 2\ne")
+ end
+ end
+
+ context 'when data is a string' do
+ let(:data) { 'x' }
+
+ it do
+ expect(data_set.to_gplot).to be_nil
+ end
+ end
+
+ context 'when data is an instance of Matrix' do
+ xit 'to be implemented'
+ end
+
+ context 'when data is nil' do
+ it do
+ expect(data_set.to_gplot).to be_nil
+ end
+
+ it 'assigns data' do
+ expect(data_set.data).to eq(data)
+ end
+ end
+
+ context 'when setting attributes in a block' do
+ subject(:data_set) do
+ described_class.new do |ds|
+ ds.with = 'lines'
+ ds.using = '1:2'
+ ds.data = [ [0, 1, 2], [1, 2, 5] ]
+ end
+ end
+
+ it 'returns only the data' do
+ expect(data_set.to_gplot)
+ .to eq("0 1\n1 2\n2 5\ne")
+ end
+ end
+ end
+
+ describe '#plot_args' do
+ context 'when setting attributes on initialize block' do
+ subject(:data_set) do
+ described_class.new do |ds|
+ ds.with = 'lines'
+ ds.using = '1:2'
+ ds.data = data
+ end
+ end
+
+ let(:data) { [ [0, 1, 2], [1, 2, 5] ] }
+
+ it 'returns plot attributes' do
+ expect(data_set.plot_args)
+ .to eq("'-' using 1:2 with lines")
+ end
+ end
+ end
+end
diff --git a/spec/lib/ruby_gnuplot/plot/style_spec.rb b/spec/lib/ruby_gnuplot/plot/style_spec.rb
new file mode 100644
index 0000000..b80f845
--- /dev/null
+++ b/spec/lib/ruby_gnuplot/plot/style_spec.rb
@@ -0,0 +1,66 @@
+describe Gnuplot::Plot::Style do
+ subject(:style) { described_class.new }
+
+ let(:index) { style.index }
+
+ describe '#to_s' do
+ context "when nothing has been set" do
+ it 'creates an empty style' do
+ expect(style.to_s).to eq("set style line #{index}")
+ end
+ end
+
+ context 'when setting the stype' do
+ before do
+ style.ls = 1
+ style.lw = 2
+ style.lc = 3
+ style.pt = 4
+ style.ps = 5
+ style.fs = 6
+ end
+
+ it 'creates and indexes the style' do
+ expect(style.to_s).to eq(
+ "set style line #{index} ls 1 lw 2 lc 3 pt 4 ps 5 fs 6"
+ )
+ end
+ end
+
+ context 'when setting the stype on initialize' do
+ subject(:style) do
+ described_class.new do |style|
+ style.ls = 1
+ style.lw = 2
+ style.lc = 3
+ style.pt = 4
+ style.ps = 5
+ style.fs = 6
+ end
+ end
+
+ it 'creates and indexes the style' do
+ expect(style.to_s).to eq(
+ "set style line #{index} ls 1 lw 2 lc 3 pt 4 ps 5 fs 6"
+ )
+ end
+ end
+
+ context 'when setting using the full method name' do
+ before do
+ style.linestyle = 1
+ style.linewidth = 2
+ style.linecolor = 3
+ style.pointtype = 4
+ style.pointsize = 5
+ style.fill = 6
+ end
+
+ it 'creates and indexes the style' do
+ expect(style.to_s).to eq(
+ "set style line #{index} ls 1 lw 2 lc 3 pt 4 ps 5 fs 6"
+ )
+ end
+ end
+ end
+end
diff --git a/spec/lib/ruby_gnuplot/plot_spec.rb b/spec/lib/ruby_gnuplot/plot_spec.rb
new file mode 100644
index 0000000..49e4279
--- /dev/null
+++ b/spec/lib/ruby_gnuplot/plot_spec.rb
@@ -0,0 +1,216 @@
+shared_examples 'quotes value when setting in a plot for' do |field|
+ describe "##{field}" do
+ before do
+ plot.public_send(field, 'text')
+ end
+
+ let(:expected_settings) do
+ [
+ [:set, field.to_s, '"text"'],
+ [:set, field.to_s, '"new text"']
+ ]
+ end
+
+ it 'quotes value when setting it' do
+ expect(plot.to_gplot).to eq("set #{field} \"text\"\n")
+ end
+
+ it 'enquees into settings' do
+ expect { plot.public_send(field, 'new text') }
+ .to change(plot, :settings)
+ .from([[:set, field.to_s, '"text"']])
+ .to(expected_settings)
+ end
+ end
+end
+
+describe Gnuplot::Plot do
+ subject(:plot) { described_class.new }
+
+ describe '#to_gplot' do
+ let(:expected_string) do
+ [
+ 'set title "Array Plot Example"',
+ 'set ylabel "x"',
+ 'set xlabel "x^2"',
+ 'set term postscript eps',
+ 'set output "file.eps"',
+ ''
+ ].join("\n")
+ end
+
+ context 'when nothing has been set' do
+ it "returns an empty string" do
+ expect(plot.to_gplot).to eq('')
+ end
+ end
+
+ context 'when titles and labels have been set' do
+ before do
+ plot.title "Array Plot Example"
+ plot.ylabel "x"
+ plot.xlabel "x^2"
+ plot.term "postscript eps"
+ plot.output "file.eps"
+ end
+
+ it "wraps strings with quotes when needed" do
+ expect(plot.to_gplot).to eq(expected_string)
+ end
+ end
+
+ context 'when variables are set throgh set call' do
+ before do
+ plot.set "title", "Array Plot Example"
+ plot.set "ylabel", "x"
+ plot.set "xlabel", "x^2"
+ plot.set "term", "postscript eps"
+ plot.set "output", "file.eps"
+ end
+
+ it "wraps strings with quotes when needed" do
+ expect(plot.to_gplot).to eq(expected_string)
+ end
+ end
+
+ context "when setting from inside initialization" do
+ subject(:plot) do
+ described_class.new do |p|
+ p.title "Array Plot Example"
+ p.ylabel "x"
+ p.xlabel "x^2"
+ p.term "postscript eps"
+ p.output "file.eps"
+ end
+ end
+
+ it "wraps strings with quotes when needed" do
+ expect(plot.to_gplot).to eq(expected_string)
+ end
+ end
+ end
+
+ it_behaves_like 'quotes value when setting in a plot for', :title
+ it_behaves_like 'quotes value when setting in a plot for', :output
+ it_behaves_like 'quotes value when setting in a plot for', :xlabel
+ it_behaves_like 'quotes value when setting in a plot for', :x2label
+ it_behaves_like 'quotes value when setting in a plot for', :ylabel
+ it_behaves_like 'quotes value when setting in a plot for', :y2label
+ it_behaves_like 'quotes value when setting in a plot for', :clabel
+ it_behaves_like 'quotes value when setting in a plot for', :cblabel
+ it_behaves_like 'quotes value when setting in a plot for', :zlabel
+
+ describe '#unset' do
+ let(:expected_string) do
+ [
+ 'set title "My Title"',
+ 'unset title',
+ ''
+ ].join("\n")
+ end
+
+ before do
+ plot.title 'My Title'
+ end
+
+ it 'changes value in current settings' do
+ expect { plot.unset 'title' }
+ .to change { plot['title'] }
+ .from('"My Title"').to(nil)
+ end
+
+ it 'unsets key on output' do
+ plot.unset 'title'
+ expect(plot.to_gplot).to eq(expected_string)
+ end
+ end
+
+ describe '#[]' do
+ context 'when value was never set' do
+ it { expect(plot['key']).to be_nil }
+ end
+
+ context 'when value was only unset' do
+ before { plot.unset 'title' }
+
+ it { expect(plot['title']).to be_nil }
+ end
+
+ context 'when value was set only once' do
+ before { plot.title "My Title" }
+
+ it "returns the value to be used (quoted when needed)" do
+ expect(plot['title']).to eq('"My Title"')
+ end
+ end
+
+ context 'when value was set twice' do
+ before do
+ plot.title "My Title"
+ plot.title "My New Title"
+ end
+
+ it "returns the last value set" do
+ expect(plot['title']).to eq('"My New Title"')
+ end
+ end
+
+ context 'when value was set then unset' do
+ before do
+ plot.title "My Title"
+ plot.unset "title"
+ end
+
+ it { expect(plot['title']).to be_nil }
+ end
+
+ context 'when value was set, unset and set again' do
+ before do
+ plot.title "My Title"
+ plot.unset "title"
+ plot.title "My New Title"
+ end
+
+ it "returns the last value set" do
+ expect(plot['title']).to eq('"My New Title"')
+ end
+ end
+ end
+
+ describe 'method missing' do
+ it 'delegates to set call' do
+ expect { plot.fake_field('value') }
+ .to change(plot, :settings)
+ .from([])
+ .to([[:set, 'fake_field', 'value']])
+ end
+
+ context 'when field should be quoted' do
+ it 'delegates to set call and quote it' do
+ expect { plot.output('value') }
+ .to change(plot, :settings)
+ .from([])
+ .to([[:set, 'output', '"value"']])
+ end
+ end
+ end
+
+ describe '#style' do
+ subject(:plot) do
+ described_class.new do |p|
+ p.title 'My title'
+ p.style do |style|
+ style.ls = 1
+ end
+ end
+ end
+
+ let(:expected_output) do
+ /^set title "My title"\nset style line \d+ ls 1\n$/
+ end
+
+ it 'adds style to gplot output' do
+ expect(plot.to_gplot).to match(expected_output)
+ end
+ end
+end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
new file mode 100644
index 0000000..e2940fd
--- /dev/null
+++ b/spec/spec_helper.rb
@@ -0,0 +1,109 @@
+# This file was generated by the `rspec --init` command. Conventionally, all
+# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
+# The generated `.rspec` file contains `--require spec_helper` which will cause
+# this file to always be loaded, without a need to explicitly require it in any
+# files.
+#
+# Given that it is always loaded, you are encouraged to keep this file as
+# light-weight as possible. Requiring heavyweight dependencies from this file
+# will add to the boot time of your test suite on EVERY test run, even for an
+# individual file that may not need all of that loaded. Instead, consider making
+# a separate helper file that requires the additional dependencies and performs
+# the additional setup, and require it from the spec files that actually need
+# it.
+#
+# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
+require 'simplecov'
+SimpleCov.start do
+ add_filter '/spec/'
+end
+
+require "gnuplot"
+
+support_files = File.expand_path('spec/support/**/*.rb')
+
+Dir[support_files].sort.each { |file| require file }
+
+RSpec.configure do |config|
+ # rspec-expectations config goes here. You can use an alternate
+ # assertion/expectation library such as wrong or the stdlib/minitest
+ # assertions if you prefer.
+ config.expect_with :rspec do |expectations|
+ # This option will default to `true` in RSpec 4. It makes the `description`
+ # and `failure_message` of custom matchers include text for helper methods
+ # defined using `chain`, e.g.:
+ # be_bigger_than(2).and_smaller_than(4).description
+ # # => "be bigger than 2 and smaller than 4"
+ # ...rather than:
+ # # => "be bigger than 2"
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
+ end
+
+ # rspec-mocks config goes here. You can use an alternate test double
+ # library (such as bogus or mocha) by changing the `mock_with` option here.
+ config.mock_with :rspec do |mocks|
+ # Prevents you from mocking or stubbing a method that does not exist on
+ # a real object. This is generally recommended, and will default to
+ # `true` in RSpec 4.
+ mocks.verify_partial_doubles = true
+ end
+
+ # This option will default to `:apply_to_host_groups` in RSpec 4 (and will
+ # have no way to turn it off -- the option exists only for backwards
+ # compatibility in RSpec 3). It causes shared context metadata to be
+ # inherited by the metadata hash of host groups and examples, rather than
+ # triggering implicit auto-inclusion in groups with matching metadata.
+ config.shared_context_metadata_behavior = :apply_to_host_groups
+
+ # The settings below are suggested to provide a good initial experience
+ # with RSpec, but feel free to customize to your heart's content.
+ # # This allows you to limit a spec run to individual examples or groups
+ # # you care about by tagging them with `:focus` metadata. When nothing
+ # # is tagged with `:focus`, all examples get run. RSpec also provides
+ # # aliases for `it`, `describe`, and `context` that include `:focus`
+ # # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
+ # config.filter_run_when_matching :focus
+ #
+ # # Allows RSpec to persist some state between runs in order to support
+ # # the `--only-failures` and `--next-failure` CLI options. We recommend
+ # # you configure your source control system to ignore this file.
+ # config.example_status_persistence_file_path = "spec/examples.txt"
+ #
+ # # Limits the available syntax to the non-monkey patched syntax that is
+ # # recommended. For more details, see:
+ # # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
+ # # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
+ # # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
+ # config.disable_monkey_patching!
+ #
+ # # This setting enables warnings. It's recommended, but in some cases may
+ # # be too noisy due to issues in dependencies.
+ # config.warnings = true
+ #
+ # # Many RSpec users commonly either run the entire suite or an individual
+ # # file, and it's useful to allow more verbose output when running an
+ # # individual spec file.
+ # if config.files_to_run.one?
+ # # Use the documentation formatter for detailed output,
+ # # unless a formatter has already been configured
+ # # (e.g. via a command-line flag).
+ # config.default_formatter = "doc"
+ # end
+ #
+ # # Print the 10 slowest examples and example groups at the
+ # # end of the spec run, to help surface which specs are running
+ # # particularly slow.
+ # config.profile_examples = 10
+ #
+ # # Run specs in random order to surface order dependencies. If you find an
+ # # order dependency and want to debug it, you can fix the order by providing
+ # # the seed, which is printed after each run.
+ # # --seed 1234
+ # config.order = :random
+ #
+ # # Seed global randomization in this process using the `--seed` CLI option.
+ # # Setting this allows you to use `--seed` to deterministically reproduce
+ # # test failures related to randomization by passing the same `--seed` value
+ # # as the one that triggered the failure.
+ # Kernel.srand config.seed
+end
diff --git a/spec/support/models/random_generator.rb b/spec/support/models/random_generator.rb
new file mode 100644
index 0000000..5ad8062
--- /dev/null
+++ b/spec/support/models/random_generator.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class RandomGenerator
+ KAPA = 3.95578
+
+ class << self
+ def rand
+ @rand ||= Random.rand
+
+ @rand = KAPA * @rand * (1 - @rand)
+ end
+
+ def seed(value)
+ @rand = value.abs % 1
+ @rand = nil if @rand.zero?
+ end
+ end
+end
diff --git a/spec/tmp/.keep b/spec/tmp/.keep
new file mode 100644
index 0000000..e69de29
diff --git a/test/arrtest.rb b/test/arrtest.rb
index 208072c..00a95a3 100644
--- a/test/arrtest.rb
+++ b/test/arrtest.rb
@@ -1,12 +1,12 @@
-require '../lib/gnuplot'
+require 'gnuplot'
Gnuplot.open do |gp|
Gnuplot::Plot.new( gp ) do |plot|
-
+
plot.title "Array Plot Example"
plot.ylabel "x"
plot.xlabel "x^2"
-
+
x = (0..50).collect { |v| v.to_f }
y = x.collect { |v| v ** 2 }
@@ -14,8 +14,8 @@
ds.with = "linespoints"
ds.notitle
end
-
+
end
-
+
end
-
+
diff --git a/test/histtest.rb b/test/histtest.rb
index dd09e24..9207005 100644
--- a/test/histtest.rb
+++ b/test/histtest.rb
@@ -1,20 +1,20 @@
-require '../lib/gnuplot'
+require 'gnuplot'
Gnuplot.open do |gp|
- gp << "bin(x, s) = s*int(x/s)\n"
+ gp << "bin(x, s) = s*int(x/s)\n"
- Gnuplot::Plot.new( gp ) do |plot|
- plot.title "Histogram"
- plot.xlabel "x"
- plot.ylabel "frequency"
+ Gnuplot::Plot.new( gp ) do |plot|
+ plot.title "Histogram"
+ plot.xlabel "x"
+ plot.ylabel "frequency"
- x = (0..500).collect { |v| (rand()-0.5)**3 }
- plot.data << Gnuplot::DataSet.new( [x] ) do |ds|
- ds.title = "smooth frequency"
- ds.using = "(bin($1,.01)):(1.)"
- ds.smooth = "freq"
- ds.with = "boxes"
- end
+ x = (0..500).collect { |v| (rand()-0.5)**3 }
+ plot.data << Gnuplot::DataSet.new( [x] ) do |ds|
+ ds.title = "smooth frequency"
+ ds.using = "(bin($1,.01)):(1.)"
+ ds.smooth = "freq"
+ ds.with = "boxes"
end
+ end
end
diff --git a/test/multtest.rb b/test/multtest.rb
index 1aeb1d5..dcd06c1 100644
--- a/test/multtest.rb
+++ b/test/multtest.rb
@@ -1,31 +1,31 @@
-require '../lib/gnuplot'
+require 'gnuplot'
# File.open( "gnuplot.dat", "w") do |gp|
Gnuplot.open do |gp|
Gnuplot::Plot.new( gp ) do |plot|
-
+
plot.xrange "[-10:10]"
plot.title "Sin Wave Example"
plot.ylabel "x"
plot.xlabel "sin(x)"
-
+
x = (0..50).collect { |v| v.to_f }
y = x.collect { |v| v ** 2 }
plot.data = [
Gnuplot::DataSet.new( "sin(x)" ) { |ds|
- ds.with = "lines"
- ds.title = "String function"
- ds.linewidth = 4
+ ds.with = "lines"
+ ds.title = "String function"
+ ds.linewidth = 4
},
-
+
Gnuplot::DataSet.new( [x, y] ) { |ds|
- ds.with = "linespoints"
- ds.title = "Array data"
+ ds.with = "linespoints"
+ ds.title = "Array data"
}
]
end
-
+
end
-
+
diff --git a/test/sinwave.rb b/test/sinwave.rb
index f7e7131..78db32e 100644
--- a/test/sinwave.rb
+++ b/test/sinwave.rb
@@ -1,19 +1,19 @@
-require '../lib/gnuplot'
+require 'gnuplot'
Gnuplot.open do |gp|
Gnuplot::Plot.new( gp ) do |plot|
-
+
plot.xrange "[-10:10]"
plot.title "Sin Wave Example"
plot.ylabel "x"
plot.xlabel "sin(x)"
-
+
plot.data << Gnuplot::DataSet.new( "sin(x)" ) do |ds|
ds.with = "lines"
ds.linewidth = 4
end
-
+
end
-
+
end
-
+
diff --git a/test/test_gnuplot.rb b/test/test_gnuplot.rb
index 18d8e34..19b7625 100644
--- a/test/test_gnuplot.rb
+++ b/test/test_gnuplot.rb
@@ -1,9 +1,9 @@
# -*- ruby -*-
-require '../lib/gnuplot'
-require 'test/unit'
+require 'gnuplot'
+require 'minitest/autorun'
-class StdDataTest < Test::Unit::TestCase
+class StdDataTest < MiniTest::Test
def test_array_1d
data = (0..5).to_a
@@ -38,7 +38,7 @@ def test_array_nd
end
-class DataSetTest < Test::Unit::TestCase
+class DataSetTest < MiniTest::Test
def test_yield_ctor
ds = Gnuplot::DataSet.new do |ds|
@@ -58,7 +58,7 @@ def test_yield_ctor
end
-class PlotTest < Test::Unit::TestCase
+class PlotTest < MiniTest::Test
def test_no_data
plot = Gnuplot::Plot.new do |p|
@@ -130,7 +130,7 @@ def test_style
require 'rbconfig'
-CONFIG = Config::MAKEFILE_CONFIG
+CONFIG = RbConfig::MAKEFILE_CONFIG
# This attempts to test the functions that comprise the gnuplot package. Most
# of the bug reports that I get for this package have to do with finding the