Skip to content

Export a plot's or a page's data as CSV from the GUI #19

Open

Description

@jtravs

What is missing

The GUI can save any plot or page as a figure, but not the numbers behind it. Analyse's pages offer Export ▾ → Figure… and Pop out (ResultPage), and every plot's right-click menu offers a figure or an image (ViewPanel.show_menu). To replot a curve in another tool, a user has to save the session and read result.h5 in Python.

Why it matters

Collaborators often want the retrieved pulse, spectrum or marginals as columns for their own plotting or for a paper's data file. The redesign's plan listed "Data as CSV…" beside "Figure…" on Export ▾, and it was left out to keep #16 reviewable.

Context

Checked against 5140b0f; read, not run.

To do

  • Needs a decision (maintainers): write what is drawn (the view as shown, so a CSV matches its plot, display axis included) or the physical arrays (in SI units, unnormalised)? Recommendation: the view as shown, with the units in the column headers, because that is what "the data of this plot" means to a user, and say so in the manual. A map is written as a long table (x, y, value).
  • A pure function that turns a LineView or MapView into a table (header row with units, then columns), in croak.plotting, with tests and an example.
  • "Save data as CSV…" in each plot's right-click menu, and "Data as CSV…" on Export ▾ for a page (one file per plot in a chosen folder, named from the plot titles).
  • Document it in the GUI how-to, under Figures for publication.

Done when

A plot's CSV, read back with numpy.loadtxt, reproduces its curves (or image) to float precision, tested for a line view with a right axis, a map, and a view on the other spectral axis; the manual says what is written.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions