Menu ▾ ▴

#2903 Add tics to time axis

None
open-not-a-bug
nobody
None
1 day ago
2 days ago
Anonymous
No

The following

set xdata time
set timefmt '%d-%m-%Y'
set xtics add ('Jan', '15-01-2026')
plot '-' using (timecolumn(1)):2 with lines
01-01-2026 1
31-12-2026 2
e

adds a tic labelled '15/01/26' (the default format) in the middle of january, when I would expect 'Jan' there.

(gnuplot 6.0 patchlevel 5 on Windows)

Discussion

  • Ethan Merritt

    Ethan Merritt - 1 day ago

    The problem here is an extra comma in the "set xtics" command. The format of the command is
    set ("label1" place1, "label2" place2, ...)

    Change your command to
    set xtics add ('Jan' '15-01-2026') # no comma

     
  • Ethan Merritt

    Ethan Merritt - 1 day ago
    • status: open --> open-not-a-bug
    • Group: -->
    • Priority: -->
     

Log in to post a comment.