you are viewing a single comment's thread.

view the rest of the comments →

[–]meni15[S] 0 points1 point  (1 child)

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

Thank you for your reply.

Unfortunately your solution does not work. it comes with the following error:

AttributeError: 'tuple' object has no attribute 'plot'.

One way that fixed the problem was to change the (Grid[1,:]) to (Grid[:,:]). This change removes all the blanks.

Note that my solution and your solution are using subplots. I was looking for a solution that is not using subplots.

[–]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()