napari-matplotlib icon indicating copy to clipboard operation
napari-matplotlib copied to clipboard

Saving a figure as image has some style issues

Open Chris-N-K opened this issue 1 year ago • 1 comments

When saving a figure as image while using the dark theme the style poses some problems. The axe ticks and labels remain coloured light grey as stated by the style sheet, but this makes them nearly invisible in the saved image.

I would suggest to either use a non-transparent facecolor (napari theme background) or add specific colouring for savefig to the style sheet: figure.facecolor : 262930 or savefig.facecolor : 262930

Another solution would be to change the colours for the axes, ticks and labels for saving, but as far as I know this can't be achieved through matplotlib without changing the colours of the displayed figure as well.

Chris-N-K avatar Nov 28 '23 10:11 Chris-N-K

A small update for this issue. The changes introduced in 2.0.0 change the way to implement a solution slightly different. At the moment the background needs to be transparent as a coloured background introduces some issues (no background updates upon redraw). Therefore, constant colouring for savefig could be added to the style_sheet_from_theme utility function for now.

Chris-N-K avatar Jan 25 '24 14:01 Chris-N-K