(Call for opinions) Default formatting for upcoming time-series plotting in Lilaq

Hello everyone!

There have been repeated requests for time-series plotting with Lilaq and now I have almost implemented it:

#let xs = (
  datetime(year: 2011, month: 2, day: 1),
  datetime(year: 2011, month: 5, day: 23),
  datetime(year: 2011, month: 7, day: 4)
)

#lq.diagram(
  lq.plot(xs, (1, 1.2, 2))
)

The question is: what is the best default for formatting datetime ticks? I find other plotting tools a bit unsatisfactory in this regard and would like to do it better. Note that Lilaq allows everything to be configured, this question is mostly about the default!

You are welcome to read this post in the pull request that adds the datetime support and share your opinion. Thank you!

5 Likes

Hi there! Maybe you should change your category to General? I feel like this is more like a discussion and not a question/problem about Typst itself. Something similar was done by laurmaedje here

3 Likes

Hi @Adrian_Weitkemper , you are right!

I’ve read the post and I think the choices you made to:

  • Only show the year offset if the year doesn’t change on the time axis, and
  • Drop the offset if one of the Januaries is replaced with a year

are good defaults. However, there is one case with the second point I don’t understand. What happens if January isn’t part of the set of tick labels, but the year still jumps? For instance, say one starts measurements in October and alternates months, so the time axis is filled with {October, December, February, April}. What happens then? Does the February instead get replaced with the new year?

2 Likes

Hi @Paul744 ,

The default locator will always place a tick at Januaries. In the case that every second month is displayed, it will always be the odd ones: January, March, May, July, September, November. The same holds for days, hours, and so on.

If the user deviates too much from the default setting by changing the configuration, there might again be redundancies or missing information. But once a user starts to tweak, they also get more aware to filling in the missing information.

It’s very complex and impossible to do it right for everyone but I had two main desiderata:

  1. It should be configurable such that everything is possible to achieve.
  2. The default should never be ambiguous or redundant.

The second point is especially important in the light of the fact that the defaults are often left as-is and not thought about much by many users. Bad defaults then put the burden on the readers.

3 Likes