Skip to content

Siril plot

cec m requested to merge siril_plot into master

This MR adds a new plotting feature to be used as a fallback for gnuplot, called siril_plot. It allows to plot lines plot or xyerr plots, either to a png file or to a gtk window created on the spot.

All the internals + saving png are in io/siril_plot.c and io/siril_plot.h. The Gtk part, window creation +associated callbacks, are in gui/siril_plot.c and gui/siril_plot.h.

TODO:

  • add labels
  • add xyerr plotting for light curves
  • check consistency with light_curves produced with gnuplot (labels, titles etc...)
  • add a flag to show (or not) legend
  • rewrite some kplot to avoid statics (format and getters)
  • add a flag to revert x and/or y axis and implement in kplot
  • add displaying the cursor position when inside the plot
  • add a pref to force using gnuplot (default is to use siril plot)

This aims at being simple (i.e. non interactive, except for cursor position) at first. Plot interactivity, through more callbacks (save current view to png, grid on/off, zooming), will be added in a future MR, where the current window will be made a GtkApplicationWindow (maybe).

Features added to kplot:

  • added KPLOT_HYPHENS and KPLOT_LINESHYPHENS in kplottype enum (useful mainly for error bars)
  • added xaxisrevert and yaxisrevert in the kplotcfg structure to revert x and/or y axes
  • added xticlabelfmtstr and xticlabelfmtstr to pass a format string instead of pointer to a function whose prototype did not allow to pass format.
  • removed all the statics that were required to get the properties of the plot area in cairo context. A new variable kplotctx *ctx_out is passed.If not NULL, it is filled with the structure created during the call. offs and dims can then be retrieved.
Edited by cec m

Merge request reports