Select data points in interactive terminal

55 views
Skip to first unread message

jindi.li

unread,
Jan 9, 2021, 9:55:42 AM1/9/21
to
I'm using latest gnuplot 5.4 patchlevel rc1 to plot simple time series data on Windows 10,
I want to checkout whether it's possible to select data points in interactive terminal, need to check some data point's value, or even better if it's possible to select some data points and remove them, then replot.

jindi.li

unread,
Jan 9, 2021, 1:44:44 PM1/9/21
to
Dig deeper in this forum, I find a similar discussion quite long time ago, any one knows how it's going or is some body working on that feature ?

Is it possible to select a point on a graph and get its exact coordinates (as they appear in data file)
https://groups.google.com/g/comp.graphics.apps.gnuplot/c/OlWN-EmQCLM/m/8kU5_ahFJVsJ

Gavin Buxton

unread,
Jan 10, 2021, 11:10:52 AM1/10/21
to
Sorry, I don't have an answer other than to say when I do it I just zoom in on a point until the axis are really narrow and then middle click button (at least on linux) puts a point there with the numbers. Not exactly what you are looking for, but its what I do.

P.S. Not too sure I'd want gnuplot messing with my data files to be honest.

jindi.li

unread,
Jan 10, 2021, 10:21:44 PM1/10/21
to
@Gavin Buxton,

Thanks for the nice tip, I didn't know this before.
What I used often is left double click to copy the value to clipboard.

Since Now there are so many nice python plot libs to choose from, I tend to use gnuplot to get a quick overview of the data, just use:

$>: gnuplot -e "plot 'data.csv'; pause mouse close"

Quite simple yet I can examine the data interactivily, and I can even export it to vector format.
To that task, I think Gnuplot is Unbeatable.

jindi.li

unread,
Jan 11, 2021, 8:09:46 PM1/11/21
to
I aware there is a show bind command to list all keyboard shortcuts and mouse shortcuts of the current terminal

gnuplot> show bind

<B1> doubleclick send mouse coordinates to clipboard (pm win wxt x11)
<B2> annotate the graph using `mouseformat` (see keys '1', '2')
or draw labels if `set mouse labels is on`
<Ctrl-B2> remove label close to pointer if `set mouse labels` is on
<B3> mark zoom region (only for 2d-plots and maps)
<B1-Motion> change view (rotation); use <Ctrl> to rotate the axes only
<B2-Motion> change view (scaling); use <Ctrl> to scale the axes only
<Shift-B2-Motion> vertical motion -- change xyplane
<B3-Motion> change view (azimuth)
<wheel-up> scroll up (in +Y direction)
<wheel-down> scroll down
<shift-wheel-up> scroll left (in -X direction)
<shift-wheel-down> scroll right
<Control-WheelUp> zoom in on mouse position
<Control-WheelDown> zoom out on mouse position
<Shift-Control-WheelUp> pinch on x
<Shift-Control-WheelDown> expand on x

q * close this plot window

a `builtin-autoscale` (set autoscale keepfix; replot)
b `builtin-toggle-border`
e `builtin-replot`
g `builtin-toggle-grid`
h `builtin-help`
i `builtin-invert-plot-visibilities`
l `builtin-toggle-log` y logscale for plots, z and cb for splots
L `builtin-nearest-log` toggle logscale of axis nearest cursor
m `builtin-toggle-mouse`
r `builtin-toggle-ruler`
V `builtin-set-plots-invisible`
v `builtin-set-plots-visible`
1 `builtin-previous-mouse-format`
2 `builtin-next-mouse-format`
5 `builtin-toggle-polardistance`
6 `builtin-toggle-verbose`
7 `builtin-toggle-ratio`
n `builtin-zoom-next` go to next zoom in the zoom stack
p `builtin-zoom-previous` go to previous zoom in the zoom stack
u `builtin-unzoom`
+ `builtin-zoom-in` zoom in
= `builtin-zoom-in` zoom in
- `builtin-zoom-out` zoom out
Right `scroll right in 2d, rotate right in 3d`; <Shift> faster
Up `scroll up in 2d, rotate up in 3d`; <Shift> faster
Left `scroll left in 2d, rotate left in 3d`; <Shift> faster
Down `scroll down in 2d, rotate down in 3d`; <Shift> faster
< `rotate azimuth left in 3d`; <ctrl> faster
> `rotate azimuth right in 3d`; <ctrl> faster
Escape `builtin-cancel-zoom` cancel zoom region

* indicates this key is active from all plot windows

jindi.li

unread,
Jan 11, 2021, 8:19:11 PM1/11/21
to
And I notice that "set mouse labels" must be set to make
<Ctrl-B2> remove label close to pointer
work,
and also fix that when I zoom or rescale the plot graph, the pin annotation made with middle mouse click is disappear.

jindi.li

unread,
Jan 12, 2021, 12:17:09 AM1/12/21
to
I'm Quite happy to notice the Conditional Plotting in gnuplot, which solve my initial question,
I need to remove some data point in the plot graph without touch my real data.

I post the line work for me here in case someone need that too.

Yes, as simple as:
$>: plot 'scale.csv' u ($1>=0?$1:NaN)

which I didn't notice yet.
Reply all
Reply to author
Forward
0 new messages