Screen Link: https://app.dataquest.io/m/146/guided-project%3A-visualizing-earnings-based-on-college-majors/1/introduction
import pandas as pd
import matplotlib.pyplot as plt
x = [1,2,3,4]
y = [4,7,4,20]
In the instructions for this guided project, it tells me to run the Jupyter
magic %matplotlib inline. What is that for? I’ve looked it up and says something about making is display in the output. But I made the above bar plot as a test and ran the code with and without the magic command and I get the same output both times. So i’m not sure what exactly are we including this for if I return the same bar plot either way?
Try restarting the kernel like this:
@Sahil , I’m still a bit confused. What does it actually do? Does it make it where the plot stays outputted even after the kernel restart?
Run the Jupyter magic
%matplotlib inline so that plots are displayed inline.
If you don’t run that command, the plots won’t be displayed. Once, you run that command, the plot will continue to be displayed even if you remove the code. That is why I suggested you to restart the kernel. After restarting the kernel, when you run code, the plot won’t be displayed as the changes made by
%matplotlib inline has been removed.
@Sahil, got it! Thank you!!