How to inherit matplotlib in python?
Question: When I run the program below:

    
    
    import matplotlib
    class abc(matplotlib):
        def anything(self):
            print("anything")
    
    aa=abc()
    

I got the following errors:

> File "test.py", line 2, in class abc(matplotlib): TypeError: Error when
> calling the metaclass bases module.**init**() takes at most 2 arguments (3
> given)

How can I fix it?


Answer: `matplotlib` is a module/package. You can't inherit from it since it isn't a
class.

The closest thing that I can think of that you _could_ do is something akin
to:

    
    
    # my_matplotlib.py
    from matplotlib import *
    import matplotlib
    
    def plot(*args, **kwargs):
        """Overrides matplotlib.plot"""
        print "Hey Dude.  I'm plotting now!"
        return matplotlib.plot(*args, **kwargs)
    

Note that I really don't recommend doing this ...

