Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8916053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:08:09+00:00 2026-06-15T05:08:09+00:00

I use the IPython Notebook with the –pylab inline option, since I don’t want

  • 0

I use the IPython Notebook with the --pylab inline option, since I don’t want plots to show up in a different window. Now I’d like to save the plots I see in the notebook to PDF or PNG files.

Some code examples use

import matplotlib as plt

plt.savefig("figure.png") # save as png

but this does not seem to work in inline mode.

Of course I could simply save the PNG that is generated out of the browser, but I’d like to do this with a line of Python. I am also interested in PDF export.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T05:08:11+00:00Added an answer on June 15, 2026 at 5:08 am

    try this (note that the files get saved to the default notebook folder):

    plot(range(80))
    xlabel('foo')
    ylabel('bar')
    legend(['myline'])
    axis([0, 80, 0, 120])
    savefig('sample.pdf')
    

    if you want png just change it to 'sample.png'.

    Note that the savefig() call should be in the same notebook cell as the plotting commands.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using IPython Notebook and want to ramp things up and get the
I want to use some packages (i.e., IPython or zdaemon ), butI am doing
When attempting to use pandoc to convert JSON based files (.ipynb) from iPython notebook
So, I'm a huge IPython fan, though I'm sure I don't use nearly all
I'm afraid I don't understand something basic. I use python interactively with IPython and
I would like to use an IPython notebook as a way to interactively analyze
When I use IPython along with the -wthread option, it spawns a python subprocess,
I've installed ipython, but I don't know how to use it. Where could I
I want to use IPython under GAE to debug scripts locally: import ipdb; ipdb.set_trace()
Use Case Show a photo uploaded by the user in a square box with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.