Skip to content

Fix plotting-related warnings

David Hammer requested to merge fix/matplotlib-deprecation-warning into master

Description

There were deprecation warnings popping up in the darks notebooks, caused by cal_tools.plotting.show_overview. I don't like warnings, so I changed the rcParams and updated the colorbar instantiation as some matplotlib documentation indicated.

Also, the logic handling label colors and colorbar labels for each subplots was a bit buggy, so I fixed that.

How Has This Been Tested?

In the AGIPD darks notebook, I inserted the updated function definition and re-ran the cell. It looked fine. I also shuffled around the order to ensure that the labels get colored appropriately.

Old plot:

image

  • Note the wrong label on the bad pixels colorbar
  • Label on bad pixels subplot is white and so invisible (hopefully, otherwise we have many bad pixels)
  • Weird logarithm of bad pixel codes - probably because NaN is plotted as white which gives good contrast?

New plot:

image

  • Labels fixed
  • Still has weird logarithm on bad pixel codes

New new plot:

image

  • Now bad pixel plot is just white 0 for "good", black 1 for "bad" instead of weird logarithm

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the code style of this project.
  • I have not added tests where appropriate :(

Reviewers

@calibration

If no complaints come up, will merge later today.

Edited by David Hammer

Merge request reports