Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
[MRG+1] Simplify and clean multicolor_line example #8173
Conversation
dstansby
added the
Documentation
label
Feb 28, 2017
| -# 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
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?
| +# 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
changed the title from
Simplify and clean multicolor_line example to [MRG+1] Simplify and clean multicolor_line example
Mar 7, 2017
NelleV
merged commit f73645a
into matplotlib:master
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

dstansby commentedFeb 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.