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

Plot 2D array of (x,y,z) points in 3D space (Matplotlib)

I'm a beginner in Python and specially in Matplotlib. I have a 22797x3 array, built from a multiplication between two other arrays, one 22797x400 long and the other 400x3 long. In the resulted array (22797x3),each line represents a point with…
E. AMARAL
  • 949
  • 1
  • 10
  • 20
0
votes
0 answers

What is the difference between surf and trisurf

Various plotting libraries have "surface plot" and "tri-surface plot" functions. (Are all of the following actually analogous to each other?) These seem to have similar arguments and the demos I've found do similar things. matplotlib has…
dkv
  • 6,602
  • 10
  • 34
  • 54
0
votes
1 answer

3D graph not showing Python

I am testing code I found on matplotlib (https://matplotlib.org/gallery/mplot3d/subplot3d.html?highlight=matplotlib%20pyplot%20plot) to test 3d graphs I added this line -> import matplotlib …
user7988458
0
votes
0 answers

Reducing axis length while maintaining equal aspect ratio in 3D plot

I am trying to create a 3-D plot and a 2-D plot side-by-side in python. I need equal aspect ratios for both plots, which I managed using code provided by this answer: https://stackoverflow.com/a/31364297/125507. The problem I'm having now is how to…
Will S
  • 1
  • 3
0
votes
1 answer

Python 3d diagram with matplotlib

I'm trying to create a diagram inspired by this one with Python. Here is the code: from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import numpy as np V = np.linspace(0.01, 1000, 500) T = np.linspace(0.01, 1000, 500) #n = 1.…
0
votes
0 answers

3D scatter_plot across 3D surface_plot

With the following code I try to plot a single scatter point over a 3D surface plot. But it is not working. Have tried Axes3D.text(x, y, z, s, zdir=None, **kwargs) instead of Axes3D.scatter(xs, ys, zs=0, zdir='z', s=20, c=None,…
2Obe
  • 3,570
  • 6
  • 30
  • 54
0
votes
2 answers

how to plot a 3d graph in python using matplotlib?

I am new to python and matplotlib, I want to plot a line graph and I have 3 arrays: np.append(self.arraynv,nv) np.append(self.arraysvdb,Svdb) np.append(self.arraykclen,kclen) which I want to be x, y and z axis points respectively the code I…
Sanju
  • 115
  • 1
  • 13
0
votes
1 answer

Faster way for a for loop with vstack in Python Numpy using mpl_toolkits.mplot3d

i want to plot a STL file. I've allready got my Vertex's of the STL-File. The Aim is to get the faces of each triangulation which will done by vtx=np.vstack((Vertex1[i],Vertex2[i],Vertex3[i])) so you can see every n'th entry of…
Search898
  • 69
  • 6
0
votes
1 answer

No module named externals in mplot3d

I am trying to visualize the 3d plot using mpl_toolkits.mplot3d.Axes3D with matplotlib I am using python 3 with matplot version '2.1.0' and scikit-learn verison 0.19.0. When i run the code it is producing the following error, from…
Asif Khan
  • 56
  • 8
0
votes
1 answer

How could I plot 3D grid using mplot3d and numpy array?

I am trying to plot a 3D NumPy Array which has integer values. import numpy as np def build(self): grid = np.empty((10,10,10)) grid = grid.astype(np.int) grid.fill(-1) return grid The previous method builds a 3D grid and fills with…
Sergio Rodríguez Calvo
  • 1,183
  • 2
  • 16
  • 32
0
votes
1 answer

Trying to plot surf3d from 2d array

I'm new to python and I'm trying to make a 3D Surface from 2D array, but it appears that I got an error: ValueError: shape mismatch: objects cannot be broadcast to a single shape Here is my full code import numpy as np from mpl_toolkits.mplot3d…
0
votes
1 answer

3D Surface Colormap in Python

There's another problem I'm facing now. I have a data file like the following: # Time THR-1 ALA-2 PRO-3 VAL-4 PRO-5 MET-6 PRO-7 ASP-8 LEU-9 LYS-10 ASN-11 VAL-12 LYS-13 SER-14 LYS-15 ILE-16 GLY-17 SER-18 THR-19 GLU-20 …
0
votes
1 answer

How to adjust bar's widht of 3D bar graph using matplot lib

How can I adjust width of a bar graph's bars. An image has been attached with this post, which shows the actual condition. As we can see the labels, showing years, from 2011 to 2015. I am finding a solution to reduce down the width of…
jax
  • 3,927
  • 7
  • 41
  • 70
0
votes
1 answer

Simplest way to plot separable 3D points in python

I'm implementing a Perceptron 3D, and in this case I have n points that are separable, in the case, blue dots and red dots, and I need to plots them from my dictionary, I tried to do this: training_data = { '0.46,0.98,-0.43' :…
user7314222
0
votes
1 answer

pandas 3D plot for multiple dataframes

My goal is to plot something similar to the top graph of the following link. I have several txt files, every one of them corresponding to a different sample. Currently, I have my data loaded as pandas dataframes (although I'm not sure if it could be…
Maxwell's Daemon
  • 587
  • 1
  • 6
  • 21