Anni,

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.

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

[hidden email]

https://mail.python.org/mailman/listinfo/matplotlib-users

_______________________________________________

Matplotlib-users mailing list

[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users