Displaying a numpy plot

asked 2015-03-09 18:44:23 -0500

Geremia gravatar image

updated 2015-03-09 18:45:42 -0500

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-09 19:01:28 -0500 )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 05:06:30 -0500 )edit

I'm using Sage with KDE Cantor on Linux.

Geremia gravatar imageGeremia ( 2015-03-11 11:46:02 -0500 )edit