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

Difference between ax.set_xlabel() and ax.xaxis.set_label() in MatplotLib 3.0.1

(This may be a naive question. Pardon me if so.) I am using Python 3.7.1 and MatplotLib 3.0.1. In below simple code, I used different ways to assign labels to axes. They seem to be equivalent from an OO perspective. But only the x axis label shows.…
smwikipedia
  • 61,609
  • 92
  • 309
  • 482
8
votes
1 answer

Attaching intensity to 3D plot

The code below generates a 3D plot of the points at which I measured intensities. I wish to attach a value of the intensity to each point, and then interpolate between the points, to produce a colour map / surface plot showing points of high and low…
emc3636
  • 93
  • 1
  • 5
8
votes
1 answer

Drawing 3D sphere with circumferences

I'm trying to draw a sphere like this one using matplotlib: but I can't find a way of having a dashed lines on the back and the vertical circumference looks a bit strange import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d…
Red
  • 664
  • 2
  • 10
  • 20
8
votes
2 answers

Matplotlib 3D plot use colormap

I am trying to use ax.scatter to plot a 3D scattering plot. I've read the data from a fits file and stored data from three column into x,y,z. And I have made sure x,y,z data are the same size. z has been normolized between 0 and 1. import numpy as…
frankgut
  • 125
  • 1
  • 2
  • 8
8
votes
1 answer

How do I plot a projection of 3D scatter data on the XY/XZ/YZ planes?

I have 4D data (3D scatter points + color) plotted using matplotlib's mplot3d library. To aid in parsing how the cloud of points is distributed in space, I'd like to show a projection of the cloud across each of the 3 planes (XY, XZ, YZ) using a 2D…
paradiso
  • 379
  • 3
  • 14
8
votes
1 answer

How to get properties of picked object in mplot3d (matplotlib + python)?

I plot a series of points using mplot3d: import pylab as p import mpl_toolkits.mplot3d.axes3d as p3 fig = p.figure() ax = fig.add_subplot(111, projection='3d') ax.scatter([1], [0], [0], c='r', marker='^', picker=5) ax.scatter([0], [1], [0], c='g',…
user1371437
  • 81
  • 1
  • 2
7
votes
1 answer

Getting rid of artifacts/grid-lines when plotting 3d surfaces

When plotting surfaces using mpl_toolkits.mplot3d.Axes3D.plot_surface(), lines appear that seem to follow the curve of the surfaces being plotted. For example: X, Y = numpy.meshgrid(numpy.arange(some_range), numpy.arange(some_other_range)) Z1, Z2 =…
Chinmay Kanchi
  • 62,729
  • 22
  • 87
  • 114
7
votes
1 answer

Correctly setting the axes limits in 3d plots

I'm having an issue with setting limits for my 3d plots in matplotlib; I'm finding that no matter how I set my limits for the x,y, and z axes, the plotting routine for 3dplots adds an extra buffer. from mpl_toolkits.mplot3d import Axes3D from…
aarogers
  • 71
  • 1
  • 1
  • 2
7
votes
1 answer

Change bar color in a 3D bar plot based on value

I have a 3D bar plot in matplotlib which consists of a total 165 bars and at the moment it is quite chaotic. . I would like to change the colour of the bars based on the discreet z-values: 0,1,2. I know there is the option to change colour bar…
Helena K
  • 469
  • 2
  • 6
  • 15
7
votes
0 answers

How to plot efficiently a large number of 3D ellipsoids with matplotlib (Axes3D)?

I'm currently processing strain data with python and use matplotlib (v. 1.5.1) to create various graphical outputs for finite strain ellipsoids. Processing 1000s of ellipsoids parameters is quite fast (I'm reusing some sweet python code available…
7
votes
2 answers

Contourf on the faces of a Matplotlib cube

I am trying to 'paint' the faces of a cube with a contourf function using Python Matplotlib. Is this possible? This is similar idea to what was done here but obviously I cannot use patches. Similarly, I don't think I can use add_collection3d like…
Chris
  • 73
  • 1
  • 6
7
votes
1 answer

matplotlib plotting multiple lines in 3D

I am trying to plot multiple lines in a 3D plot using matplotlib. I have 6 datasets with x and y values. What I've tried so far was, to give each point in the data sets a z-value. So all points in data set 1 have z=1 all points of data set 2 have…
WMrioa
  • 73
  • 1
  • 1
  • 3
7
votes
2 answers

set_xlim,set_ylim,set_zlim commands in matplotlib fail to clip displayed data

I'm building a GUI with Tkinter and ttk and using matplotlib in order to creat interactive plots - again, like millions other people do. Even though most problems I encountered so far are well documented, this one seems rare: When plotting in 3d and…
lyvic
  • 197
  • 1
  • 11
7
votes
1 answer

Edgelines vanish in mplot3d surf when facecolors are specified

I have produced the following surface plot in matlab: and I need to create this in .NET instead. I'm hoping to use IronPython to do this. But first I am just trying to create the plot in Python (PyLab). This is what I have so far: Please have a…
Dan
  • 45,079
  • 17
  • 88
  • 157
7
votes
2 answers

How would you represent the following 3D data in Matplotlib or Mayavi?

I have a large set of data which I'm trying to represent in 3D hoping to spot a pattern. I've spent quite some time reading, researching and coding, but then I realized my main problem is NOT the programming, but actually choosing a way to visualize…
Zambi
  • 363
  • 1
  • 3
  • 9