[MRG+1] Simplify and clean multicolor_line example #8173

Merged
merged 5 commits into from Mar 8, 2017

Conversation

Projects
None yet
4 participants
Contributor

dstansby commented Feb 28, 2017

I've taken the number of figures down to 1, which I think makes the whole example more understandable. Also a general clean and move of the example to the correct folder.

dstansby added some commits Feb 28, 2017

@dstansby dstansby Simplify multicolored_line example 6f4d1cd
@dstansby dstansby Move multicolored_line example 260702f
@dstansby dstansby Small fixes
da8e50c
-# Create a colormap for red, green and blue and a norm to color
-# f' < -0.5 red, f' > 0.5 blue, and the rest green
-cmap = ListedColormap(['r', 'g', 'b'])
-norm = BoundaryNorm([-1, -0.5, 0.5, 1], cmap.N)
@tacaswell

tacaswell Feb 28, 2017

Owner

It is a shame to loose the boundary norm example here. Maybe do two axes, one with continuous, one with boundary norm?

@dstansby

dstansby Feb 28, 2017

Contributor

👍 That shouldn't be too hard to add back in

@dstansby dstansby Put boundarynorm example back in
9e85244
Contributor

dstansby commented Mar 2, 2017

figure_1

+# Create a set of line segments so that we can color them individually
+# This creates the points as a N x 1 x 2 array so that we can stack points
+# together easily to get the segments. The segments array for line collection
+# needs to be numlines x points per line x 2 (x and y)
@anntzer

anntzer Mar 5, 2017

Contributor

(number of lines) x (points per line) x 2, perhaps.

@dstansby dstansby Clarify segment array shape
721c6a1
@anntzer

anntzer approved these changes Mar 7, 2017

anntzer changed the title from Simplify and clean multicolor_line example to [MRG+1] Simplify and clean multicolor_line example Mar 7, 2017

@NelleV NelleV merged commit f73645a into matplotlib:master Mar 8, 2017

1 of 2 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Contributor

NelleV commented Mar 8, 2017

Thanks @dstansby ! This looks great!

dstansby deleted the dstansby:mutlicolor-line branch Apr 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment