
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to scale axes in Mplot3d?
To scale axes in mplot3d, we can take the following steps −
Create a figure or activate an existing figure using figure() method.
Instantaite 3D axes instance using Axes3D() class.
To scale X-axis, use set_xlim3d() method.
To scale Y-axis, use set_ylim3d() method.
To scale Z-axis, use set_zlim3d() method.
To display the plot, use show() method.
Example
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()
Output
Advertisements