0

How do I remove the seconds from showing up in the plot below? (The date format change seems to not alter the plot at all!)

using DataFrames, Dates, Plots
gr(linewidth=3, markersize=4, titlefont=18, legendfont=12, guidefont=18, tickfont=14, legend=:outertopright)
df = DataFrame()
df.Time = ["0:05", "1:05", "2:05", "4:05", "5:36"]
df.Data = [0.0, 1.0, 0.5, 0.4, 0.1]
df.Time = Time.(df.Time, DateFormat("H:M"))
plot(df.Time, df.Data)
hegdep
  • 596
  • 1
  • 6
  • 16

1 Answers1

1

You can further format df.Time with Dates.format():

df.Time = Dates.format.(Time.(df.Time, DateFormat("H:M")), "HH:MM")

replaces the second-to-last line above.

Bill
  • 5,600
  • 15
  • 27