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
6
votes
1 answer

mplot3D fill_between extends over axis limits

I have questions related to creating a simple lineplot in Python with mplot3D where the area under the plot is filled. I am using Python 2.7.5 on RedHatEnterprise 7.2, matplotlib 1.2.0 and numpy 1.7.2. Using the code below, I am able to generate a…
Annika
  • 137
  • 2
  • 7
6
votes
1 answer

How to stack 3d bar charts

Essentially a 3d version of this: Plot two histograms at the same time with matplotlib Though I don't know how to do it since I am using Axes 3d. from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np kets =…
M.V.
  • 121
  • 2
  • 9
6
votes
1 answer

Can I plot several histograms in 3d?

I'd like to plot several histograms similar to the way thesebar graphs are plotted. I've tried using the arrays returned by hist, but it seems that the bin edges are returned, so I can't use them in bar. Does anyone have any suggestions?
Demetri Pananos
  • 6,770
  • 9
  • 42
  • 73
6
votes
1 answer

3D plot with an 2D array

I have 2 1D arrays with the values of x and y, and also a 2D array with the values of z for each point where the columns correspond to the x values and the rows to the y values. Is there any way to get a plot_surface with this data? when I try to do…
Numlet
  • 819
  • 1
  • 9
  • 21
6
votes
1 answer

Scaled colormap of facecolors with mplot3d

I have a simple task that should have a simple solution, but I have been trying for days now. I try to be specific. I try to plot a surface using matplotlib's mplot3d and plot_surface. When I plot the surface of a dataset 'z' and try to scale the…
Niels
  • 153
  • 1
  • 6
5
votes
1 answer

How to plot 3D multiple Linear Regression with 2 features using matplotlib?

I need to plot a 3D plot with multiple Linear Regression with 2 features in matplotlib. How can I do that? this is my code: import pandas from sklearn import linear_model df = pandas.read_csv("cars.csv") X = df[['Weight', 'Volume']] y =…
Sajjad Aemmi
  • 2,120
  • 3
  • 13
  • 25
5
votes
2 answers

Setting tick colors of matplotlib 3D plot

If I have a 3D matplotlib plot (Axes3D object), how do I change the color of the tick marks? I figured out how to change the color of the axis line, the tick labels, and the axis label. The obvious solution, use ax.tick_params(axis='x',…
drhagen
  • 8,331
  • 8
  • 53
  • 82
5
votes
1 answer

Changing the position of an axis on a Axes3D

I am using mplot3d from the mpl_toolkits library. When displaying the 3D surface on the figure I'm realized the axis were not positioned as I wished they would. Let me show, I have added to the following screenshot the position of each axis: Is…
Ivan
  • 34,531
  • 8
  • 55
  • 100
5
votes
1 answer

Drawing a righthand coordinate system in mplot3d

I want to create plots from Python of 3D coordinate transformations. For example, I want to create the following image (generated statically by TikZ): A bit of searching led me to the following program: import numpy as np from matplotlib import…
Moti
  • 53
  • 1
  • 7
5
votes
2 answers

Plot a curve in 3D with Sympy

How to plot the following 3D curve (as an example) using Sympy? I know just create an array for t and do this in Matplotlib, but I don't really want to plot this curve, rather to learn how to define and plot curves symbolically. alpha(t) = (cos(t),…
Mark
  • 672
  • 1
  • 6
  • 19
5
votes
1 answer

Line colour of 3D curve from an array with matplotlib

I want to draw a 3D line of points with different color in the Z turn. I use the Visual Studio 2013 with Python and I have to read an .json (XML-Style) file and draw it (X,Y,Z) to a 3D Diagram. So I got a curve with one color: I want to have it…
P_Gabriel
  • 53
  • 3
5
votes
1 answer

matplotlib contourf3d plot_surface vs. trisurf

I'm trying to do this with my data that has the following structure: 0.90000000 0.90000000 -2133.80472139 0.90000000 0.95000000 -2133.84134433 ... 1.87500000 1.82500000 -2133.96171262 1.87500000 1.87500000 -2133.95550450 With the…
5
votes
1 answer

Color-mapping a 3D quiver function

I have created a lovely 3D displacement vector field in python using Matplotlib and I am happy with the results. However, visually it is not very east to see the magnitude of the displacements only the direction. Is there a way in python that I…
5
votes
1 answer

Add background image to 3d plot

This topic has been touched here, but no indications were given as to how to create a 3D plot and insert an image in the (x,y) plane, at a specified z height. So to come up with a simple and reproducible case, let's say that I create a 3D plot like…
FaCoffee
  • 7,609
  • 28
  • 99
  • 174
5
votes
0 answers

mplot3d axis limits do not corresponding to walls

I am attempting to create a plane in an mplot3d plot that touches all axes walls. The axes limits are set using ax.set_xlim(-6.0,6.0) or ax,set_xlim3d(-6.0,6.0). In both cases, the walls are drawn slightly outside the specified limits. Drawing my…
Annika
  • 137
  • 2
  • 7