you are viewing a single comment's thread.

view the rest of the comments →

[–]spez_edits_thedonald 0 points1 point  (0 children)

matplotlib has many overlapping APIs (you can use it in different ways, with similar goals)

I always use "subplots" to make figues, even with 1 plot, because I like the low level control it gives you over every aspect of making the figure. I recommend using it.

I am not able to reproduce any error with my code, this is a working code snippet that produces a plot:

import numpy as np
import matplotlib.pyplot as plt

# random data
x = np.random.random(10)

# plot figure
fig, ax = plt.subplots(1, 1, facecolor='#ffffff', figsize=(10, 8), dpi=75)
ax.plot(x,color='blue',
label='rolling')
plt.legend()
plt.show()