Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a question about subplot in spyder #3520

Closed
xiaoshuyimei opened this issue Sep 16, 2014 · 3 comments
Closed

a question about subplot in spyder #3520

xiaoshuyimei opened this issue Sep 16, 2014 · 3 comments

Comments

@xiaoshuyimei
Copy link

import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(2,1,1)
import numpy as np
t = np.arange(0.0, 1.0, 0.01)
s = np.sin(2_np.pi_t)
line, = ax.plot(t, s, color='blue', lw=2)
ax.lines[0]
when i enter codes above in console,there is nothing happened about the figure,no line ,no subplot.
why?

@efiring
Copy link
Member

efiring commented Sep 16, 2014

I suggest you ask this on the spyder discussion list, giving additional information such as what version of spyder you are running, what version of matplotlib, on what operating system, and installed by what method.
But first, have you tried ending with plt.show() or plt.draw(()? I don't know how spyder handles interactive plotting, but generally when using the object methods (e.g., ax.plot()) you need to explicitly trigger drawing. This is in contrast with pyplot, which draws automatically when in "interactive mode". Since you didn't even get a figure, I suspect this mode was not in effect.
I'm going to close this issue here because I don't think the matplotlib bug tracker is the appropriate venue.

@efiring efiring closed this as completed Sep 16, 2014
@xiaoshuyimei
Copy link
Author

ok,thanks.

1 similar comment
@xiaoshuyimei
Copy link
Author

ok,thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants