TkPlotter is a lightweight 2D function plotter built with Tkinter. It allows users to visualize mathematical functions interactively, supporting zoom, pan, and customizable plot ranges.
- Function plotting: Enter any mathematical expression in terms of
x(e.g.,sin(x),x**2, etc.) - Interactive controls: Zoom and pan using mouse and hotkeys
- Customizable ranges: Set
x_min,x_max, and step size - Grid and axes: Auto-generated grid and axis labels
- Collapsible hotkeys panel: View and hide available hotkeys
- Robust evaluation: Safe math expression evaluation
Run the application:
python main.py- Function input: Enter the function to plot
- Range controls: Set
x_min,x_max, and step - Plot/clear/reset buttons: Control the plot display
- Canvas: Interactive plot area
- Hotkeys panel: Shows available shortcuts
- Mouse wheel: Zoom X (Ctrl for faster)
- Shift + wheel: Zoom Y (Ctrl for faster)
- Left mouse: Box zoom
- Esc: Cancel box/reset
- Right/Middle mouse: Pan
- Enter: Plot
- R: Full reset
main.py # Entry point
app/
config.py # Configuration and UI language
plotter.py # Main Tkinter app and run logic
safemath.py # Safe math evaluation
core/
axes.py # Grid and axis layout
renderer.py # Plot rendering logic
sampler.py # Function sampling
transformer.py # Data-to-screen transforms
types.py # Data types
viewport.py # Viewport and zoom/pan logic
ui/
canvas_view.py # Canvas drawing API
hotkeys_panel.py # Hotkeys panel widget
presenter.py # Event handling and plot logic
- Python 3.8+
- Tkinter (usually included with Python)
MIT