contourmayavimayavi.mlab

Creating a fence diagram in Mayavi or Matplotlib


working with Matplotlib I have produced some resistivity cross sections of the soil, obtaining pictures like this:

enter image description here

Now I would like to display all those sections in 3D so as to visualise better the spatial distribution of resistivity in the field (i.e. a so-called fence diagram). I would also like to plot the 2D map of the site where those measurements were carried out at the base of my plot (say on the XY plane). As far as I have seen this is not feasible (or at least not convenient) with Matplotlib in 3D hence I decided to switch to Mayavi. My questions are:

  1. is it feasible georeferenced rasters and then properly place them on the correct (vertical) planes (not necessarily parallel to the cartesian ones) with Mayavi? Does imshow() serves this purpose?
  2. is it better to recreate the contours in Mayavi at the proper locations? If this is the case I did not find a function to create contours from unstructured data (the input images were created with tricontour/tricontourf in Matplotlib). I do not think interpolating over a structured grid in scipy would do, given the non convex domain.

Solution

  • Ok, answering my own question:

     mesh = mlab.triangular_mesh
     surf = mlab.pipeline.surface(mesh)
    

    seems to do the job. To be consistent with the previous work, the triangulation, duly masked, can be directly imported from Matplotlib.