Overview:
- The 3-dimensional bar chart functionality provided by the Python matplotlib library has both X axis and Y axis used for categories and has the height of the bar in Z axis to specify the frequency.
- The x, y, z parameters of the bar3d() function defines where to start the bars in the X, Y and Z axes.
- The dx, dy and dz parameters of the bar3d() function tells how big the bar should be in X, Y and Z axis dimensions. The dx parameter defines the width of the bar in X axis, the dy parameter defines the depth of the bar in Y axis and the dz parameter defines the height of the bar in Z axis.
Example:
# Example Python program that plots a 3d-bar chart # import the required style # X locations of the bar # Y locations of the bar # Z locations of the bar - # X axis width of the bar # Y axis depth of the bar # Height of the bar - Z Axis
# Set the graph size # Plot 3d bars # Place labels over the plot # Create ten intervals from 0 to 9 in Z axis # Create eight intervals from 0 to 4 each measuring 0.5 in X axis # Create eighteen intervals from 0 to 9 each measuring 0.5 in Z axis # Set labels for X, Y and Z axis # Place a title for the graph # Finally display the 3d-bar plot |