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

  • Home
  • SEARCH
  • 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 6342349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:13:29+00:00 2026-05-24T20:13:29+00:00

Using pylab, I want to plot just the data with no axes or borders

  • 0

Using pylab, I want to plot just the data with no axes or borders to a png file. In code below, I still get borders to the left and right of the data.

import pylab
scores = [[ 82.,78.,    71.5,   76.,    79.5,   77.,    73.5,   70.5,   74.,    74.5 ],
[ 79. ,  75.75, 71.,   76.,   78.25, 73.25, 72.25 ,73.25, 74.75, 73.5 ],
[ 77.,   75.,   70.5,  73. ,  77.,   73.5,  71.75, 75.25, 76.75, 74.  ],
[ 76.,   74.75, 72.5,  72.25 ,75.25, 76.5,  73.5,  73.,   75.25, 75.75],
[ 75.,   72.5,  72.25, 74.5,  73.25, 73.25, 74.5,  73.25, 73.5,  76.5 ],
[ 74.5,  72.,   69.5,  73.25,  73.75,  72.,    76.75,  77.,    74.25,  76.5 ],
[ 72.5,   73.75,  72.75,  75.75,  78.,    76.75,  77.75,  78.75,  77.25,  74.  ],
[ 74.5,   74.25,  74.75,  78.75,  80.75,  79.25,  74.5,   75.,    76.25,  73.  ],
[ 75.5,   71.5,   71.75,  78.75,  80.25,  77.5,   75.,    73.25,  72.25,  72.75],
[ 77.5,   74.5,   72.,    77.75,  78.25,  74.,    76.75,  75.75,  74.25,  73.  ]]

fig = pylab.figure()
ax = fig.add_subplot(111)
ax.xaxis.set_ticklabels([None])
ax.yaxis.set_ticklabels([None])
ax.xaxis.set_ticks([None])
ax.yaxis.set_ticks([None])
ax.imshow(scores,vmin=0, vmax=100, origin='lower')
pylab.savefig('output.png',bbox_inches='tight', pad_inches=0)
  • 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-24T20:13:30+00:00Added an answer on May 24, 2026 at 8:13 pm
    import pylab
    scores = [[ 82.,78.,    71.5,   76.,    79.5,   77.,    73.5,   70.5,   74.,    74.5 ],
    [ 79. ,  75.75, 71.,   76.,   78.25, 73.25, 72.25 ,73.25, 74.75, 73.5 ],
    [ 77.,   75.,   70.5,  73. ,  77.,   73.5,  71.75, 75.25, 76.75, 74.  ],
    [ 76.,   74.75, 72.5,  72.25 ,75.25, 76.5,  73.5,  73.,   75.25, 75.75],
    [ 75.,   72.5,  72.25, 74.5,  73.25, 73.25, 74.5,  73.25, 73.5,  76.5 ],
    [ 74.5,  72.,   69.5,  73.25,  73.75,  72.,    76.75,  77.,    74.25,  76.5 ],
    [ 72.5,   73.75,  72.75,  75.75,  78.,    76.75,  77.75,  78.75,  77.25,  74.  ],
    [ 74.5,   74.25,  74.75,  78.75,  80.75,  79.25,  74.5,   75.,    76.25,  73.  ],
    [ 75.5,   71.5,   71.75,  78.75,  80.25,  77.5,   75.,    73.25,  72.25,  72.75],
    [ 77.5,   74.5,   72.,    77.75,  78.25,  74.,    76.75,  75.75,  74.25,  73.  ]]
    
    fig = pylab.figure(frameon=False)
    ax_size = [0,0,1,1]
    fig.add_axes(ax_size)
    pylab.imshow(scores,vmin=0, vmax=100, origin='lower')
    pylab.axis('off')
    ## As you noted.
    pylab.savefig('output.png',bbox_inches='tight', pad_inches=0)
    

    This should do it. Doesnt show any axises for me. All I did was add frameon=False.

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

Sidebar

Related Questions

I want to plot a confusion matrix using Pylab. The class labels along the
I have a plot in pylab which I want to clip to the borders
I created a 3D plot using matplotlib as this: fig = pylab.figure() ax =
I want to make a daily profile plot: hour vs concentrations. I'm using matplotlib
I'm trying to plot a graph in matplotlib using numpy and meshgrid. I want
I want to display images using different color maps in different figures. Following code
Without using matplotlib finance module. I like to get the url data into a
I'm trying to plot a 2D histogram in Python using these code from math
Using matplotlib/pylab.... How do I plot 5 heatmaps as subplots which have the same
I have a working Python 2.6 code using matplotlib, and would like to get

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.