user10653561
user10653561

Reputation: 3

Python not showing plots

When I run the following code, plots don't show up even though I am not getting any error messages.

import matplotlib.pyplot as plt
plt.plot = ([1,2], [1,2])
plt.show()

I tried the following 1) Change Spyder->Preferences->Graphics backend = Automatic (Reset kernel) 2) import matplotlib matplotlib.use('Agg') Got error: "no effect because the backend has already been chosen"

I am using Python 3.6 with Spyder that comes with Anaconda

Upvotes: 0

Views: 652

Answers (1)

Eduardo López
Eduardo López

Reputation: 121

there is an error in your code, it must be:

import matplotlib.pyplot as plt
plt.plot([1,2], [1,2])
plt.show()

Upvotes: 3

Related Questions