The objective of this proposal is being able to redraw the plot without changing axis labels etc.
There are several ways of adding this feature, the one used in matplotlib is using an instance of a class, but as first draft I developed a simple generator that is able to do the same:
from uniplot import plot_gen
plot_g = plot_gen(
**{
"lines": [True, True],
"width": 180,
"x_unit": "$",
"y_unit": "$",
"color": ["green", "red"],
}
)
next(plot_g)
args = {}
plot_g.send(([1,2,3], [4,3,2], args)) # pass only data that changes.
# the plot is plotted
plot_g.send(([1,2,3], [2,3,2], args))
# the plot is modified
With this structure we avoid creating a class for the plot, though it may be desirable to do so, I could also make a draft of that if you like it more.
The objective of this proposal is being able to redraw the plot without changing axis labels etc.
There are several ways of adding this feature, the one used in matplotlib is using an instance of a class, but as first draft I developed a simple generator that is able to do the same:
https://github.com/PabloRuizCuevas/uniplot/blob/master/uniplot/uniplot.py
With this structure we avoid creating a class for the plot, though it may be desirable to do so, I could also make a draft of that if you like it more.