glue icon indicating copy to clipboard operation
glue copied to clipboard

Export color settings in matplotlib viewers

Open Carifio24 opened this issue 2 years ago • 0 comments

Currently, the matplotlib viewers do not take into account glue's global color settings (foreground and background colors) when exporting to a Python script. This means that the exported figure will not match if the color settings differ from the default.

This PR updates the export script to take those color settings into account. The code added to the script header is partially taken from update_foreground_color and update_background_color. I've also added a test that changes the color settings, compares the exports, and resets the color settings to the default. I've placed this test in BaseTestExportPython since it's identical for each matplotlib viewer.

Also, in the course of making this update, I fixed a bug here where the wrong tick label size is used.

Carifio24 avatar Sep 15 '22 17:09 Carifio24