I have this piece of code:
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.scatter(data.FAC1_1, data.FAC2_1, data.FAC3_1, c='r', marker='o')
ax.set_xlabel('X Label')
ax.set_ylabel('Y Label')
ax.set_zlabel('Z Label')
plt.show()
everything works perfectly fine. The only issue is that the scatter plot that comes out is really tiny. Is there a ay to make it bigger? I looked at the documentation but I wasn't able to find it.
If we want our plots to be bigger or smaller than the default size, we can easily set the size of the plot either when initializing the figure – using the figsize parameter of the plt. figure method, or we can update the size of an existing plot by calling the set_size_inches method on the figure object.
Matplotlib mplot3d toolkit One can rotate the 3D scene by simply clicking-and-dragging the scene. Zooming is done by right-clicking the scene and dragging the mouse up and down. Note that one does not use the zoom button like one would use for regular 2D plots.
To change the size of subplots in Matplotlib, use the plt. subplots() method with the figsize parameter (e.g., figsize=(8,6) ) to specify one size for all subplots — unit in inches — and the gridspec_kw parameter (e.g., gridspec_kw={'width_ratios': [2, 1]} ) to specify individual sizes.
You can make the figure itself bigger using figsize:
fig = plt.figure(figsize=(12,10))
To make the markers from the scatter plot bigger use s
:
ax.scatter(data.FAC1_1, data.FAC2_1, data.FAC3_1, s=500, c='r', marker='o')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With