Skip to content

Is the reset of the colorbar's edgecolor when updating the corresponding image clim wanted behaviour? #15980

Closed
@mapfiable

Description

@mapfiable

Bug report

Bug summary

When updating the the clim of an image, the edgecolor of the colorbar is reset. This is however not the case with the ticks or label color which seems inconsistent.

Code for reproduction

import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import numpy as np

fig, ax = plt.subplots()
im = ax.imshow(np.arange(100).reshape((10, 10)))

divider = make_axes_locatable(ax)
cax = divider.append_axes("right", size="5%", pad=0.05)

colorbar = fig.colorbar(im, cax=cax)
colorbar.ax.tick_params(axis='both', colors='red')
colorbar.set_label('label')
colorbar.ax.yaxis.label.set_color('red')
colorbar.outline.set_edgecolor('red')

im.set_clim((0, 10))

plt.show()

Expected outcome

No reset of the edgecolor.

Matplotlib version

  • Operating system: Windows 10 64bit
  • Matplotlib version: 3.1.1 (via anaconda default installation)
  • Matplotlib backend: Qt5Agg
  • Python version: Python 3.7.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions