Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/musatahawar/interactive-pie-chart
A simple interactive pie chart using python, mplcursors and matplotlib
https://github.com/musatahawar/interactive-pie-chart
Last synced: 5 days ago
JSON representation
A simple interactive pie chart using python, mplcursors and matplotlib
- Host: GitHub
- URL: https://github.com/musatahawar/interactive-pie-chart
- Owner: MusaTahawar
- Created: 2023-11-27T11:15:28.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-27T11:17:18.000Z (about 1 year ago)
- Last Synced: 2024-11-09T17:19:00.599Z (2 months ago)
- Language: Python
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Interactive Pie Chart with Matplotlib and mplcursors
This Python script generates an interactive pie chart using Matplotlib library to visualize data with interactive tooltips for each section of the pie chart. The mplcursors library is used to enable interactivity, allowing users to hover over sections and view labels and percentages.
## Requirements
- Python (3.x recommended)
- Matplotlib
- mplcursors## Installation
1. Clone the repository or download the Python script.
2. Install the required libraries by running the following command:```bash
pip install matplotlib mplcursors
```## Usage
1. Ensure you have the required Python libraries installed (Matplotlib and mplcursors).
2. Run the Python script `piechart.py`.
3. The script will generate a window displaying an interactive pie chart.
4. Hover over each section of the pie chart to see tooltips displaying the label and percentage of that section.## Code Overview
- `piechart.py`: Python script that creates an interactive pie chart using Matplotlib and mplcursors.
- `labels`: List containing labels for different sections of the pie chart.
- `sizes`: List containing the values for each section of the pie chart.
- `plt.pie()`: Method to create the pie chart with specified labels, sizes, percentages, and interactivity using mplcursors.## Contributing
Contributions are welcome! If you have any suggestions, improvements, or feature requests, feel free to open an issue or create a pull request.
## License
This project is licensed under the [MIT License](LICENSE).