Having read many of the posts on this site about resizing graphs and setting limits on graph sizes in Jupyter, I am virtually convinced there is something different when it
Try replacing
%pylab inline
pylab.rcParams['figure.figsize'] = (20, 16)
pylab.rcParams['figure.dpi'] = 200
import matplotlib.pyplot as plt
import matplotlib
with
%matplotlib inline
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['figure.figsize'] = (20, 16)
matplotlib.rcParams['figure.dpi'] = 200
Sometimes that happens to me as well on my Mac.
First use this:
import matplotlib.pyplot as plt
import matplotlib
%matplotlib inline
matplotlib.rcParams['figure.figsize'] = (20, 16)
matplotlib.rcParams['figure.dpi'] = 200
The trick for my case: First import and then use the %matplotlib inline
command. However, seems like a bug.
This is due to a bug in matplotlib 3.0.0. It should not occur in matplotlib 3.0.1.
Options you have:
Set the following option in your jupyter notebook before plotting
%config InlineBackend.print_figure_kwargs = {'bbox_inches':None}
Use the %matplotlib notebook
backend instead of the %matplotlib inline
one.