Skip to content

Commit abd1aa6

Browse files
committed
ENH: Make colorbar axes more typical
1 parent 862efc1 commit abd1aa6

35 files changed

+1238
-1852
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Axes used to make colorbar now wrapped
2+
======================================
3+
4+
The axes used to place a colorbar is now wrapped by a new parent class
5+
(``ColorbarAxes``). This affects calls like::
6+
7+
cb = fig.colorbar(im, cax=cax)
8+
cax.tick_params()
9+
10+
so that this will no longer affect the visible axes ticks. Rather call
11+
methods on the axes stored on the colorbar object::
12+
13+
cb = fig.colorbar(im, cax=cax)
14+
cb.ax.tick_params()
15+
16+
If necessary, the original axes can be accessed via::
17+
18+
assert cb.ax.parent_axes == cax
19+
20+
This change means that the parent axes (``cb.ax.parent_axes``) handles the
21+
placement of the colorbar axes object, and its aspect ratio, but the child
22+
axes (``cb.ax``) handles all the tick parameters, labelling, and holds the
23+
artists that make up the colorbar.
24+
25+
Colorbar lines no longer clipped
26+
================================
27+
28+
If a colorbar has lines added to it (e.g. for contour lines), these will
29+
no longer be clipped. This is an improvement for lines on the edge of
30+
the colorbar, but could lead to lines off the colorbar if the limits of
31+
the colorbar are changed.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy