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 6126903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:26:12+00:00 2026-05-23T16:26:12+00:00

Is it possible to remove the axes from a pyplot.figure() ? Using the pyplot.imsave()

  • 0

Is it possible to remove the axes from a pyplot.figure()?

Using the pyplot.imsave() to create an image without axes works OK

plt.imsave(file, zi)

Image produces with pyplot.imsave()

but it’s limited because it only works with grid data.

When I use pyplot.figure() and save it using pyplot.savefig() as follows

...
# create figure
fig = plt.figure(figsize=(1.0,1.0))
# apply contour plot
plt.contour(zi,15,linewidths=0.1,colors='k')
plt.contourf(zi,15,cmap=plt.cm.jet)
# flip the y-axis
ax = plt.gca()
ax.set_ylim(ax.get_ylim()[::-1])
# save to file, 256x256 pixels
plt.savefig(file1, dpi=256)

Image produces with pyplot.savefix()

the saved image keeps it’s axis, as seen on image above.

  • 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-05-23T16:26:13+00:00Added an answer on May 23, 2026 at 4:26 pm

    I was able to remove the axis display and any spacing that was allocated to the axis with the following code:

    fig = plt.figure(figsize=(1.0,1.0))
    ax = fig.add_axes([0.0, -0.2, 1.2, 1.2])
    plt.contour(zi,15,linewidths=0.1,colors='k')
    plt.contourf(zi,15,cmap=plt.cm.jet)
    ax.set_ylim(ax.get_ylim()[::-1])
    ax.set_axis_off()
    plt.savefig(file1, dpi=256)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Remove CSS from a Div using JQuery we can set backgroung-image property
Is it possible to remove attributes from inherited properties? I thought that by using
Is it possible to remove duplicate characters from a string without saving each character
is it possible to remove Main Domain cookie from Sub Domain ?I am using
Possible Duplicate: Remove non breaking space ( ) from between elements using jquery How to
Is it possible to remove/delete an HTML element from the markup directly using Javascript/jQuery/Ajax
is it possible to remove a cell from UITableView directly, with animation? Without changing
Is it possible to remove Content-transfer-encoding: 8bit from the email headers using PHPMailer?
Is it possible to remove the hash from window.location without causing the page to
Is it possible to remove a file, with all version history, from SVN? For

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.