#!/usr/bin/gnuplot --persist # # This script is to help mentally extrapolate an ETA of # a technical process, specifically when my wordle # solver will finish. The data looks like this: # # 299,"Thu May 30 03:42:41 2024" # 314,"Thu May 30 01:20:58 2024" # 335,"Wed May 29 22:58:42 2024" # 341,"Wed May 29 21:12:50 2024" # 351,"Wed May 29 19:09:46 2024" # 357,"Wed May 29 19:36:39 2024" # 409,"Wed May 29 17:20:49 2024" # 469,"Wed May 29 15:11:52 2024" # 549,"Wed May 29 10:44:07 2024" # # where the first column is the count of wordles solved # and the second column is the ETA for the *complete* ~2400 # wordles to be solved. I wanted to how the process sped # up the more it did (because it had cached more and more # data that was relevant to solving the next wordle). # # This is all written out nicely because gnuplot syntax # is so awful and unmemorable! # Set the output device to be a basic WxWidges-based window # and set the window title. wxt has the advantage that the # zoom buttons work, but the disadvantage that it triggers # a GTK CSS warning. set term wxt title 'evolving wordle ETA' # The y axis is time. set ydata time # The CSV file is separated with commas and the times in # that file are written as above. https://stackoverflow.com/questions/17791828/gnuplot-date-time-in-x-axis#17792758 # suggests that it is necessary to tell gnuplot that there # are double quotes around the data, but that did not seem # necessary (whether I use double or single quotes around # the time format, they seem to be interpreted as delimiting # the time format. set datafile sep ',' set timefmt '%a %b %d %H:%M:%S %Y' # On the graph itself, we want the data displayed in a much # shorter way. set xlabel 'wordles solved' # Without specifying the X range, autoscaling works fine, but # since I know how many wordles have to be solved, I can - # at least in the X direction - set the minumum and maximum # number of wordles. I could replace one or both of these # with '*' to have the beginning or end of the X axis # autoscaled. set xrange [0:2309] set ylabel 'ETA' set format y '%a %H:%M' # Plot the data, using columns 1 and 2, with a line whose # colour we specify with an RGB value (be that hex or a # colour name) and give it a title. We could specify a # file containing the data: # # plot '' ... # # or we can do it inline by using the special filename '-', # in which case a line with just 'e' on it marks the end # of the data. The title string is in *double* quotes # because, just like bash, escape sequenced (e.g. \n) # are not processed if they are in single quotes. plot '-' using 1:2 with lines linetype rgb 'red' title "evolving ETA as more and\nmore wordles get solved" 299,"Thu May 30 03:42:41 2024" 314,"Thu May 30 01:20:58 2024" 335,"Wed May 29 22:58:42 2024" 341,"Wed May 29 21:12:50 2024" 351,"Wed May 29 19:09:46 2024" 357,"Wed May 29 19:36:39 2024" 409,"Wed May 29 17:20:49 2024" 469,"Wed May 29 15:11:52 2024" 549,"Wed May 29 10:44:07 2024" 575,"Wed May 29 09:48:41 2024" 586,"Wed May 29 09:33:04 2024" 678,"Wed May 29 07:35:36 2024" 806,"Wed May 29 04:35:09 2024" 853,"Wed May 29 04:18:06 2024" 927,"Wed May 29 03:41:31 2024" 1005,"Wed May 29 02:47:44 2024" 1089,"Wed May 29 02:09:43 2024" 1122,"Wed May 29 01:55:37 2024" 1262,"Wed May 29 00:57:45 2024" 1299,"Wed May 29 00:39:39 2024" 1691,"Tue May 28 23:14:19 2024" e # Finally, this script would pop of the graph window and # immediately close it, so we need to tell gnuplot to wait # for a click or an ENTER or we can use gnuplot's '--persist' # option on the '#!' line to allow gnuplot to exit but # the graph window to persist until closed. #pause mouse #pause -1