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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T13:07:17+00:00 2026-05-22T13:07:17+00:00

I have a 3-dimensional numpy array. I’d like to display (in matplotlib) a nice

  • 0

I have a 3-dimensional numpy array. I’d like to display (in matplotlib) a nice 3D plot of an isosurface of this array (or more strictly, display an isosurface of the 3D scalar field defined by interpolating between the sample points).

matplotlib’s mplot3D part provides nice 3D plot support, but (so far as I can see) its API doesn’t have anything which will simply take a 3D array of scalar values and display an isosurface. However, it does support displaying a collection of polygons, so presumably I could implement the marching cubes algorithm to generate such polygons.

It does seem quite likely that a scipy-friendly marching cubes has already been implemented somewhere and that I haven’t found it, or that I’m missing some easy way of doing this. Alternatively I’d welcome any pointers to other tools for visualising 3D array data easily usable from the Python/numpy/scipy world.

  • 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-22T13:07:17+00:00Added an answer on May 22, 2026 at 1:07 pm

    Just to elaborate on my comment above, matplotlib’s 3D plotting really isn’t intended for something as complex as isosurfaces. It’s meant to produce nice, publication-quality vector output for really simple 3D plots. It can’t handle complex 3D polygons, so even if implemented marching cubes yourself to create the isosurface, it wouldn’t render it properly.

    However, what you can do instead is use mayavi (it’s mlab API is a bit more convenient than directly using mayavi), which uses VTK to process and visualize multi-dimensional data.

    As a quick example (modified from one of the mayavi gallery examples):

    import numpy as np
    from enthought.mayavi import mlab
    
    x, y, z = np.ogrid[-10:10:20j, -10:10:20j, -10:10:20j]
    s = np.sin(x*y*z)/(x*y*z)
    
    src = mlab.pipeline.scalar_field(s)
    mlab.pipeline.iso_surface(src, contours=[s.min()+0.1*s.ptp(), ], opacity=0.3)
    mlab.pipeline.iso_surface(src, contours=[s.max()-0.1*s.ptp(), ],)
    
    mlab.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 multi-dimensional array right now that looks like this: function art_appreciation_feeds() {
I have a 2 dimensional array, like so: char[,] str = new char[2,50]; Now,
I have a one-dimensional array of strings in JavaScript that I'd like to turn
Okay, I have a multi-dimensional array which is statically-allocated. I'd very much like to
I have a 2 dimensional array which is like that; $results[$i][$j]->title; $results[$i][$j]->snippet; $results[$i][$j]->link; It
I have a two dimensional array that I need to load data into. I
I have a 2-dimensional array of objects and I basically want to databind each
I have a two-dimensional array (of Strings) which make up my data table (of
A cancer CT picture is stored inside a unsigned short array (1-dimensional). I have
Inspired by Raymond Chen's post , say you have a 4x4 two dimensional array,

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.