-
Notifications
You must be signed in to change notification settings - Fork 6
Description
We need to be able to show data even when there is no fit.
Possibly, it would be nice to also be able to update existing plots using fits, when they become available.
There are two possible approaches.
Modular functions
We could split the problem in three
- one function defines which are the figures and subplots, deciding the kinds of plots (2D, 3D, spider, ...), and returning them (no content)
- then a function plots data on them
- and another plots fits on them
Great approach, if it's actually possible to plot on figures created at a former time.
Fallback
If not, we could make just two functions: one plotting only data, the other one doing both. They could even be implemented by the same underlying function, with a boolean toggle. But it is important to have two distinct entry points, with different inputs.
E.g.
def myplots(..., fit: bool = False):
...
def plotdata(data: Data):
myplots(data)
def plotfit(data: Data, results: Results):
myplots(data, results, fit=True)or something like this.
Note
In principle, we could even allow for both approaches, if the first is only possible in certain situations.
Then, we will prefer one, and fall back on the other if the favorite choice is not available.