How to increase plot width in Julia Plots.jl without increasing tick line width and the gap between tick and tick axis

Different backends behave differently. For example, InspectDR doesn’t stretch your plot as an image the way the GR backend appears to be doing. Instead, it uses the size = (7200,500) argument to specify the canvas size, and always keeps the same tick length (which is specified in its “Layout” structures).

GR output (Default in Plots.jl)

InspectDR output

If you add the InspectDR package, and the code needed to use it, you get the following:

import StatsBase; Sb = StatsBase
import InspectDR

function plotdata()
    Plots.inspectdr() #Choose InspectDR backend
    #Plots.gr() #Choose GR backend
    xtickvals = Dates.DateTime(2020,1,4,0,0,0):Dates.Second(3600):Dates.DateTime(2020,1,5,0,0,0) |> collect

Note that InspectDR doesn’t rotate the x-tick labels at the moment - but I think that it probably works out for the best in this case.

Other backends

You might want to experiment with other backends if you don’t like the InspectDR output. InspectDR is not as customizable as other backends.