-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Closed
Closed
Copy link
Description
May help to create and show figures without blocking calculations
previously it worked by using
plt.show(block = False)
but after updating to python 6 it does not work any more
import matplotlib.pyplot as plt
fig = plt.figure(figsize=(13, 5))
plt.ion()
x = [1, 2, 3, 4]
y = [1, 4, 9, 6]
labels = ['Frogs', 'Hogs', 'Bogs', 'Slogs']
plt.plot(x, y, 'ro')
# You can specify a rotation for the tick labels in degrees or with keywords.
plt.xticks(x, labels, rotation='vertical')
# Pad margins so that markers don't get clipped by the axes
plt.margins(0.2)
# Tweak spacing to prevent clipping of tick-labels
plt.subplots_adjust(bottom=0.15)
plt.show(block = False)
q=1
fig = plt.figure(figsize=(13, 5))
x = [1, 2, 3, 4]
y = [7, 1, 2, 16]
labels = ['Frogs', 'Hogs', 'Bogs', 'Slogs']
plt.plot(x, y, 'ro')
# You can specify a rotation for the tick labels in degrees or with keywords.
plt.xticks(x, labels, rotation='vertical')
# Pad margins so that markers don't get clipped by the axes
plt.margins(0.2)
# Tweak spacing to prevent clipping of tick-labels
plt.subplots_adjust(bottom=0.15)
plt.show(block = False)
q=1
Metadata
Metadata
Assignees
Labels
No labels