Skip to content

Basic graphs with matplotlib in python A comprehensive collection of matplotlib visualization examples with interactive HTML gallery

License

Notifications You must be signed in to change notification settings

sello-bot/Matplotlib-Visualization-Gallery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

📊 Matplotlib Visualization Gallery

A comprehensive collection of matplotlib visualization examples with interactive HTML gallery

Python Version Matplotlib License: MIT Contributions Welcome

Screenshot 2025-08-25 040436

🎯 Overview

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.

✨ Features

  • 📈 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

📊 Visualization Types

📈 Basic Charts

  • 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

📉 Distribution & Advanced

  • Histogram - Display data distribution
  • Heatmap - Show correlation matrices
  • Stacked Area Chart - Visualize cumulative data

🎨 Usage Examples

Creating a User Growth Chart

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()
Screenshot 2025-08-25 031244

Performance Correlation Analysis

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()
Screenshot 2025-08-25 031206

📁 Project Structure

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

🛠️ Technologies Used

  • 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)

📖 Best Practices Included

  • ✅ 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

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

How to Contribute

  1. 🍴 Fork the repository
  2. 🌿 Create a feature branch (git checkout -b feature/amazing-plot)
  3. 💻 Commit your changes (git commit -m 'Add amazing plot example')
  4. 📤 Push to the branch (git push origin feature/amazing-plot)
  5. 🔄 Open a Pull Request

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

👨‍💻 Author

Sello Kgole

🙏 Acknowledgments

  • matplotlib development team for the amazing library
  • The Python data visualization community
  • All contributors who help improve this gallery

📊 Stats

GitHub stars GitHub forks GitHub issues


Star this repo if you find it helpful!

Made with ❤️ and lots of ☕

About

Basic graphs with matplotlib in python A comprehensive collection of matplotlib visualization examples with interactive HTML gallery

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages