Issue
I am using ob-ipython on org-mode, which positions the images from matpllotlib automatically.
However, the images it output is quite small.
search through the source code and did not find keywords of 'pic' or 'img'.
https://github.com/gregsexton/ob-ipython
How could double the size of images?
Solution
This is a matplotlib setting.
#+BEGIN_SRC ipython :session :results raw drawer
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
plt.rcParams['figure.figsize'] = [12, 8]
#+END_SRC
#+BEGIN_SRC ipython :session :exports both :results raw drawer
plt.hist(np.random.randn(20000), bins=200)
#+END_SRC
For me the default seemed to be [6,4]
. Apparently it's measured in inches; there's also a DPI setting. It guesses my DPI wrong (default is 72, my actual DPI is 87 according to xdpyinfo and a ruler), and also the image size isn't quite right even assuming 72 DPI, but it's not super far off.
BTW, this is the first time I've actually got ob-ipython working, seems pretty nice.
Answered By - jpkotta
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.