GR.rb
GR.rb copied to clipboard
How should Plot preserve the previous configuration?
- A new instance of GR::Plot is created each time. Previous settings are not obtained. You have to manage it yourself.
- A new instance of GR::Plot is created each time. It refers to the previous settings.
- A new instance of GR::Plot is created. One instance is used repeatedly. Multiple instances may exist at the same time.
- A new instance of GR::Plot is created. One instance is used repeatedly. It is desirable to have only one instance.
- There is an instance that holds the settings out of the Plot instance itself.
- Stop adding class methods to the GR module and make Plot more object-oriented.
- Choose the wrong way to maintain state in the module for some benefit
- None of the above
So far, I select the first approach for subplot or hold method.
- Settings are not obtained. You have to manage it yourself.
The reason is as follows.
- This approach is easy (for me) to implement.
- You can fine-tune the layout of the figure because you get the actual values.
See https://github.com/red-data-tools/GR.rb/blob/master/examples/fast_multiplot.rb