Get pictures to show up on jupyter notebook online
![get pictures to show up on jupyter notebook online get pictures to show up on jupyter notebook online](https://developer-blogs.nvidia.com/wp-content/uploads/2021/02/Jupyter_Figure1-625x381.png)
- #Get pictures to show up on jupyter notebook online install
- #Get pictures to show up on jupyter notebook online code
- #Get pictures to show up on jupyter notebook online trial
Finally, Lines 14-22 plot the histogram using matplotlib. From there the cv2.calcHist function is used to compute a histogram over the grayscale pixel intensities.
![get pictures to show up on jupyter notebook online get pictures to show up on jupyter notebook online](https://miro.medium.com/proxy/1*j0vLDfv-6sbUfDLx7bKXxw.png)
We then load our image and convert it to grayscale ( Lines 4-9). Gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) # load the image, convert it to grayscale, and show it
#Get pictures to show up on jupyter notebook online code
I’ll throw all this code into a file named grayscale_histogram.py : # import the necessary packages Now, let’s write a few lines of code to load the image, convert it to grayscale, compute a histogram over the grayscale image, and finally display it to our screen.
#Get pictures to show up on jupyter notebook online install
Now that we’re in the plotting environment, let’s install numpy, scipy, and matplotlib : $ pip install numpyĪwesome - all of our Python dependencies are installed. Since we are using matplotlib, let’s create a new virtual environment called plotting : $ mkvirtualenv plotting
#Get pictures to show up on jupyter notebook online trial
Luckily, after a lot of trial and error (and spending an entire day trying to come up with a solution), I have been able to resolve the problem and get matplotlib figures to show up and display on my screen on both the Ubuntu and Raspbian operating systems (and when using Python virtual environments). The issue actually stems from the matplotlib backend not being properly set, or from a missing dependency when compiling and installing matplotlib. This issue is only further compounded when utilizing virtual environments via the virtualenv and virtualenvwrapper packages. This is actually a common problem I’ve ran into over the past few months, especially when working with Debian based operating systems such as Ubuntu and Raspbian.
![get pictures to show up on jupyter notebook online get pictures to show up on jupyter notebook online](https://aws1.discourse-cdn.com/business7/uploads/psychopy/original/3X/4/a/4abcdeb3611d422c64f31d53bd9c08d3f600326b.png)
I coded up a quick Python script using matplotlib, executed the script, only to not have the figure displayed to my screen. Over the weekend I was playing around with deep learning on my Ubuntu system and went to plot the accuracy scores of my classifier. I think a better title for this blog post might be: How I lost a day of productivity to Ubuntu, virtual environments, matplotlib, and rendering backends. Click here to download the source code to this post