Skip to content
New issue

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

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

Already on GitHub? # to your account

plt.show() puts image in following prompt #601

Closed
zooba opened this issue Jul 15, 2015 · 1 comment
Closed

plt.show() puts image in following prompt #601

zooba opened this issue Jul 15, 2015 · 1 comment
Labels

Comments

@zooba
Copy link
Member

zooba commented Jul 15, 2015

Copy-paste the following code into an IPython repl:

from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
for c, z in zip(['r', 'g', 'b', 'y'], [30, 20, 10, 0]):
    xs = np.arange(20)
    ys = np.random.rand(20)
    # You can provide either a single color or an array. To demonstrate this,
    # the first bar of each set will be colored cyan.
    cs = [c] * len(xs) 
    cs[0] = 'c' 
    ax.bar(xs, ys, zs=z, zdir='y', color=cs, alpha=0.8)

ax.set_xlabel('X') 
ax.set_ylabel('Y') 
ax.set_zlabel('Z') 
plt.show()

The image appears after the In [2]: prompt (where 2 is actually the number after the previous prompt).

If you omit the plt.show(), it appears in the correct location.

@zooba
Copy link
Member Author

zooba commented Aug 23, 2016

Thought we had a dup of this somewhere but can't find it now.

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

No branches or pull requests

3 participants