Displaying a numpy plot

asked 2015-03-10 00:44:23 +0200

Geremia gravatar image

updated 2015-03-10 00:45:42 +0200

import matplotlib
import numpy as np

import matplotlib.pyplot as plt

plt.figure(figsize=(6, 3))

plt.plot(x, y)

Why doesn't plt.show() display my plot? plt.savefig('myplot.png') works, however.


edit retag flag offensive close merge delete


This is because the hooks are not there; however, they should be in the IPython notebook (?)

kcrisman gravatar imagekcrisman ( 2015-03-10 01:01:28 +0200 )edit

Are you using SageMath on your computer (if so: command-line or notebook?) or online at cloud.sagemath.com, or other?

slelievre gravatar imageslelievre ( 2015-03-11 11:06:30 +0200 )edit

I'm using Sage with KDE Cantor on Linux.

Geremia gravatar imageGeremia ( 2015-03-11 17:46:02 +0200 )edit