I just upgraded my Jupyter version to 4.2.1 and it seems as though inline figures have gotten a lot larger for the same figsize
.
Am I imagining this?
Can I change that without changing the figsize
?
Next, to increase the size of the plot in the jupyter notebook use plt. rcParams[“figure. figsize”] method and set width and height of the plot.
Python3. figsize() takes two parameters- width and height (in inches). By default the values for width and height are 6.4 and 4.8 respectively.
If you've already got the figure created, say it's 'figure 1' (that's the default one when you're using pyplot), you can use figure(num=1, figsize=(8, 6), ...) to change it's size etc. If you're using pyplot/pylab and show() to create a popup window, you need to call figure(num=1,...)
However, the size of the images has changed with a version of Jupyter or matplotlib. The images have become smaller. You can see this by opening and running an example notebook. Matplotlib displays the images smaller than in the example.
This allows you to visualize part of a long output without it taking up the entire page. You can trigger this behavior in Jupyter Book by adding the following tag to a cell’s metadata: For example, the following cell has a long output, but will be scrollable in the book:
Matplotlib is a Python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms. – matplotlib Within a Jupyter notebook, the data can be visualized with matplotlib. However, the size of the images has changed with a version of Jupyter or matplotlib.
The traditional Jupyter Notebook interface allows you to toggle output scrolling for your cells. This allows you to visualize part of a long output without it taking up the entire page. You can trigger this behavior in Jupyter Book by adding the following tag to a cell’s metadata: { "tags": [ "output_scroll", ] }
You can use top-level matplotlib
settings like this:
import matplotlib as mpl
mpl.rcParams['figure.figsize'] = (10,10)
This will change default figure size to 10x10. More on that in the documentation: http://matplotlib.org/users/customizing.html
The scaling of the figure for figures with %matplotlib inline
depends on the figure.dpi
parameter. So if your figures are to small and you do not want to increase the figsize
then you can just set
import matplotlib.pyplot as plt
plt.rcParams['figure.dpi'] = 150 # default for me was 75
I also had the impression that the scaling changed at some point, but I guess this can also appear if you change your screen/resolution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With