Skip to content

Split data from fitting plots #1299

@alecandido

Description

@alecandido

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

  1. one function defines which are the figures and subplots, deciding the kinds of plots (2D, 3D, spider, ...), and returning them (no content)
  2. then a function plots data on them
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    executionuiNon-functional features, affecting user interaction

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions