×

Python Tutorial

Python Basics

Python I/O

Python Operators

Python Conditions & Controls

Python Functions

Python Strings

Python Modules

Python Lists

Python OOPs

Python Arrays

Python Dictionary

Python Sets

Python Tuples

Python Exception Handling

Python NumPy

Python Pandas

Python File Handling

Python WebSocket

Python GUI Programming

Python Image Processing

Python Miscellaneous

Python Practice

Python Programs

Python | Horizontal Grid in Box Plot

Horizontal Grid in Box Plot: In this tutorial, we will learn and explore the grid type in box plot for better data visualization? By Anuj Singh Last updated : August 18, 2023

Examples

Following example illustrates the implementation of our Grid Plot.

Python | Horizontal Grid in Box Plot (1) Python | Horizontal Grid in Box Plot (2)

Python program for horizontal grid in box plot

import numpy as np
import matplotlib.pyplot as plt

# Generating Data
spread = np.random.rand(65) * 82
center = np.ones(36) * 50
flier_high = np.random.rand(12) * 100 + 100
flier_low = np.random.rand(10) * -100
data = np.concatenate((spread, center, flier_high, flier_low))

plt.figure()
plt.title('Horizontal Grid in Box Plot')
plt.boxplot(data)
plt.ylabel('Variation')
plt.grid(True)
plt.figure()

plt.figure(figsize=(2,6))
plt.title('Horizontal Grid in Box Plot')
plt.boxplot(data)
plt.ylabel('Variation')
plt.grid(True)
plt.figure()

Output:

Output is as Figure
Advertisement
Advertisement

Comments and Discussions!

Load comments ↻


Advertisement
Advertisement
Advertisement

Copyright © 2025 www.includehelp.com. All rights reserved.