8000 DOC: Add example to CenteredNorm behavior change · matplotlib/matplotlib@94dc568 · GitHub
[go: up one dir, main page]

Skip to content
Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 94dc568

Browse files
committed
DOC: Add example to CenteredNorm behavior change
1 parent f259067 commit 94dc568

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed
Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,29 @@
11
``CenteredNorm`` halfrange is not modified when vcenter changes
22
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33

4-
Previously, the halfrange would expand in proportion to the
5-
amount that vcenter was moved away from either vmin or vmax. Now,
6-
the halfrange will not be updated when vcenter is changed. If the
7-
halfrange also needs to be updated, one can set the halfrange
8-
manually or call autoscale() after setting vcenter.
4+
Previously, the **halfrange** would expand in proportion to the
5+
amount that **vcenter** was moved away from either **vmin** or **vmax**.
6+
Now, the halfrange remains fixed when vcenter is changed, and **vmin** and
7+
**vmax** are updated based on the **vcenter** and **halfrange** values.
8+
9+
For example, this is what the values were when changing vcenter previously.
10+
11+
.. code-block::
12+
13+
norm = CenteredNorm(vcenter=0, halfrange=1)
14+
# Move vcenter up by one
15+
norm.vcenter = 1
16+
# updates halfrange and vmax (vmin stays the same)
17+
# norm.halfrange == 2, vmin == -1, vmax == 3
18+
19+
and now, with that same example
20+
21+
.. code-block::
22+
23+
norm = CenteredNorm(vcenter=0, halfrange=1)
24+
norm.vcenter = 1
25+
# updates vmin and vmax (halfrange stays the same)
26+
# norm.halfrange == 1, vmin == 0, vmax == 2
27+
28+
The **halfrange** can be set manually or ``norm.autoscale()``
29+
can be used to autmatically set the limits after setting **vcenter**.

0 commit comments

Comments
 (0)
0