Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
ation=60)
plt.ylabel('No. of occurance')
plt.xlabel('Locations')
plt.title('Occurance of Locations')
#plt.savefig('file.png')(Commented out for testing)
#End of Graph positions and Names
plt.show()



https://i.redd.it/n311chii2u111.png

/r/Python
https://redd.it/8oat6s
Updating Figure Display in Jupyter

Hello /r/IPython

​

I'm not sure if this is the right place to ask this, but the jupyter subreddit doesn't seem very active. Anywho, I'm trying grabbing images from webcam and doing some processing on it, and I want the output from the code block to update, maybe redrawing the figure/axis so that the newer image shows. Here's what I have:

```
plt.ion()
webcam = init_cam() #sets resolution and stuff
fig, ax = plt.subplots(1)
axim = ax.imshow(tFrame) #Show some pre-grabbed image

while True:
frame = get(webcam) #gets image from webcam
axim.set_data(frame)
plt.show(block=False)
#plt.pause(1) #I've tried with and without pauses
```

And long story short, it doesn't update the figure and appears to only show the first frame. Am I doing something wrong? Is there another way to do this? Any help would be appreciated!

/r/IPython
https://redd.it/k8a6nx