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

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\
rem pause\>

file I got an error:
File "C:\Temp_DD1\Duca\PY_dep\", 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')
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?)
any possibility that you have more than one python installation or using virtualenvironment?
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs


Possibly Related Threads…
Thread Author Replies Views Last Post
Sad Miss-Classification problem with shuffled batch Faebs94 0 374 Sep-02-2021, 11:55 AM
Last Post: Faebs94
  Help batch converting .json chosen file to MySQL BrandonKastning 2 1,147 Mar-14-2020, 09:19 PM
Last Post: BrandonKastning
  how can I create a recursive graphic with matplotlib royer14 3 1,995 Nov-22-2018, 05:00 PM
Last Post: Gribouillis
  3D graphic lollie 2 1,776 Jun-11-2018, 07:21 AM
Last Post: lollie
  Batch processing and saving into new folder aeritano 3 3,124 Jun-10-2018, 01:17 AM
Last Post: aeritano
  Current time on x axis in matplolib Stumpy_L 2 2,827 Feb-07-2018, 02:07 PM
Last Post: Stumpy_L

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020