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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:31:15+00:00 2026-05-25T18:31:15+00:00

I have a 256×256 numpy-array of data which is constantly being changed. on every

  • 0

I have a 256×256 numpy-array of data which is constantly being changed. on every iteration I take a snapshot to make a movie. snapshot is a 3d surface plot made using matplotlib.

The problem is that plotting costs me >2 seconds on every iteration which is about 600 seconds for 250 iterations. I had the same program running in MATLAB and it was 80-120 seconds for the same number of iterations.

The question: are there ways to speed up matplotlib 3d surface plotting or are there faster plotting tools for python?

Here is some of the code:

## initializing plot

fig = plt.figure(111)
fig.clf()
ax = fig.gca(projection='3d')
X = np.arange(0, field_size, 1)
Y = np.arange(0, field_size, 1)
X, Y = np.meshgrid(X, Y)

## the loop

start_time = time.time()
for k in xrange(250):
    it_time = time.time()
    field[128,128] = maxvalue
    field = scipy.ndimage.convolve(field, kernel)
    print k, " calculation: ", time.time() - it_time, " seconds"
    it_time = time.time()
    ax.cla()
    ax.plot_surface(X, Y, field.real, rstride=4, cstride=4, cmap=cm.hot,
        linewidth=0, antialiased=False)
    ax.set_zlim3d(-50, 150)
    filename = "out_%d.png" % k
    fig.savefig(filename)
    #fig.clf()
    print k, " plotting: ", time.time() - it_time, " seconds"
print "computing: ", time.time() - start_time, " seconds"
  • 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-25T18:31:16+00:00Added an answer on May 25, 2026 at 6:31 pm

    GNUplot (accessed through it’s various python interfaces) may be faster. At least I knew someone a few years ago with a similar problem to yours and after testing a number of packages they went with GNUplot. It’s not nearly as good looking as matplotlib though.

    Also, I assume you have interactive mode turned off.

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

Sidebar

Related Questions

I have some 256-character strings of hexadecimal characters which represent a sequence of bit
I have a library which expects a array and fills it. I would like
I have an array of 256 values. Those 256 values were calculated in some
I have a byte[] in Java which reports its length as 256 bytes which
I have an application which I have made a 256 x 256 Windows Vista icon
I have a binary column which contains 256-bit checksums. I can store the checksums
So I have the two array of size 256 like this: int arrayOne[] =
I am creating the validation dynamically and have hit a 256 character limit. My
I need to have a Win32 application load a hard coded AES-256 key, ideally
I have a Full Speed device that specifies the max packet size as 256

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.