Skip to content

nachiket-1/Data-Visualization-with-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 

Repository files navigation


Python Matplotlib Seaborn Plotly Jupyter Kaggle License


"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. 🎨



πŸ“– About

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.


πŸ—ΊοΈ Table of Contents


πŸ“¦ What's Inside

# 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

🎨 Chart Gallery

πŸ“ˆ  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   ]

⚑ Open Notebook in Kaggle

Open in Kaggle


🧭 The Chart Chooser

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(...)

πŸ“‹ Requirements

matplotlib>=3.5.0
seaborn>=0.12.0
plotly>=5.0.0
numpy>=1.21.0
pandas>=1.3.0

Install everything at once:

pip install -r requirements.txt

βœ… All dependencies are pre-installed on Kaggle and Google Colab.


🏁 Run on Kaggle

  1. Upload the notebook via File β†’ Import Notebook
  2. No additional installs needed β€” all libraries are available
  3. Plotly charts render inline in the notebook output
  4. 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')

πŸ’» Run Locally

# 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

βš–οΈ Libraries Compared

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

πŸ§ͺ Experiment Ideas

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.rcParams style 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

πŸ“ Repository Structure

data-visualization-python/
β”‚
β”œβ”€β”€ πŸ““ data_visualization_python.ipynb   ← Main notebook
β”œβ”€β”€ πŸ“‹ README.md                          ← This file
└── πŸ“¦ requirements.txt                   ← Dependencies

πŸš€ What's Next?

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

🀝 Contributing

Have a chart type that should be added? Found a bug?

  1. Fork the repository
  2. Create a branch: git checkout -b feature/add-radar-chart
  3. Make your changes and submit a Pull Request

πŸ“„ License

This project is open source under the MIT License β€” free to use, share, and build on.


Made with ❀️, Python, and way too many color gradients

If this helped you learn something new, a ⭐ on the repo means the world!

About

πŸ“Š A colorful, beginner-friendly guide to Data Visualization in Python β€” 10 chart types across Matplotlib, Seaborn & Plotly with a full dashboard and interactive charts.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors