Suppose I have the following data and its plot:
using DataFrames
using StatsPlots
using Plots
using Dates
dates = Date(2021, 1, 1):Day(1):Date(2023, 3, 28)
n = length(dates)
df = DataFrame(
date=dates,
col1=rand(n),
col2=rand(n)
)
@df df plot(
:date, cols(2:3),
legend=:outerright,
xlabel="Date",
ylabel="Val",
title="Test plot",
size=(1000, 600),
dpi=300,
left_margin=5Plots.mm,
bottom_margin=5Plots.mm,
)
How can I change the precision of dates to monthly or quarterly in x-ticks?