如何在 Mplot3d 中縮放軸?
若要在 mplot3d 中縮放軸,我們可以執行以下步驟 -
使用 figure() 方法建立圖形或啟用現有圖形。
使用Axes3D()類例項化 3D 軸例項。
若要縮放 X 軸,請使用set_xlim3d()方法。
若要縮放 Y 軸,請使用set_ylim3d()方法。
若要縮放 Z 軸,請使用set_zlim3d()方法。
若要顯示該圖,請使用show() 方法。
示例
from mpl_toolkits.mplot3d import Axes3D from matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True fig = plt.figure() ax = Axes3D(fig) ax.set_xlim3d(-100, 100) ax.set_ylim3d(-100, 100) ax.set_zlim3d(-100, 100) plt.show()
輸出

廣告
資料結構
組網
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C# 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP