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
0
votes
0 answers

Inform an existing Axes that it is a 3D Axes

For me, the most convenient way to instantiate a figure with a regular grid of subplots is matplotlib.pyplot.subplots but I cannot specify which type of projection is desired for the subplots In [45]: from matplotlib.pyplot import subplots ...:…
gboffi
  • 22,939
  • 8
  • 54
  • 85
0
votes
1 answer

Compressing vertical extent in 3-D MatPlotLib figures

I'm working with 2-D matrices, where the entries are elevation, and am trying to plot them with MatPlotLib mplot3d. How can I adjust the vertical height of the resulting figure? To give an example, pulling from code in the mplot3d tutorial: from…
0
votes
1 answer

Plotting Points on a Sphere

I am trying to generate random, uniformly distributed points on a sphere. However, the code is creating points that seem to create a disk instead. I believe that the issue resides in the "phirand" definition. Is the math there not correct? I used…
Tom
  • 55
  • 6
0
votes
1 answer

Extend a 2D plot to 3D

I'm trying to show my 2D data on a 3D space. Here is my code below: import numpy as np import matplotlib.pyplot as plt i = 60 n = 1000 r = 3.8 eps = 0.7 y = np.ones((n, i)) # random numbers on the first row of array x np.random.seed(1) x =…
0
votes
0 answers

Colormap in mplot3d not corresponding to Z values?

I'm trying to create a 3D plot of a spectrogram and it may just be a misunderstanding on my part about how plot_surface works, but I expect the colours on the plot to correspond to the Z-value, or the height of the plot. Instead, I get this Smaller…
Petra
  • 195
  • 1
  • 1
  • 10
0
votes
0 answers

Limiting the axes on a mplot3d surface without the graph spilling from the figure?

I'm attempting to make a 3D surface plot of a spectrogram, but I want to limit the axes to a certain frequency and time range. I've tried the following: fig = plt.figure(figsize=(1,1)) ax =…
Petra
  • 195
  • 1
  • 1
  • 10
0
votes
1 answer

scatter3D with interact is flat

I am learning this tutorial. In cell [13], it has the following code: from mpl_toolkits import mplot3d def plot_3D(elev=30, azim=30, X=X, y=y): ax = plt.subplot(projection='3d') ax.scatter3D(X[:, 0], X[:, 1], r, c=y, s=50, cmap='autumn') …
AlwaysLearning
  • 7,257
  • 4
  • 33
  • 68
0
votes
1 answer

Changing the number size on a 3d plot for the z axis in python

I know this seems like a really simple question, but does anyone know how to change the sizes of the numbers for the z axis in a 3d plot like the one below? I know how to do it for the x axis and y axis where I would use plt.xticks(size=20) …
SeanL
  • 19
  • 7
0
votes
1 answer

Adjusting the location of the tick marks on a 3d bar plot

Attached below is a code that will create the 3d bar plot below. The problem I am having is with the x axis ticks and the y axis ticks. They do not match up with the 3d bars on the graph. I would like them to match up with the 3d bars for both the x…
SeanL
  • 19
  • 7
0
votes
1 answer

How to draw simple 3d axis in python3?

I would like to have names of axes as in the figure.
Archie
  • 93
  • 2
  • 9
0
votes
1 answer

Setting a different color below a certain value

I am new to constructing 3D plots on Python. I am working on a code in which i am given the data of a ship, in terms of values of different sections. I have successfully been able to arrange the data in a form in which it gives a complete 3D plot of…
Zeeshan Rizvi
  • 66
  • 1
  • 2
0
votes
0 answers

How to plot a 3d bar chart/histogram + colors with python?

I want to plot a 3d bar chart or histogram with python (or scatter ..), and rappresent the color of each bar according to a matrix. The heightness of each bar is in the matrix "z". The color of each single bar should change according to the numeric…
roy
  • 35
  • 1
  • 1
  • 4
0
votes
0 answers

Make scatter plot of RGB values color of values python matplotlib

I want to plot the same pixel across multiple frames onto a 3d scatter plot - I have managed to get the plot working however I want the colour of each point to be the colour its values represent. I have tried building an array of all the rgb values…
TisButaScratch
  • 163
  • 1
  • 5
  • 17
0
votes
0 answers

Plotting a solution of pde which is on a matrix, with a non square grid

I solved one hyperbolic pde using 4096 points in x-axis and 10000 points in t-axis, so now I have a matrix u with 4096 lines and 10000 columns, i.e. for every point on x-axis I have solve a ode in t. So now I need to see the solution on a 3d graph,…
mcirqueira
  • 11
  • 1
  • 2
0
votes
0 answers

Setting axes to semilog with Mayavi 3D plot

I'm sucessfully generating a 3D plot with Mayavi, but can't find any way to rescale the axes to a semilog representation. Is this possible? I also tried taking a screenshot (as suggested by another answer I read before), which I placed after my…