0 votes
1 view
in Data Science by (17.6k points)

In ipython Notebook, first create a pandas Series object, then by calling the instance method .hist(), the browser displays the figure.

I am wondering how to save this figure to a file (I mean not by right click and save as, but the commands needed in the script).

1 Answer

0 votes
by (38.2k points)

Using the Figure.savefig() method:

ax = s.hist()  # s is an instance of Series

fig = ax.get_figure()

fig.savefig('/path/to/figure.pdf')

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked Aug 31, 2019 in Data Science by sourav (17.6k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...