- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Plot 3D bars without axes in Matplotlib
To plot 3D bars without axes, we can take the following steps
- Set the figure size and adjust the padding between and around the subplots.
- Create a new figure or activate an existing figure using figure() method.
- Add an axes to the cureent figure as a subplot arrangement.
- Create x3, y3 and z3 data points using numpy.
- Create dx, dy and dz data points using numpy.
- Use bar3d() method to plot 3D bars.
- To hide the axes, use axis('off') class by name.
- To display the figure, use show() method.
Example
import numpy as np from matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True fig = plt.figure() ax1 = fig.add_subplot(111, projection='3d') x3 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] y3 = [5, 6, 7, 8, 2, 5, 6, 3, 7, 2] z3 = np.zeros(10) dx = np.ones(10) dy = np.ones(10) dz = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] ax1.bar3d(y3, x3, z3, dx, dy, dz, color="red") ax1.axis('off') plt.show()
Output
- Related Articles
- Plot scatter points on 3d plot without axes and grids in Matplotlib
- How to plot a point on 3D axes in Matplotlib?
- How to hide axes but keep axis-labels in 3D Plot with Matplotlib?
- Rotating axes label text in 3D Matplotlib
- How can I hide the axes in Matplotlib 3D?
- Plot Matplotlib 3D plot_surface with contour plot projection
- Creating a 3D plot in Matplotlib from a 3D numpy array
- Transparent error bars without affecting the markers in Matplotlib
- How to surface plot/3D plot from a dataframe (Matplotlib)?
- Make 3D plot interactive in Jupyter Notebook (Python & Matplotlib)
- How to plot a 3D continuous line in Matplotlib?
- How to plot a 3D patch collection in matplotlib?
- How to plot 3D graphs using Python Matplotlib?
- Plot a vector field over the axes in Python Matplotlib?
- Putting arrowheads on vectors in Matplotlib's 3D plot

Advertisements