Hi,
I'm trying to use Matplotlib in python. I can import the package Matplotlib using;
import matplotlib.pyplot as plt
and it imports the package without error.
I can also run the following without erro;
plt.figure()
however, when I try to plot something using plt.plot() I get the following error;
I am not sure why i'm getting this error. I would appreciate any help in resolving it.
Thank you
[<matplotlib.lines.Line2D at 0x1ae491910f0>]
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
c:\program files\alteryx\bin\miniconda3\envs\jupytertool_venv\lib\site-packages\IPython\core\formatters.py in __call__(self, obj)
339 pass
340 else:
--> 341 return printer(obj)
342 # Finally look for special method names
343 method = get_real_method(obj, self.print_method)
c:\program files\alteryx\bin\miniconda3\envs\jupytertool_venv\lib\site-packages\IPython\core\pylabtools.py in <lambda>(fig)
242
243 if 'png' in formats:
--> 244 png_formatter.for_type(Figure, lambda fig: print_figure(fig, 'png', **kwargs))
245 if 'retina' in formats or 'png2x' in formats:
246 png_formatter.for_type(Figure, lambda fig: retina_figure(fig, **kwargs))
c:\program files\alteryx\bin\miniconda3\envs\jupytertool_venv\lib\site-packages\IPython\core\pylabtools.py in print_figure(fig, fmt, bbox_inches, **kwargs)
126
127 bytes_io = BytesIO()
--> 128 fig.canvas.print_figure(bytes_io, **kw)
129 data = bytes_io.getvalue()
130 if fmt == 'svg':
c:\program files\alteryx\bin\miniconda3\envs\jupytertool_venv\lib\site-packages\matplotlib\backend_bases.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, bbox_inches, **kwargs)
2054 If not None, switch the figure canvas to the ``FigureCanvas`` class
2055 of the given backend.
-> 2056 fmt : str
2057 If *backend* is None, then determine a suitable canvas class for
2058 saving to format *fmt* -- either the current canvas class, if it
c:\program files\alteryx\bin\miniconda3\envs\jupytertool_venv\lib\site-packages\matplotlib\backends\backend_agg.py in print_png(self, filename_or_obj, metadata, pil_kwargs, *args, **kwargs)
499
500 .. _PNG specification: \
--> 501 https://www.w3.org/TR/2003/REC-PNG-20031110/#11keywords
502
503 pil_kwargs : dict, optional
ImportError: cannot import name '_png'
<Figure size 432x288 with 1 Axes>