|
From: Ethan M. <eam...@gm...> - 2021-03-17 16:48:58
|
On Tuesday, 16 March 2021 06:34:49 PDT Roderick Stewart wrote:
> Ethan,
>
> We have a number of active volcanoes here, and some potentially-active. Keeps us busy. We actually work with the USGS, who are based in Vancouver, Washington.
Oh well, "potentially active" is another story.
We have Mt Rainier, and Mt St Helens, and I suppose Mt Hood for that matter.
I was at school back East when St Helens last blew, but I have seen
a small jokulhaups at Rainier.
> Can I ask one more gnuplot favour?
>
> The attached plot is what I am doing using the attached script.
>
> The top two plots are histograms of data that ends today.
>
> The bottom plot is the time series data for the whole year that you helped me with.
>
> I want to make the time-series plot end at the same time as the middle histogram plot, ie xrange should finish at the end of today.
today = strftime("%d-%b-%Y", time(0))
almost_midnight = " 23:59"
t_max = strptime("%d-%b-%Y %H:%M", today.almost_midnight)
set xrange [t_min : t_max]
cheers,
Ethan
>
> How do I do that?
>
> Rod
>
>
>
>
> --
> Roderick Stewart
> Research Fellow (Volcano-Seismology), Montserrat Volcano Observatory
> www.mvo.ms <http://www.mvo.ms/>
> email: ro...@mv... <mailto:ro...@mv...>, rod...@gm... <mailto:rod...@gm...>, rst...@my... <mailto:rst...@my...>
>
> phone: (+1-664) 491-5647
> fax: (+1-664) 491-2423
> direct line: (+1-664) 491-5726
> mobile: (+1-664) 495-0743
> home: (+1-664) 491-3139
> roaming: +44 7452 023889
> trinidad: +1 (868) 780-4296
>
>
>
>
>
>
>
> > On 17 Mar 2021, at 03:06, Ethan Merritt <eam...@gm...> wrote:
> >
> > On Tuesday, 16 March 2021 06:43:08 PDT Roderick Stewart wrote:
> >> Ethan,
> >>
> >> This is fantastic and has saved me a lot of time.
> >>
> >> I’m currently in St Vincent trying to set up a real-time volcano monitoring system
> >
> > Lucky you!
> > I'm stuck here in cold and rainy Seattle, still in Covid lock-down so no travel escape.
> >
> >> on Windows, and I have very little experience in Windows.
> >>
> >> I would like to offer you a Montserrat Volcano Observatory T-shirt in thanks for your help.
> >
> > You are very kind, and I appreciate your offer.
> > But my T-shirt draw is totally overflowing, mostly due to 30 years of support
> > for the Northwest Folklife Festival, so I won't impose on your kindness.
> >
> > I have to admit that before this I did not know there was an active volcano
> > in the Caribbean.
> >
> > best regards,
> >
> > Ethan
> >
> >
> >
> >> Just give me your size, an approximate colour you want, and an address that a courier can deliver to. I can send it next week when I get back, but have no idea how long it takes to deliver in these Covid times.
> >>
> >>
> >> Rod
> >>
> >>
> >>
> >>
> >> --
> >> Roderick Stewart
> >> Research Fellow (Volcano-Seismology), Montserrat Volcano Observatory
> >> www.mvo.ms <http://www.mvo.ms/>
> >> email: ro...@mv... <mailto:ro...@mv...>, rod...@gm... <mailto:rod...@gm...>, rst...@my... <mailto:rst...@my...>
> >>
> >> phone: (+1-664) 491-5647
> >> fax: (+1-664) 491-2423
> >> direct line: (+1-664) 491-5726
> >> mobile: (+1-664) 495-0743
> >> home: (+1-664) 491-3139
> >> roaming: +44 7452 023889
> >> trinidad: +1 (868) 780-4296
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>> On 15 Mar 2021, at 18:10, Ethan Merritt <eam...@gm...> wrote:
> >>>
> >>> On Monday, 15 March 2021 13:20:14 PDT Roderick Stewart wrote:
> >>>> I’m new to gnuplot (love it!) but can’t work out how to plot time series data from a file when the file contains no time information, just equally-spaced data values.
> >>>>
> >>>> I have a binary file which has one year’s worth of data at 1-minute intervals.
> >>>>
> >>>> I can plot it using:
> >>>>
> >>>> plot ‘2021.dat’ binary format=“%int32” using 0:1
> >>>>
> >>>> But I want the X axis to be a date axis so I can, for example, set xrange.
> >>>>
> >>>> How do I get the timestamps into the plot?
> >>>
> >>> The units of time in gnuplot are seconds.
> >>> A date corresponds to the number of seconds elapsed since the start of the
> >>> epoch (1 Jan 1970).
> >>>
> >>> Each record in your data adds 60 seconds to the date.
> >>> So the task is
> >>> 1) Determine the canonical date (number of seconds since 1970) of the start time.
> >>> 2) Add 60 seconds for each data point
> >>>
> >>> Suppose your data starts with the first minute of 2021.
> >>>
> >>> timefmt = "%d-%b-%Y"
> >>> time0 = strptime( timefmt, "01-Jan-2021" )
> >>>
> >>> # the xrange and tic placement will use the timefmt we just set
> >>> set xdata time
> >>> set xrange [time0 : *]
> >>> set xtics ("01-Jan-2021", "01-Feb-2021", "01-Mar-2021")
> >>>
> >>> # the actual tic labels will only use the month name
> >>> set xtics format "%b" # Only the month names
> >>>
> >>> plot '2021.dat' binary format=%int32" using (time0 + $0 * 60.) : 1 with lines
> >>>
> >>>
> >>> Ethan
> >>>
> >>>
> >>>>
> >>>> Thanks in advance.
> >>>> Roderick Stewart
> >>>
> >>>
> >>>
> >>
> >>
> >
> >
> >
> >
>
>
|