Questions tagged [mplot3d]

a 3D plotting toolkit which ships with the matplotlib Python plotting library.

The mplot3d toolkit adds simple 3D plotting capabilities to the plotting library.

Resources

391 questions
20
votes
4 answers

How to create a Waterfall plot

Is there a python module that will do a waterfall plot like MATLAB does? I googled 'numpy waterfall', 'scipy waterfall', and 'matplotlib waterfall', but did not find anything.
Stripers247
  • 2,265
  • 11
  • 38
  • 40
18
votes
1 answer

3D Plot with Matplotlib: Hide axes but keep axis-labels?

I am using Matplotlib to visualize three-dimensional arrays. I got it almost the way I want it, apart from a minor snag... see the illustration and the description below of what I can get it to do and what I want it to do... Show a bunch of cubes…
safl
  • 1,077
  • 3
  • 11
  • 17
18
votes
2 answers

How to disable perspective in mplot3d?

Is it possible to disable the perspective when plotting in mplot3d, i.e. to use the orthogonal projection?
user3670781
  • 183
  • 1
  • 1
  • 4
18
votes
3 answers

3D curvefitting

I have discrete regular grid of a,b points and their corresponding c values and I interpolate it further to get a smooth curve. Now from interpolation data, I further want to create a polynomial equation for curve fitting. How to fit 3D plot in…
Syeda
  • 341
  • 2
  • 5
  • 14
18
votes
2 answers

Changing position of vertical (z) axis of 3D plot

I'm doing some 3D surface plots using Matplotlib in Python and have noticed an annoying phenomenon. Depending on how I set the viewpoint (camera location), the vertical (z) axis moves between the left and right side. Here are two examples: Example…
Blink
  • 1,444
  • 5
  • 17
  • 25
18
votes
1 answer

How can I render 3D histograms?

I want to make plots like these from Hacker's Delight: What ways are there to accomplish this in Python? A solution that makes it easy to interactively adjust the graph (changing the slice of X/Y currently being observed) would be ideal. Neither…
Joseph Garvin
  • 20,727
  • 18
  • 94
  • 165
17
votes
6 answers

Error: _string_to_bool in mplot3d (workaround found)

Edit: workaround at the end of this post. I was trying to run some of the examples provided here and here. One of these examples was: from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np fig = plt.figure() ax…
Hennep
  • 1,602
  • 1
  • 11
  • 20
13
votes
3 answers

Trying to add a 3d subplot to a matplotlib figure

So I'm trying to create a figure that presents a 3d plot from data points, along with the plots 3 projections in 3 other subplots. I can add the subplots for the projections with no problems, but when I try to place the 3 dimensional plot into the…
Dane Allen
  • 131
  • 1
  • 1
  • 5
13
votes
4 answers

How to draw a parallelepiped

I am trying to draw a parallelepiped. Actually I started from the python script drawing a cube as: import numpy as np from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt points = np.array([[-1, -1, -1], [1, -1,…
rogwar
  • 143
  • 1
  • 1
  • 8
12
votes
1 answer

z-axis formatting in mplot3d

I am trying to make a surface plot in matplotlib, but I am unable to make the formatting of the z-axis look good. I want it to be on scientific notation, with the prefix along the axis and the exponent above the axis (like what you usually get in…
Magnus
  • 141
  • 2
  • 6
12
votes
2 answers

Plot 3D convex closed regions in matplotlib

I am trying to plot in 3D a polytope defined by a set of inequalities. Essentially, I try to reproduce the functionality of this matlab plotregion library in matplotlib. My approach is to get the intersection vertices, construct the convex hull of…
nikferrari
  • 187
  • 2
  • 11
12
votes
3 answers

Plot normal distribution in 3D

I am trying to plot the comun distribution of two normal distributed variables. The code below plots one normal distributed variable. What would the code be for plotting two normal distributed variables? import matplotlib.pyplot as plt import numpy…
Johanna Schacht
  • 215
  • 1
  • 4
  • 11
12
votes
1 answer

Arrows in matplotlib using mplot3d

I am trying to use matplotlib to recreate the diagram on this page: http://books.google.co.uk/books?id=sf9Qn9MS0ykC&pg=PA18 Here is what I have so far: import numpy as np from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import…
rozzy
  • 2,828
  • 6
  • 25
  • 35
12
votes
4 answers

Adding colors to a 3d quiver plot in matplotlib

I want to have colors corresponding to a colormap in my 3d quiver plot. The 2d version of the plot has an optional array that is used to map colors to the arrows. How can I create the same effect in the 3d version?
T.C. Proctor
  • 6,096
  • 6
  • 27
  • 37
12
votes
1 answer

Reverse Z Axis on matplotlib 3D Plot

How would one reverse the order on the z axis of a 3D plot (i.e. negative is up, and positive is down)? The following code produces a cone with the base pointing downward; is there a command (like ax.reverse_zlim3d(True) or something?) that can be…
Bryant
  • 664
  • 2
  • 9
  • 23
1
2
3
26 27