Skip to content

Instantly share code, notes, and snippets.

@muhammadanas0716
Created January 12, 2023 16:58
Show Gist options
  • Save muhammadanas0716/0c05ee12a7ad17b0ef9cf6a98439ee1a to your computer and use it in GitHub Desktop.
Save muhammadanas0716/0c05ee12a7ad17b0ef9cf6a98439ee1a to your computer and use it in GitHub Desktop.
Jittering with stripplot
# 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