Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README and add some dev tools #77

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 129 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,56 @@
# garden.matplotlib

`garden.matplotlib` is a Kivy garden package that provides a simple way to embed Matplotlib plots and charts in Kivy applications. This package makes it easy to integrate powerful data visualization tools into your Kivy apps, allowing you to create interactive, high-quality data visualizations with ease.

## Installation

This repository uses the legacy kivy garden flower format. To install `garden.matplotlib`, simply add it to your Kivy garden using the most up-to-date [legacy garden tool instructions](https://kivy.org/doc/stable/api-kivy.garden.html#legacy-garden-tool-instructions).

```cmd
pip install garden
garden install matplotlib
```

## Usage

Using `garden.matplotlib` is simple. To embed a Matplotlib plot in your Kivy app, simply create a `FigureCanvasKivyAgg` widget and add it to your app as you would any other Kivy widget:

```python
import kivy
kivy.require('1.11.1')

from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.garden.matplotlib.backend_kivyagg import FigureCanvasKivyAgg
import matplotlib.pyplot as plt

class MyPlotApp(App):
def build(self):
# Create a box layout for the app
layout = BoxLayout(orientation='vertical')

# Create a Matplotlib figure and canvas
fig, ax = plt.subplots()
canvas = FigureCanvasKivyAgg(fig)

# Add the canvas to the app layout
layout.add_widget(canvas)

# Plot the data
ax.plot([1, 2, 3, 4])

# Redraw the canvas
canvas.draw_idle()

return layout

MyPlotApp().run()
```

## Contributing

If you find a bug or have an idea for a new feature, we welcome contributions from the community. To contribute to `garden.matplotlib`, simply fork the repository, make your changes, and submit a pull request. We'll review your changes and merge them into the repository if they meet our standards and requirements.

## License

`garden.matplotlib` is released under the MIT license. See the `LICENSE` file for more information.
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Kivy==2.1.0
matplotlib==3.7.0
numpy==1.24.2
six==1.16.0