Chart Types
85 words
1 min read
Visual companion
Python
Type and operator map
Python Week 1: the first filter for runtime behavior
View
Revision summary
What this note is really saying
Short form
# Chart Types ## Chart Selection Guide *(Diagram)* ## Key Chart Types Chart Use Case Code Bar Compare categories plt.bar() Line Trends over time plt.plot() Scatter Relationship 2 vars plt.scatter() Histogram Distribution plt.hist() Box plot Distribution w/ outliers sns.boxplot() Heatmap 2D matrix sns.heatmap() Violi...

Chart Types
pythonimport matplotlib.pyplot as plt import seaborn as sns import numpy as np import pandas as pd # Generate sample data df = pd.DataFrame({ 'category': ['A', 'B', 'C', 'D'], 'value': [23, 45, 56, 78], 'value2': [30, 40, 50, 60] })
Chart Selection Guide
(Diagram)
Key Chart Types
| Chart | Use Case | Code |
|---|---|---|
| Bar | Compare categories | plt.bar() |
| Line | Trends over time | plt.plot() |
| Scatter | Relationship 2 vars | plt.scatter() |
| Histogram | Distribution | plt.hist() |
| Box plot | Distribution w/ outliers | sns.boxplot() |
| Heatmap | 2D matrix | sns.heatmap() |
| Violin | Distribution shape | sns.violinplot() |
python# Example: Bar chart plt.figure(figsize=(8, 4)) sns.barplot(data=df, x='category', y='value') plt.title('Bar Chart Example') plt.show()