GR.rb icon indicating copy to clipboard operation
GR.rb copied to clipboard

How should Plot preserve the previous configuration?

Open kojix2 opened this issue 5 years ago • 1 comments

  • 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

kojix2 avatar Apr 06 '20 12:04 kojix2

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

kojix2 avatar Apr 23 '20 04:04 kojix2