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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:05:01+00:00 2026-05-26T19:05:01+00:00

Using matplotlib in Python I drew a 3D graph. When I rotate the graph

  • 0

Using matplotlib in Python I drew a 3D graph. When I rotate the graph I noticed that the axes labels swap automatically which does not look interesting or helping to me. In fact it disturbs my focusing on the purpose of rotation which is to explore visually the presented data.

Q: How to disable auto-swapping axes labels while rotating in matplotlib?

  • 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-26T19:05:02+00:00Added an answer on May 26, 2026 at 7:05 pm

    I grabbed some ideas from SO, examined many and finally developed the following solution. It simply works.

    
    from __future__ import division
    import scipy as sp
    import mpl_toolkits.mplot3d as a3d
    import pylab as pl
    
    nan = sp.nan
    
    def axesoff():
        box = [[-1,1,1,-1,-1,1,1,-1,-1,-1,nan,1,1,nan,1,1,nan,-1,-1],
               [-1,-1,-1,-1,1,1,1,1,-1,-1,nan,-1,1,nan,1,-1,nan,1,1],
               [-1,-1,1,1,1,1,-1,-1,-1,1,nan,-1,-1,nan,1,1,nan,-1,1]]
        ax3.plot(*box,color='k')
        for axis in (ax3.w_xaxis,ax3.w_yaxis,ax3.w_zaxis):
            for obj in axis.get_ticklines(): obj.set_visible(False)
            axis.set_ticklabels('')
            axis.line.set_visible(False)
            axis.pane.set_visible(False)
        ax3.grid(False)
        ax3.axis('equal')
    
    #------here we go
    x,y,z = sp.random.uniform(low=-1,high=1,size=(3,1000))
    c = (x+1)+(y+1)+(z+1)
    s = c*10
    ax3 = a3d.Axes3D(pl.figure())
    ax3.scatter(x,y,z,lw=0,s=s,c=c,alpha=0.5)
    
    axesoff()
    
    pl.show()
    

    enter image description here

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

Sidebar

Related Questions

I have a Python program that generates a histogram using matplotlib. The problem is
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
I am using matplotlib in Python to plot a line with errorbars as follows:
I installed matplotlib using the Mac disk image installer for MacOS 10.5 and Python
I need to plot a stem plot of my signal using python and matplotlib.
I want to generate high-quality diagrams for a presentation. I’m using Python’s matplotlib to
I'm using the function imagesc from matplotlib in python or octave to display a
It's likely that this is just a general Python Tkinter question, not necessarily a
I've created a small PyQt based utility in Python that creates PNG graphs using
I'm using python + matplotlib and I'm having two plots share an axis. If

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.