Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Matplolib graphic from batch
#1
Hello

Sorry I don't know if is this the correct section
of the forum

I used this script taken from an example
of matplolib

The script is running from the idle but if
I run it from a batch:

<\cd \Python36
python C:\Temp_DD1\Duca\PY_dep\PlotTest.py
rem pause\>

file I got an error:
Error:
File "C:\Temp_DD1\Duca\PY_dep\PlotTest.py", line 1, in <module> import matplotlib ModuleNotFoundError: No module named 'matplotlib'
Here the code of the script:

import matplotlib
import matplotlib.pyplot as plt
import numpy as np

# Data for plotting
t = np.arange(0.0, 2.0, 0.01)
s = 1 + np.sin(2 * np.pi * t)

fig, ax = plt.subplots()
ax.plot(t, s)

ax.set(xlabel='time (s)', ylabel='voltage (mV)',
       title='About as simple as it gets, folks')
ax.grid()
fig.savefig("test.png")
plt.show()
scidam wrote Sep-11-2019, 08:34 AM:
Please post all code, output and errors (in it's entirety) between their respective tags. I did it for you this time, Here are instructions on how to do it yourself next time.
Quote
#2
I got such type of error when a package is not installed: I would say that it's your case with matplotlib (or maybe be are you using a specific distribution?)
Quote
#3
any possibility that you have more than one python installation or using virtualenvironment?
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  how can I create a recursive graphic with matplotlib royer14 3 595 Nov-22-2018, 05:00 PM
Last Post: Gribouillis
  3D graphic lollie 2 731 Jun-11-2018, 07:21 AM
Last Post: lollie
  Batch processing and saving into new folder aeritano 3 819 Jun-10-2018, 01:17 AM
Last Post: aeritano
  Current time on x axis in matplolib Stumpy_L 2 1,300 Feb-07-2018, 02:07 PM
Last Post: Stumpy_L

Forum Jump:


Users browsing this thread: 1 Guest(s)