The nature of the error you are getting is simply because you can't have a class inherit from both "object" and matplotlib.pyplot
- but them, pyplot is a module - That is: an instance of the "ModuleType" class - and it makes no sense to try to augment it with inheritance.
You could augment pyplot with simple attribute assignments:
import matplotlib.pyplot
def my_new_plot_function(...):
...
matplotlib.pyplot.new_func = my_new_plot_function
and your new function would be available for other modules that make use of the pyplot module. However, as stated in the comments, there is no need to do that - and that is definitely not desirable from an architectural point of view. You can even replace one of the existing functions or classes in the pyplot module doing that - this is called monkey patching - and you will find it to be higly unreliable unless you really, really know what you are doing - and even so, poorly maintainable, and an obscure feature in your system as a whole.
Now- there are classes inside the Pyplot module - you could inherit from those, and enhance their behavior - and you would import your inherited classes in your code, from your own module. Maybe inheritance is not the best method to add upon their behavior in modern code (aggregation and proxying of the needed methods is preferred) - but that would work.
The classes that can be subclassed are:
>>> [obj for obj in dir(pyplot) if isinstance(getattr(pyplot, obj), type)]
['Annotation', 'Arrow', 'Artist', 'AutoLocator', 'Axes', 'Button', 'Circle', 'Figure', 'FigureCanvasBase', 'FixedFormatter', 'FixedLocator', 'FormatStrFormatter', 'Formatter', 'FuncFormatter', 'GridSpec', 'IndexLocator', 'Line2D', 'LinearLocator', 'Locator', 'LogFormatter', 'LogFormatterExponent', 'LogFormatterMathtext', 'LogLocator', 'MaxNLocator', 'MultipleLocator', 'Normalize', 'NullFormatter', 'NullLocator', 'PolarAxes', 'Polygon', 'Rectangle', 'ScalarFormatter', 'Slider', 'Subplot', 'SubplotTool', 'Text', 'TickHelper', 'Widget', 'silent_list']