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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:01:02+00:00 2026-05-22T02:01:02+00:00

Dear all. I was exploring matplotlib’s 3d plot capabilities yesterday (and was pleasantly surprised,

  • 0

Dear all. I was exploring matplotlib’s 3d plot capabilities yesterday (and was pleasantly surprised, it looks good). Just to be clear, with

from mpl_toolkits.mplot3d import Axes3D

However, when I try to continuously redraw the plot with draw(), I get the error that draw() (for 3d plots) takes an additional argument aside from self. This argument is called renderer, and is not optional. Looking through the code for 3d axes, I couldn’t find a specification of what I should put as renderer.

Do you have any idea how I should work around this problem? Just to be clear, I can use draw() with normal plots (turning ion() on etc.), so my issue is only with Axes3D.

Basically, I want to mimick some code I already wrote in matlab, which draws a 3d plot and then updates it (with drawnow()).

EDIT: I realized that the renderer argument might be computer specific. I am sitting on a Windows with the Enthought installation of Python. If you need more information, let me know.

  • 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-22T02:01:03+00:00Added an answer on May 22, 2026 at 2:01 am

    EDIT: I take it back. You can get it from fig.canvas.renderer. I’ll leave the example below, though.


    There does not appear to be a documented way to get the renderer, but you can probably just peek within the axes structure at the _cachedRenderer. Note that you have to cause a plot to draw before this is set.

    See the last line of this example:

    from mpl_toolkits.mplot3d import Axes3D
    from matplotlib import cm
    from matplotlib.ticker import LinearLocator, FixedLocator, FormatStrFormatter
    import matplotlib.pyplot as plt
    import numpy as np
    
    fig = plt.figure()
    ax = fig.gca(projection='3d')
    X = np.arange(-5, 5, 0.25)
    xlen = len(X)
    Y = np.arange(-5, 5, 0.25)
    ylen = len(Y)
    X, Y = np.meshgrid(X, Y)
    R = np.sqrt(X**2 + Y**2)
    Z = np.sin(R)
    
    
    
    colortuple = ('y', 'b')
    colors = np.empty(X.shape, dtype=str)
    for y in range(ylen):
        for x in range(xlen):
            colors[x, y] = colortuple[(x + y) % len(colortuple)]
    
    surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, facecolors=colors,
            linewidth=0, antialiased=False)
    
    ax.set_zlim3d(-1, 1)
    ax.w_zaxis.set_major_locator(LinearLocator(6))
    ax.w_zaxis.set_major_formatter(FormatStrFormatter('%.03f'))
    
    plt.draw()
    print ax._cachedRenderer
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

dear all, i'll take some data from the database. and join two tables.the code
Dear all, I have a data frame which comes directly from a sensor. The
Dear all, i want to show some data in one row from 1 column
Dear all, I am writing a python program that is retrieving edifact log messages
Dear all, I save formatted text (bold, changed in font, style...etc) in an nvarchar(max)
Dear all, I have a question about Facebook Page: ( NOT user profile page,
Dear all: In advance, thank you for your time. Lately, I have decided to
Dear all, I now have a preliminary macro (defmacro key-if(test &key then else) `(cond
Dear all,I am now using a webtool http://fiddesktop.cs.northwestern.edu/mmp/scrape?url= to parse a webpage. For example,we
Dear all,Now i have this question in my java program,I think it should be

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.