https://github.com/sagravela/plotground
Plotting Tool with Matplotlib and Tkinter. Video Demo:
https://github.com/sagravela/plotground
matplotlib numpy python tkinter
Last synced: 11 months ago
JSON representation
Plotting Tool with Matplotlib and Tkinter. Video Demo:
- Host: GitHub
- URL: https://github.com/sagravela/plotground
- Owner: sagravela
- Created: 2024-11-27T13:53:31.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-27T13:53:35.000Z (about 1 year ago)
- Last Synced: 2025-01-26T15:28:50.603Z (about 1 year ago)
- Topics: matplotlib, numpy, python, tkinter
- Language: Python
- Homepage: https://www.youtube.com/watch?v=Zr-8NJPAjaE
- Size: 163 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PlotGround
#### Demo: [YouTube Video](https://www.youtube.com/watch?v=Zr-8NJPAjaE)
#### Description:
Software to plot 2D graphs also supports surface graphs in 3D.
Developed with Python using *Tkinter* for interface and *Matplotlib*.

### Usage Explanation
```python
python main.py
```
- **PLOT button**: plot data. For default you can plot many graphics in the same plot until you remove plots with **CG** or changing type of plot, from 2D to surface in 3D and vice versa.
- **Funtion field**: insert a valid function to plot in 2D with only **x** variable is allowed (`y = f(x)`), or surface to plot in 3D wich **x** and **y** variables only are supported (`z = f(x, y)`). All the variables and following functions are case insensitive. Functions and constant built-in supported are:
* sin()
* cos()
* tan()
* sqrt() (square root)
* *e*, *pi* constants
examples:
2D plot = `sin(x) + 10`, `cos(x**2)`, `sqrt(1/7)`, `e**x`
3D plot = `sin(x) + cos(y)`, `x**2 + y + 10`
- **C button**: clear all fields.
- **CE button**: clear all plots.
- **Range X or Range Y**: Optionally insert a valid range of **x** and **y** (`1, 10` for default) as integers separeted with comma.
- **Sampling Interval**: Optionally insert a valid sampling interval (**0.01** for dafault).
- **Title and axis names**: Optionally insert name of axis and graphic.
### Code explanation
- `main.py`
Execution file. First create a frame and figure, put them together with **canvas**. Later calls `App` class from `app.py`
- `app.py`
Contains `App` class within:
1. creates *tkinter* interface along `__init__` method,
1. `represent` method which retrieve inputs from the user and prompt errors if user input something wrong,
1. `animate` method plots data based on input user. If *x range* or *y range* wasn't provided, `[1, 10]` limits for deafult are taken. If *sampling interval* wasn't provided, `0.01` value is adopted. Plots surface in 3D if the user input function contains at least one *y* variable, if not try to plot in 2D along *x* var,
1. `graphs_clear` delete axis object just to reset plotting view,
1. `fields_clear` reset all input fields.