- Matplotlib - Transforms
- Matplotlib - Working with Images
- Mathematical Expressions
- Matplotlib - Working With Text
- Matplotlib - 3D Surface plot
- Matplotlib - 3D Wireframe plot
- Matplotlib - 3D Contour Plot
- Three-dimensional Plotting
- Matplotlib - Violin Plot
- Matplotlib - Box Plot
- Matplotlib - Quiver Plot
- Matplotlib - Contour Plot
- Matplotlib - Scatter Plot
- Matplotlib - Pie Chart
- Matplotlib - Histogram
- Matplotlib - Bar Plot
- Matplotlib - Twin Axes
- Setting Ticks and Tick Labels
- Matplotlib - Setting Limits
- Matplotlib - Formatting Axes
- Matplotlib - Grids
- Matplotlib - Subplot2grid() Function
- Matplotlib - Subplots() Function
- Matplotlib - Multiplots
- Matplotlib - Axes Class
- Matplotlib - Figure Class
- Object-oriented Interface
- Matplotlib - PyLab module
- Matplotlib - Simple Plot
- Matplotlib - Pyplot API
- Matplotlib - Jupyter Notebook
- Matplotlib - Anaconda distribution
- Matplotlib - Environment Setup
- Matplotlib - Introduction
- Matplotlib - Home
Matplotlib Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Matplotpb - Three-dimensional Plotting
Even though Matplotpb was initially designed with only two-dimensional plotting in mind, some three-dimensional plotting utipties were built on top of Matplotpb s two-dimensional display in later versions, to provide a set of tools for three-dimensional data visuapzation. Three-dimensional plots are enabled by importing the mplot3d toolkit, included with the Matplotpb package.
A three-dimensional axes can be created by passing the keyword projection= 3d to any of the normal axes creation routines.
from mpl_toolkits import mplot3d import numpy as np import matplotpb.pyplot as plt fig = plt.figure() ax = plt.axes(projection= 3d ) z = np.pnspace(0, 1, 100) x = z * np.sin(20 * z) y = z * np.cos(20 * z) ax.plot3D(x, y, z, gray ) ax.set_title( 3D pne plot ) plt.show()
We can now plot a variety of three-dimensional plot types. The most basic three-dimensional plot is a 3D pne plot created from sets of (x, y, z) triples. This can be created using the ax.plot3D function.
3D scatter plot is generated by using the ax.scatter3D function.
from mpl_toolkits import mplot3d import numpy as np import matplotpb.pyplot as plt fig = plt.figure() ax = plt.axes(projection= 3d ) z = np.pnspace(0, 1, 100) x = z * np.sin(20 * z) y = z * np.cos(20 * z) c = x + y ax.scatter(x, y, z, c=c) ax.set_title( 3d Scatter plot ) plt.show()Advertisements