Carpetfizz
Carpetfizz

Reputation: 9149

How do I check what coordinate system MPL 3d uses?

In the given diagram, which axis is considered "x", "y", and "z" (I have hand colored them for ease of communication)? Furthermore, let's say I have some data that is collected in a different basis of R3. Is it recommended to do a change of basis on the new data and then plot it on MPL's standard basis (which is unknown to me), or somehow change MPL's basis to the one for my data and just plot the raw points?

enter image description here

Thanks

Upvotes: 1

Views: 47

Answers (1)

dsm
dsm

Reputation: 2253

It seems easiest to name the axis directions:

import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.set_xlabel("x")
ax.set_ylabel("y")
ax.set_zlabel("z")
plt.show()

Labeled axes on mplot3d plot Try that out with your data and you'll see how it works.

As to the second half of your question, if I'm understanding you correctly, your data is in non-cartesian R3 coordinates? Then, assuming you know the relation between your basis and the cartesian one, I'd transform your gathered data back to the usual cartesian and plot it out that way.

Upvotes: 1

Related Questions