Skip to content

after updating to python 3.6 from python 3.5 stopped to work plt.show(block = False) #11516

@Sandy4321

Description

@Sandy4321

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions