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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T19:29:35+00:00 2026-06-18T19:29:35+00:00

I want to use matplotlib to draw more or less the figure I attached

  • 0

I want to use matplotlib to draw more or less the figure I attached below, which includes the two intersecting planes with the right amount of transparency indicating their relative orientations, and the circles and vectors in the two planes projected in 2D.

I’m not sure if there is an existing package for doing this, any hints?image credit: M Strassler

  • 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-06-18T19:29:37+00:00Added an answer on June 18, 2026 at 7:29 pm
    from mpl_toolkits.mplot3d import axes3d
    import matplotlib.pyplot as plt
    import numpy as np
    
    
    fig = plt.figure()
    ax = fig.add_subplot(111, projection='3d')
    
    dim = 10
    
    X, Y = np.meshgrid([-dim, dim], [-dim, dim])
    Z = np.zeros((2, 2))
    
    angle = .5
    X2, Y2 = np.meshgrid([-dim, dim], [0, dim])
    Z2 = Y2 * angle
    X3, Y3 = np.meshgrid([-dim, dim], [-dim, 0])
    Z3 = Y3 * angle
    
    r = 7
    M = 1000
    th = np.linspace(0, 2 * np.pi, M)
    
    x, y, z = r * np.cos(th),  r * np.sin(th), angle * r * np.sin(th)
    
    ax.plot_surface(X2, Y3, Z3, color='blue', alpha=.5, linewidth=0, zorder=-1)
    
    ax.plot(x[y < 0], y[y < 0], z[y < 0], lw=5, linestyle='--', color='green',
            zorder=0)
    
    ax.plot_surface(X, Y, Z, color='red', alpha=.5, linewidth=0, zorder=1)
    
    ax.plot(r * np.sin(th), r * np.cos(th), np.zeros(M), lw=5, linestyle='--',
            color='k', zorder=2)
    
    ax.plot_surface(X2, Y2, Z2, color='blue', alpha=.5, linewidth=0, zorder=3)
    
    ax.plot(x[y > 0], y[y > 0], z[y > 0], lw=5, linestyle='--', color='green',
            zorder=4)
    
    plt.axis('off')
    plt.show()
    

    result

    caveats:

    • I am running a version very close to the current master, so I am not
      sure what will work in older versions

    • The reason for splitting up the plotting is that ‘above’ and ‘below’ are determined in a some what arcane way (I am not strictly sure the zorder actually does anything), and is really dependent on the order the artists are drawn in. Thus surfaces can not intersect (one will be above the other every where), so you need to plot the sections on either side of the intersection separately. (You can see this in the black line which I didn’t split at looks like it in ‘on top of’ the upper blue plane).

    • The ‘proper’ ordering of the surfaces also seems to be dependent on the view angle.

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

Sidebar

Related Questions

I want to use matplotlib to illustrate the definite integral between two regions: x_0,
Want use special charecters ex : (£, ¥) which not there in keyboard to
I'm using mac mountain lion(10.8.1) and python(2.7.3). And I want to use python matplotlib,
I want to draw 3D primitives like spheres, cylinders and planes (patches) in a
I want to use matplotlib from my Sublime Text 2 directly via the build
My tags and title quite clearly state my problem. I want to use matplotlib
I want to use the plot method of the matplotlib and plot 2 arrays.
I want to use a python module on my django website (matplotlib) that isn't
I want use A-Z buttons on a html page like shown below (only sample
I want to use a color map from http://goo.gl/5P4CT for my matplotlib heat map.

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.