Method: GnuplotRB::Plottable#option_name

Defined in:
lib/gnuplotrb/mixins/plottable.rb

#option_name(value = nil) ⇒ Object

Clone existing object and set new options value in created one or just return existing value if nil given.

Method is handled by #method_missing.

You may set options using #option_name(option_value) method. A new object will be constructed with selected option set. And finally you can get current value of any option using #options_name without arguments.

Available options are listed in Plot, Splot, Multiplot etc class top level doc.

Examples:

plot = Splot.new
new_plot = plot.title('Awesome plot')
plot.title #=> nil
new_plot.title #=> 'Awesome plot'

Parameters:

  • value (defaults to: nil)

    new value for option

Returns:

  • new object with option_name set to value if value given

  • old option value if no value given



# File 'lib/gnuplotrb/mixins/plottable.rb', line 127