Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bluurn/tkplotter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TkPlotter

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.

Screenshot

TkPlotter Screenshot

Features

  • 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

Usage

Run the application:

python main.py

UI Overview

  • 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

Hotkeys

  • 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

Project Structure

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

Requirements

  • Python 3.8+
  • Tkinter (usually included with Python)

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages