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
11
votes
2 answers

Line3DCollection multicolored line edges are "jagged"

Based on the matplotlib example code I constructed a 3D version of a multicolored line. I am working in a jupyter notebook and by using %matplotlib notebook I may zoom into the plot and the corner edges are rendered smoothly in my browser - perfect!…
eotp
  • 312
  • 3
  • 13
11
votes
1 answer

2D plots are not sitting flush against 3D-axis walls in python mplot3D

I'm attempting to plot 2D data onto a 3D axis. I have the 3D shape working using ax.plot_surface but I'm unable to get the 2D data to sit flush against the axis walls using ax.plot. Here is a stripped down example code showing the issue I'm having…
Timballisto
  • 315
  • 3
  • 14
11
votes
2 answers

How can I plot hysteresis in matplotlib?

I am trying to plot a the development of a pitchfork bifurcation over time. The relationship between x and y starts off approximately linear, but ends up being a sigmoidal S shape. The final relationship is not a function; there are multiple y…
Daniel Power
  • 645
  • 9
  • 22
10
votes
1 answer

How to plot a 3D patch collection in matplotlib?

I'm trying to make a 3D plot in matplotlib with three circles on it, each centered at the origin and with a radius of 1, pointing in different directions - to illustrate a sphere of radius 1, for example. In 2D I would make a circle patch collection…
ptomato
  • 56,175
  • 13
  • 112
  • 165
10
votes
3 answers

3D parametric curve in Matplotlib does not respect zorder. Workaround?

I am designing a three-dimensional illustration using Matplotlib. All is working nicely, except that the (red) parametric curve gets the wrong zorder while the (green) parametric surface is drawn completely correctly. Output generated by code…
mjo
  • 189
  • 1
  • 7
10
votes
1 answer

Plot contours of distribution on all three axes in 3D plot

I have a cloud of points in three-dimensional space, and have estimated some distribution over those points (also in 3D space; using kernel density estimation although that's irrelevant for this question). I would like to plot the projection of that…
EelkeSpaak
  • 2,757
  • 2
  • 17
  • 37
10
votes
2 answers

Changing the line color in plot_surface

I did a surface plot with some data in Python. Now I tried to change the style of such a plot. But unfortunately I am stuck in the line color. It's default is black, but I want to make it red or any other color. My code is: from…
Andy
  • 1,072
  • 2
  • 19
  • 33
9
votes
2 answers

Why Z has to be 2-dimensional for 3d plotting

I am trying to plot 3d Surface plots using code from this site using matplotlib: X,Y and Z are obtained as below: from math import pi from numpy import cos, meshgrid alpha = 0.7 phi_ext = 2 * pi * 0.5 def flux_qubit_potential(phi_m, phi_p): …
rnso
  • 23,686
  • 25
  • 112
  • 234
9
votes
0 answers

Matplotlib 3D workaround for plot order

I know that matplotlib 3D is not reliable for plotting multiple 3D objects (planes, lines, points) in the right order: please see Matplotlib 3D plot zorder issue and How to draw intersecting planes?. However these questions seem quite old, so the…
Chutlhu
  • 195
  • 2
  • 10
9
votes
1 answer

Covering 2D plots with 3D surface

I am attempting to take many xz plots, each at various y values, and overlay a surface. I have seen many examples of how to plot 3D surfaces in python, but aside from this post, nothing seems to match my inquiry very closely. The image of what I…
elarr
  • 341
  • 1
  • 2
  • 17
9
votes
1 answer

Remove 3D plot's white spaces in mixed 2D/3D subplots

I am having trouble removing the excessive white spaces when mixing 2D and 3D subplots. For pure 3D subplots, I can adjust the region being plotted with fig.subplots_adjust() to remove the white spaces, see here. However, the same trick doesn't work…
Phyinmi
  • 450
  • 7
  • 15
9
votes
1 answer

mplot3d animation with transparent background

I want to generate some gifs with transparent background using matplotlib. I tried different options but I can't get my files with transparent background. With the current setup I get the first frame like that but not the rest. The following is my…
nicoguaro
  • 3,629
  • 1
  • 32
  • 57
9
votes
1 answer

Set/get 3d viewing direction for Matplotlib Axes3D

I'm just learning Matplotlib, so I'm going straight for stereo visualisation. I've already built the mirrors to view the screen, and have got left and right figures updating interactively the right distance apart. What I need to do now is to…
Neil_UK
  • 1,043
  • 12
  • 25
9
votes
2 answers

Plotting non uniform data in 3D surface

I have a simple code to plot the points in 3D for Matplotlib as below - from mpl_toolkits.mplot3d import axes3d import matplotlib.pyplot as plt import numpy as np from numpy import genfromtxt import csv fig = plt.figure() ax = fig.add_subplot(111,…
Raj
  • 3,300
  • 8
  • 39
  • 67
8
votes
1 answer

How to define a plane with 3 points, and plot it in 3D?

I have 3 points in 3D space and I want to define a plane passing through those points in 3D. X Y Z 0 0.65612 0.53440 0.24175 1 0.62279 0.51946 0.25744 2 0.61216 0.53959 0.26394 Also I need to plot that in 3D space.
Upriser
  • 418
  • 2
  • 7
  • 23
1 2
3
26 27