### We're updating the default styles for Matplotlib 2.0

Learn what to expect in the new updates #### Previous topic

pylab_examples example code: legend_demo4.py

#### Next topic

pylab_examples example code: line_collection2.py

# pylab_examples example code: line_collection.py¶ ```import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection
from matplotlib.colors import colorConverter

import numpy as np

# In order to efficiently plot many lines in a single set of axes,
# Matplotlib has the ability to add the lines all at once. Here is a
# simple example showing how it is done.

x = np.arange(100)
# Here are many sets of y to plot vs x
ys = x[:50, np.newaxis] + x[np.newaxis, :]

segs = np.zeros((50, 100, 2), float)
segs[:,:,1] = ys
segs[:,:,0] = x

segs = np.ma.masked_where((segs > 50) & (segs < 60), segs)

# We need to set the plot limits.
ax = plt.axes()
ax.set_xlim(x.min(), x.max())
ax.set_ylim(ys.min(), ys.max())

# colors is sequence of rgba tuples
# linestyle is a string or dash tuple. Legal string values are
#          solid|dashed|dashdot|dotted.  The dash tuple is (offset, onoffseq)
#          where onoffseq is an even length tuple of on and off ink in points.
#          If linestyle is omitted, 'solid' is used
{"ft_lang_label":"__label__en","ft_lang_prob":0.6308937,"math_prob":0.91142946,"size":1467,"snap":"2022-40-2023-06","text_gpt3_token_len":400,"char_repetition_ratio":0.10868079,"word_repetition_ratio":0.0,"special_character_ratio":0.29447854,"punctuation_ratio":0.23101266,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9870696,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,null,null,3,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-02-03T19:39:53Z\",\"WARC-Record-ID\":\"<urn:uuid:6cea8ee4-e42c-49d5-93a3-4de293b5557f>\",\"Content-Length\":\"13438\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:066c81ac-42e5-4762-b31a-c3e22d0b7f72>\",\"WARC-Concurrent-To\":\"<urn:uuid:962a419e-d6dd-4439-a832-d16c60d9875f>\",\"WARC-IP-Address\":\"104.26.1.8\",\"WARC-Target-URI\":\"https://matplotlib.org/1.4.3/examples/pylab_examples/line_collection.html\",\"WARC-Payload-Digest\":\"sha1:3UC7BWWBOZ3J342E32REJNM4IFFDDGPY\",\"WARC-Block-Digest\":\"sha1:BMRRLD7FAT7S652MQYJU5DQBZXAKOS64\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-06/CC-MAIN-2023-06_segments_1674764500074.73_warc_CC-MAIN-20230203185547-20230203215547-00765.warc.gz\"}"}