¡@

Home 

python Programming Glossary: linecollection

Matplotlib: How to colorize a large number of line segments as independent gradients, efficiently

http://stackoverflow.com/questions/13622909/matplotlib-how-to-colorize-a-large-number-of-line-segments-as-independent-gradi

as plt from matplotlib.collections import LineCollection # Make random number generation consistent between runs np.random.seed.. to the line segments color_scalar interp line num 20 coll LineCollection segments coll.set_array color_scalar ax.add_collection coll.. as plt from matplotlib.collections import LineCollection # Make random number generation consistent between runs np.random.seed..

python: how to plot one line in different colors

http://stackoverflow.com/questions/17240694/python-how-to-plot-one-line-in-different-colors

this will be terribly slow to draw. In that case use a LineCollection . E.g. import numpy as np import matplotlib.pyplot as plt from.. as plt from matplotlib.collections import LineCollection xy np.random.random 1000 2 0.5 .cumsum axis 0 # Reshape things.. 1 2 segments np.hstack xy 1 xy 1 fig ax plt.subplots coll LineCollection segments cmap plt.cm.gist_ncar coll.set_array np.random.random..

matplotlib change linewidth on line segments, using list

http://stackoverflow.com/questions/19862011/matplotlib-change-linewidth-on-line-segments-using-list

this question Basically you have two options. Use a LineCollection . In this case your line widths will be in points and the line.. as plt from matplotlib.collections import LineCollection np.random.seed 1977 x np.arange 10 y np.cos x np.pi width 20.. start end for start end in zip coords 1 coords 1 lines LineCollection lines linewidths width fig ax plt.subplots ax.add_collection..

Set line colors according to colormap

http://stackoverflow.com/questions/19868548/set-line-colors-according-to-colormap

share improve this question It's easiest to use a LineCollection for this. In fact it expects the lines to be in a similar format.. as plt from matplotlib.collections import LineCollection # The line format you curently have lines 0 1 2 3 4 4 5 6 7.. 2 3 4 8 7 6 5 4 4 5 6 7 8 0 1 2 3 4 # Reformat it to what `LineCollection` expects lines zip x y for x y in lines z np.array 0.1 9.4 3.8..

Matplotlib autoscale

http://stackoverflow.com/questions/3214576/matplotlib-autoscale

as plt from matplotlib.collections import LineCollection .... lines LineCollection mpl.line_holder colors mpl.colorholder.. matplotlib.collections import LineCollection .... lines LineCollection mpl.line_holder colors mpl.colorholder linestyle 'solid' plt.axes.. as plt from matplotlib.collections import LineCollection import pylab as p fig plt.figure pts1 pts2 for i in range 100..

Django static Files

http://stackoverflow.com/questions/9824359/django-static-files