problem using Linecollection

I'm simply trying to draw a couple of lines using line collection, not sure
why it doesn't work

import matplotlib.pyplot as plt
from matplotlib import collections as mc
import numpy as np
import pylab as pl

segments = [ [(1,2),(3,4)],
        [(5,6),(7,8)] ]
lc = mc.LineCollection(segments, linestyles='solid', pickradius=5, zorder=2)
fig, ax = pl.subplots()

ax.add_collection(lc)
ax.autoscale()

···

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/problem-using-Linecollection-tp47687.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Anni,

Please subscribe to the list so that your emails will post un-moderated (
Matplotlib-users Info Page)

What is not working?

import matplotlib.pyplot as plt
from matplotlib import collections as mc
import numpy as np

segments = [ [(1,2),(3,4)],
             [(5,6),(7,8)] ]
lc = mc.LineCollection(segments, linestyles='solid', pickradius=5, zorder=2)
fig, ax = pl.subplots()

ax.add_collection(lc)
ax.autoscale()

plt.show() # added this line to get window
fig.save('so.png') # to save as png

gives me the attached figure.

[image: so.png]Tom

I'm simply trying to draw a couple of lines using line collection, not sure
why it doesn't work

import matplotlib.pyplot as plt
from matplotlib import collections as mc
import numpy as np
import pylab as pl

segments = [ [(1,2),(3,4)],
                                [(5,6),(7,8)] ]
lc = mc.LineCollection(segments, linestyles='solid', pickradius=5,
zorder=2)
fig, ax = pl.subplots()

ax.add_collection(lc)
ax.autoscale()

--
View this message in context:
http://matplotlib.1069221.n5.nabble.com/problem-using-Linecollection-tp47687.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users at python.org
Matplotlib-users Info Page

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20170128/2d98255c/attachment.html&gt;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: so.png
Type: image/png
Size: 12772 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20170128/2d98255c/attachment.png&gt;

···

On Sat, Jan 28, 2017 at 10:59 AM A397nn <annix at uw.edu> wrote: