You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+69-31Lines changed: 69 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,51 +1,57 @@
1
1
# Interactive Console-based Time Window Plotter
2
2
3
-
Terminal Plotter is script that reads numeric data from a file (by default `data.txt`) and displays it as a live-updating plot in the terminal using [plotext](https://pypi.org/project/plotext/). The plot shows a moving time window (TW) of the data, and you can interactively adjust the window's size and position using keyboard controls.
3
+
Terminal Plotter is a scripts that reads numeric data from a file (by default `data.txt`) and displays a live-updating plot in your terminal using [plotext](https://pypi.org/project/plotext/). The plot shows a moving time window (TW) of your data along with its running average. The script provides interactive controls to adjust the time window, modify the running average window, and toggle the visibility of each plotted line.
Continuously reads new data from a file and updates the plot in real time.
12
-
13
-
-**Moving Time Window:**
14
-
Displays only the last X data points (a configurable "time window").
15
-
16
-
-**Interactive Controls:**
17
-
Adjust the plot on the fly using these keys:
18
-
-`k`: Increase window size by **1**
19
-
-`K`: Increase window size by **100**
20
-
-`j`: Decrease window size by **1** (minimum window size is 1)
21
-
-`J`: Decrease window size by **100** (minimum window size is 1)
22
-
-`h`: Move the window to older data (shift left) by the current window size
23
-
-`H`: Move the window to older data by **100** points
24
-
-`l`: Move the window to newer data (shift right) by the current window size
25
-
-`L`: Move the window to newer data by **100** points
26
-
-`q`: Quit the program
27
-
28
-
-**Auto-Scrolling:**
29
-
When the plot is showing the latest data (the last TW), new data automatically scrolls into view.
30
-
31
-
-**Legend Display:**
32
-
The plot includes a legend on top displaying the current time window length.
9
+
-**Live Plotting:** Continuously updates the plot as new data is added to the file.
10
+
-**Moving Time Window:** Displays only a subset of the full dataset.
11
+
*Default TW length is 10 points.*
12
+
-**Running Average:**
13
+
Computes and plots a running average for the data in the current time window.
14
+
*Default running average window is 5 points.*
15
+
-**Interactive Controls:**
16
+
-**Time Window Adjustments:**
17
+
-`k`: Increase window size by 1.
18
+
-`K`: Increase window size by 100.
19
+
-`j`: Decrease window size by 1 (minimum 1).
20
+
-`J`: Decrease window size by 100 (minimum 1).
21
+
-**Scrolling:**
22
+
-`h`: Scroll backward (older data) by the current window size.
23
+
-`H`: Scroll backward by 100.
24
+
-`l`: Scroll forward (newer data) by the current window size.
25
+
-`L`: Scroll forward by 100.
26
+
-**Running Average Adjustments:**
27
+
-`r`: Increase running average window by 1.
28
+
-`R`: Increase running average window by 10.
29
+
-`f`: Decrease running average window by 1 (minimum 1).
30
+
-`F`: Decrease running average window by 10 (minimum 1).
31
+
-**Toggle Line Visibility:**
32
+
-`1`: Toggle the raw data line on/off.
33
+
-`2`: Toggle the running average line on/off.
34
+
-**Quit:**
35
+
-`q`: Quit the program.
36
+
37
+
The legend in the plot updates with the current settings (e.g., TW length, running average window, and which lines are visible).
33
38
34
39
## Installation
35
40
36
-
1.**Python 3:**
37
-
Ensure you have Python 3 installed on your Unix-like system (Linux, macOS). This script uses the `termios` and `tty` modules, which are available on Unix.
41
+
1.**Prerequisites:**
42
+
Ensure you have Python 3 installed on your system.
38
43
39
44
2.**Install Dependencies:**
40
-
Install the `plotext` package using pip:
45
+
The script uses the [plotext](https://pypi.org/project/plotext/) library. Install it using pip:
41
46
```bash
42
47
pip install plotext
43
-
```
48
+
```
44
49
45
50
## Usage
46
51
Run the script from your terminal. It supports several command-line options:
0 commit comments