Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d58647b

Browse files
tacaswellQuLogic
andauthored
DOC: fix formatting and typos
Co-authored-by: Elliott Sales de Andrade <[email protected]>
1 parent 3b4b88e commit d58647b

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

lib/mpl_toolkits/mplot3d/art3d.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -642,8 +642,8 @@ def do_3d_projection(self, renderer=None):
642642

643643

644644
def _update_scalarmappable(sm):
645-
646-
"""Update a 3D ScalarMappable.
645+
"""
646+
Update a 3D ScalarMappable.
647647
648648
With ScalarMappable objects if the data, colormap, or norm are
649649
changed, we need to update the computed colors. This is handled
@@ -657,40 +657,40 @@ def _update_scalarmappable(sm):
657657
handled in the ``do_3d_projection`` methods which are called from the
658658
draw method of the 3D Axes. These methods:
659659
660-
- do the projection from 3D -> 2D
661-
- internally sort based on depth
662-
- stash the results of the above in the 2D analogs of state
663-
- return the z-depth of the whole artist
660+
- do the projection from 3D -> 2D
661+
- internally sort based on depth
662+
- stash the results of the above in the 2D analogs of state
663+
- return the z-depth of the whole artist
664664
665665
the last step is so that we can, at the Axes level, sort the children by
666666
depth.
667667
668-
The base `draw` method of the 2D artists unconditionally call
668+
The base `draw` method of the 2D artists unconditionally calls
669669
update_scalarmappable and rely on the method's internal caching logic to
670670
lazily evaluate.
671671
672672
These things together mean you can have the sequence of events:
673673
674-
- we create the artist, to the color mapping and stash the results in a 3D
674+
- we create the artist, do the color mapping and stash the results in a 3D
675675
specific state.
676676
- change something about the ScalarMappable that marks it as in need of an
677677
update (`ScalarMappable.changed` and friends).
678678
- We call do_3d_projection and shuffle the stashed colors into the 2D version
679679
of face colors
680680
- the draw method calls the update_scalarmappable method which overwrites our
681681
shuffled colors
682-
- we get a render this is wrong
682+
- we get a render that is wrong
683683
- if we re-render (either with a second save or implicitly via
684-
tight_layout / constairned_layout / bbox_inches='tight' (ex via
684+
tight_layout / constrained_layout / bbox_inches='tight' (ex via
685685
inline's defaults)) we again shuffle the 3D colors
686686
- because the CM is not marked as changed update_scalarmappable is a no-op and
687687
we get a correct looking render.
688688
689689
This function is an internal helper to:
690690
691-
- sort out if we need to do the color mapping at all (has data!)
692-
- sort out if update_scalarmappable is going to be a no-op
693-
- copy the data over from the 2D -> 3D version
691+
- sort out if we need to do the color mapping at all (has data!)
692+
- sort out if update_scalarmappable is going to be a no-op
693+
- copy the data over from the 2D -> 3D version
694694
695695
This must be called first thing in do_3d_projection to make sure that
696696
the correct colors get shuffled.

lib/mpl_toolkits/tests/test_mplot3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,7 @@ def test_scalarmap_update(fig_test, fig_ref):
13181318
sc_test = ax_test.scatter(x, y, z, c=c, s=40, cmap='viridis')
13191319
# force a draw
13201320
fig_test.canvas.draw()
1321-
# make it as "stale"
1321+
# mark it as "stale"
13221322
sc_test.changed()
13231323

13241324
# ref

0 commit comments

Comments
 (0)