Error executing matplotlib.pyplot.subplots()
Asked Answered
F

2

6

I have a script that creates png images from log data. It works fine on a production machine, but now spits errors on a new box while processing this line:

    fig, ax = plt.subplots(1,1, figsize=(20,14))


AttributeError: 'module' object has no attribute 'subplots'

I suspect issues in version differences in various modules. Any insights?

Footle answered 23/4, 2013 at 9:30 Comment(7)
I'm assuming you've imported matplotlib as plt?Alloy
What versions of python/mpl are you running? How is plt imported in your code?Coolish
import matplotlib.pyplot as pltFootle
IPython.__version__: '0.13.2', matplotlib.__version__: '0.99.1.1', seems the production box has a newer version of matplotlib. I will install the new version on the nex box and see if that resolves.Footle
Thanks folks, installing the latest matplotlib seems to solve the issue.Footle
@nom-mon-ir, it might be best to write that as an answer to the question and mark it as accepted. (At least so that such an old question doesn't show up as an unanswered one).Albur
Thanks I just did it.Footle
F
1

Latest version of Ipython does not have this issue. Putting it as answer as suggested by @Jay Bosamiya to make this question closed.

Footle answered 18/7, 2015 at 21:14 Comment(0)
P
0

See the comment by nom-mon-ir:

import matplotlib.pyplot as plt

instead of import matplotlib.pyplot as plt or using a new ipython version

Plexiglas answered 17/10, 2024 at 14:52 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.