[Matplotlib-users] size of the picture

Jody Klymak jklymak at uvic.ca
Thu Nov 30 01:26:48 EST 2017


```python

fig, ax = plt.subplots(figsize=(5,3)) 

```

will give a figure that is 5 inches wide by 3 inches tall.  

Cheers,   Jody


> On Nov 29, 2017, at  22:18 PM, vincent_mathoscope <mathoscope at netcourrier.com> wrote:
> 
> hi
> for the book iwrite i need fonts in size 10
> i put this size to the fonts and the exported picture, when included in my
> TeXmacs document without changing the size, present fonts that fits
> approximatively to this size of 10
> but my pictures are really to big ; if i reduce them (they are png) then of
> course the fonts are reduced also
> i have been searching on internet since 2 days, looking for the right
> instruction to fix the size of the picture
> i did not find my answer here :
> https://stackoverflow.com/questions/8775622/exact-figure-size-in-matplotlib-with-title-axis-labels
> <https://stackoverflow.com/questions/8775622/exact-figure-size-in-matplotlib-with-title-axis-labels>  
> here the topic seemed to be mine :
> http://scipy-cookbook.readthedocs.io/items/Matplotlib_AdjustingImageSize.html
> <http://scipy-cookbook.readthedocs.io/items/Matplotlib_AdjustingImageSize.html>  
> but this code, just copy-pasted from this link :
> 
> gave this message :
> AttributeError: 'Figure' object has no attribute 'set_figsize_inches'
> 
> of course i can fix the font to some random value say 24 and reduce the
> picture to a random % and, by trials and approximations, find the right size
> and the right % so that the text in my pictures seem to be 10
> 
> i'm sure it must exist a more satisfying way  but can not find it
> 
> i am just missing this point to start working
> 
> thanks if you have ideas.
> 
> 
> 
> -----
>        ––––––––––––––––––––––––––
>                  Vincent Douce
>               :=: Mathoscope :=:
>             http://mathoscope.xyz
>                 06°13°11°07°26
>          Bagnères de Bigorre 65200
> --
> Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users at python.org
> https://mail.python.org/mailman/listinfo/matplotlib-users



More information about the Matplotlib-users mailing list