new_plot()
should not mutate existing EasyPlot instance. Instead, create duplicate EasyPlot object
#4
Labels
new_plot()
should not mutate existing EasyPlot instance. Instead, create duplicate EasyPlot object
#4
In EasyPlot 1.0.0, the
new_plot()
instance method mutates theEasyPlot
instance on which it is called to create a new plot while retaining plot parameters that were previously set on theEasyPlot
instance.This behavior is not ideal as it forces the user to give up access to an existing
EasyPlot
object/figure in order to reuse it as a template for another plot. The correct behavior would be fornew_plot()
to return a newEasyPlot
instance that is a duplicate of theEasyPlot
instance on whichnew_plot()
is being called. See the code snippet below as an example:This WILL BREAK backwards compatibility
Alternate option would be to introduce a new instance method, eg:
copy_plot()
that produces the behavior mentioned above while retaining the current behaviour of thenew_plot()
method.The text was updated successfully, but these errors were encountered: