upgrade to 1.0 help

Hello. I’ve decided to upgrade to matplotlib 1.0, but I’ll need to fix a few problems that have come up. I was hoping I could get some help on this here.

First thing is, I have a bit of point picker code that was written by JJ on this list some time back that has been working well. This is the start of it:

def contains_points(self, line, mouseevent):
line.pickradius = 5

    # Make sure we have data to plot
    if line._invalid:
        line.recache()
    if len(line._xy)==0: return False,{}

But I am getting an error:

AttributeError: ‘Line2D’ object has no attribute ‘_invalid’

Can someone please tell me what the right method is now? And how I can learn about these sorts of changes on my own?

Thank you,
Che

Hello. I’ve decided to upgrade to matplotlib 1.0, but I’ll need to fix a few problems that have come up. I was hoping I could get some help on this here.

Second problem: the grid background is gone despite these lines are not throwing any errors (here, self.subplot is an axis):

self.subplot.grid(True)
self.subplot.grid(color='0.75', linestyle='dotted', linewidth=0.1)

I searched the docs for grid and so far haven’t found the change. What is the right method now?

Thanks,
Che

Ack, sorry for the noise. That does work (and I don’t need the first line). It is just that the lines are so fine/faint now that I couldn’t see them lines until I tilted the monitor and looked carefully.

I’m guessing the change was because previous to mpl 1.0 a linewidth of 0.1 was below some minimal value and was treated as though it were 1? In any case, using linewidth=1 looks reasonable for me now.

-cm

···

On Fri, Dec 3, 2010 at 8:10 PM, C M <cmpython@…287…> wrote:

Hello. I’ve decided to upgrade to matplotlib 1.0, but I’ll need to fix a few problems that have come up. I was hoping I could get some help on this here.

Second problem: the grid background is gone despite these lines are not throwing any errors (here, self.subplot is an axis):

self.subplot.grid(True)
self.subplot.grid(color='0.75', linestyle='dotted', linewidth=0.1)

I searched the docs for grid and so far haven’t found the change. What is the right method now?