matplotlib

Answered

Hello,

 

I have installed package - matplotlib,

 

 

  for my basic program

__author__ = 'suyog'


import numpy as np
import matplotlib.pyplot as plt

points = np.arange(-5, 5, 0.01)
dx, dy = np.meshgrid(points, points)
z = (np.sin(dx)+np.sin(dy))
plt.imshow(z)
plt.colorbar()
plt.title('plot for sin(x)+sin(y)')
plt.show()

 

but I'm getting an error -

 

Regards,

Suyog

 

 

 

0
3 comments

Hello, thank you for the report. Tell us please, are you able to run this script with your project interpreter in the command line without error? Also please attach the whole console output from Pycharm.

0
Avatar
Permanently deleted user

I can't execute with my project interpreter. 

 

Here's the error - 

C:\Python27\python.exe "F:/ASE academic/machine learning updated/untitled/1.py"
Traceback (most recent call last):
File "F:/ASE academic/machine learning updated/untitled/1.py", line 5, in <module>
import matplotlib.pyplot as plt
File "C:\Users\suyog\AppData\Roaming\Python\Python27\site-packages\matplotlib\pyplot.py", line 115, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "C:\Users\suyog\AppData\Roaming\Python\Python27\site-packages\matplotlib\backends\__init__.py", line 32, in pylab_setup
globals(),locals(),[backend_name],0)
File "C:\Users\suyog\AppData\Roaming\Python\Python27\site-packages\matplotlib\backends\backend_tkagg.py", line 6, in <module>
from six.moves import tkinter as Tk
File "C:\Users\suyog\AppData\Roaming\Python\Python27\site-packages\six.py", line 203, in load_module
mod = mod._resolve()
File "C:\Users\suyog\AppData\Roaming\Python\Python27\site-packages\six.py", line 115, in _resolve
return _import_module(self.mod)
File "C:\Users\suyog\AppData\Roaming\Python\Python27\site-packages\six.py", line 82, in _import_module
__import__(name)
File "C:\Python27\lib\lib-tk\Tkinter.py", line 38, in <module>
import FixTk
File "C:\Python27\lib\lib-tk\FixTk.py", line 68, in <module>
import _tkinter
ImportError: DLL load failed: %1 is not a valid Win32 application.

Process finished with exit code 1

0

> I can't execute with my project interpreter. 

Do you have the same error in the command line?

0

Please sign in to leave a comment.