"The greatest value of a picture is when it forces us to notice what we never expected to see." β John W. Tukey
10 chart types. 3 libraries. 1 notebook. Zero boring visuals. π¨
This notebook is a hands-on, colorful guide to data visualization in Python β built for anyone who wants to turn raw data into charts that actually tell a story. No prior visualization experience needed.
Every section covers a different chart type, explains when to use it (not just how), and comes with live # TRY: experiments so you can explore and customize immediately.
- What's Inside
- Chart Gallery
- Quick Start
- The Chart Chooser
- Requirements
- Run on Kaggle
- Run Locally
- Libraries Compared
- Experiment Ideas
- What's Next
| # | Section | Library | Key Concepts |
|---|---|---|---|
| 0 | Setup | β | Imports, global theme, custom palette |
| 1 | Line Chart | Matplotlib | Multi-series, filled areas, value annotations |
| 2 | Bar Chart | Matplotlib | Grouped bars, horizontal bars, sorted ordering |
| 3 | Scatter / Bubble | Matplotlib | 4-variable encoding, trend lines, alpha blending |
| 4 | Histogram | Matplotlib | 4 distribution shapes explained with examples |
| 5 | Pie & Donut | Matplotlib | Exploded slices, center text, legend placement |
| 6 | Heatmap | Seaborn | Correlation matrix, masking, color divergence |
| 7 | Box + Violin | Seaborn | IQR, outliers, density comparison side by side |
| 8 | Interactive Chart | Plotly | Hover tooltips, unified mode, zoom & pan |
| 9 | Dashboard Layout | Matplotlib | subplot_mosaic, KPI cards, multi-panel design |
| 10 | Chart Chooser | β | Quick-reference table for picking the right chart |
π Line Chart β±βΎβΎβ²_β±βΎβΎβ²___β±βΎ Trends over time
π Bar Chart β ββ ββ ββ Compare categories
π΅ Scatter / Bubble Β· Β· Β· Β· Β· Β· Two-variable relationships
π Histogram ββββββ
ββ Data distribution shapes
π₯§ Pie / Donut β β β β Part-to-whole breakdown
π₯ Heatmap π©π¨π₯π₯π©π¨ Correlation between variables
π¦ Box / Violin |β[ | ]β| Statistical summaries
π Plotly βββ (hover me!) βββ Interactive exploration
π₯οΈ Dashboard [line ][KPI] Multi-chart layouts
[donut][bar ]
Not sure which chart to use? Use this table:
| I want to show... | Best Chart | One-liner |
|---|---|---|
| Change over time | Line Chart | ax.plot(x, y) |
| Compare categories | Bar Chart | ax.bar(x, y) |
| Relationship between 2 variables | Scatter Plot | ax.scatter(x, y) |
| How data is distributed | Histogram | ax.hist(data, bins=30) |
| Part-to-whole breakdown | Pie / Donut | ax.pie(sizes) |
| Correlation between many variables | Heatmap | sns.heatmap(df.corr()) |
| Statistical summary | Box / Violin | sns.boxplot() |
| Interactive web chart | Plotly | px.line(df, x=..., y=...) |
| Multiple charts together | Dashboard | plt.subplot_mosaic(...) |
matplotlib>=3.5.0
seaborn>=0.12.0
plotly>=5.0.0
numpy>=1.21.0
pandas>=1.3.0Install everything at once:
pip install -r requirements.txtβ All dependencies are pre-installed on Kaggle and Google Colab.
- Upload the notebook via File β Import Notebook
- No additional installs needed β all libraries are available
- Plotly charts render inline in the notebook output
- Any saved files (PNG exports) appear in
/kaggle/working/
To save a chart as an image:
plt.savefig('my_chart.png', dpi=150, bbox_inches='tight')# 1. Clone the repo
git clone https://github.com/nachiket-1/data-visualization-python.git
cd data-visualization-python
# 2. (Recommended) Create a virtual environment
python -m venv venv
source venv/bin/activate # macOS / Linux
venv\Scripts\activate # Windows
# 3. Install dependencies
pip install -r requirements.txt
# 4. Launch Jupyter
jupyter notebook
# or JupyterLab:
jupyter lab| Feature | Matplotlib | Seaborn | Plotly |
|---|---|---|---|
| Output type | Static image | Static image | Interactive HTML |
| Learning curve | Medium | Low | LowβMedium |
| Best for | Full control, custom layouts | Statistical charts | Web & dashboards |
| Works with DataFrames | Manually | Natively | Natively |
| Default aesthetics | Basic | Beautiful | Beautiful |
| Animations | Yes (FuncAnimation) | No | Yes |
| 3D charts | Yes | No | Yes |
Rule of thumb:
- Start with Seaborn for quick EDA
- Use Matplotlib when you need full control or custom layouts
- Use Plotly when your audience will interact with the chart
After going through the notebook, try these challenges:
- π
Real data β load
sns.load_dataset('titanic')and recreate every chart with real data - π Choropleth map β use
px.choropleth()to make an interactive world map - π¨ Custom theme β create your own
plt.rcParamsstyle and apply it globally - π Annotation master β add arrows, text boxes, and highlights to explain chart insights
- π¦ Pair plot β use
sns.pairplot(df)to explore all variable relationships at once - π‘οΈ Diverging bar chart β show positive vs negative values with color coding
- πΈοΈ Radar chart β compare multi-attribute profiles in a spider web layout
data-visualization-python/
β
βββ π data_visualization_python.ipynb β Main notebook
βββ π README.md β This file
βββ π¦ requirements.txt β Dependencies
| Topic | Resource |
|---|---|
| More chart types | Matplotlib Gallery |
| Statistical deep dive | Seaborn Tutorial |
| Interactive dashboards | Plotly Dash |
| No-code dashboards | Streamlit |
| Geographic maps | Folium |
| Practice datasets | Kaggle Datasets |
Have a chart type that should be added? Found a bug?
- Fork the repository
- Create a branch:
git checkout -b feature/add-radar-chart - Make your changes and submit a Pull Request
This project is open source under the MIT License β free to use, share, and build on.