Created
January 12, 2023 16:58
-
-
Save muhammadanas0716/0c05ee12a7ad17b0ef9cf6a98439ee1a to your computer and use it in GitHub Desktop.
Jittering with stripplot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import Libararies | |
import numpy as np | |
import pandas as pd | |
import matplotlib as mpl | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
# Import Data | |
df = pd.read_csv("https://raw.githubusercontent.com/selva86/datasets/master/mpg_ggplot2.csv") | |
# Draw Stripplot | |
fig, ax = plt.subplots(figsize=(16,10), dpi= 80) | |
sns.stripplot(df.cty, df.hwy, jitter=0.25, size=8, ax=ax, linewidth=.5) | |
# Decorations | |
plt.title('Use jittered plots to avoid overlapping of points', fontsize=22) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment