A comprehensive collection of matplotlib visualization examples with interactive HTML gallery
The Matplotlib Visualization Gallery is an interactive HTML showcase featuring various types of data visualizations you can create with Python's matplotlib library. Each example includes complete code snippets, use cases, and best practices for creating professional-quality plots.
- 📈 6 Core Plot Types: Line charts, scatter plots, bar charts, pie charts, histograms, and area charts
- 🔥 Advanced Visualizations: Heatmaps and stacked area charts
- 💻 Complete Code Examples: Copy-paste ready Python code for each visualization
- 🎨 Modern UI: Responsive design with hover effects and clean styling
- 📱 Mobile Friendly: Optimized for viewing on all devices
- 🎓 Educational: Perfect for learning data visualization best practices
- Line Chart with Area Fill - Track growth patterns over time
- Scatter Plot - Visualize correlations between variables
- Bar Chart - Compare categorical data
- Pie Chart - Show proportions and percentages
- Histogram - Display data distribution
- Heatmap - Show correlation matrices
- Stacked Area Chart - Visualize cumulative data
import matplotlib.pyplot as plt
months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
users = [50, 80, 120, 180, 250, 320]
plt.fill_between(months, users, color="skyblue", alpha=0.4)
plt.plot(months, users, color="blue", marker="o")
plt.title("User Growth Over Time")
plt.xlabel("Months")
plt.ylabel("Number of Users")
plt.grid(True)
plt.show()
import matplotlib.pyplot as plt
coding_hours = [5, 7, 8, 7, 6, 9, 5, 8, 7, 6, 5]
performance = [99, 86, 87, 100, 86, 103, 87, 103, 87, 94, 78]
plt.scatter(coding_hours, performance, color='#ff5733')
plt.title("Hours of Coding vs Performance")
plt.xlabel("Hours of coding")
plt.ylabel("Performance Score")
plt.grid(True)
plt.show()
matplotlib-visualization-gallery/
├── 📄 index.html # Main gallery page
├── 📄 README.md # This file
├── 📄 requirements.txt # Python dependencies
├── 📄 LICENSE # MIT license
├── 📁 examples/ # Python script examples
│ ├── 📄 line_chart.py # Line chart examples
│ ├── 📄 scatter_plot.py # Scatter plot examples
│ ├── 📄 bar_chart.py # Bar chart examples
│ └── 📄 ... # Other plot types
├── 📁 assets/ # Images and static files
│ └── 📁 images/ # Plot example images
└── 📄 CONTRIBUTING.md # Contribution guidelines
- HTML5 & CSS3 - Modern web standards
- Tailwind CSS - Utility-first CSS framework
- Python - Programming language
- Matplotlib - Core plotting library
- NumPy - Numerical computing
- Seaborn - Statistical visualization (optional)
- ✅ Always label axes and include titles
- ✅ Use appropriate color palettes
- ✅ Choose the right plot type for your data
- ✅ Add legends for multiple data series
- ✅ Optimize figure size for presentation
- ✅ Save high-quality images
We welcome contributions! Please see our Contributing Guidelines for details.
- 🍴 Fork the repository
- 🌿 Create a feature branch (
git checkout -b feature/amazing-plot) - 💻 Commit your changes (
git commit -m 'Add amazing plot example') - 📤 Push to the branch (
git push origin feature/amazing-plot) - 🔄 Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Sello Kgole
- GitHub: @sello-bot
- LinkedIn: Sello Kgole
- Email: skgole6@gmail.com
- matplotlib development team for the amazing library
- The Python data visualization community
- All contributors who help improve this gallery
⭐ Star this repo if you find it helpful! ⭐
Made with ❤️ and lots of ☕