Plots.jl custom linestyle: longer dashes

I’m not sure whether or not you can pass those types of options (I suspect not), but I also don’t think they are necessary. You can control the line style with the usual linestyle option of Plots and you can customize dash styles as desired using the dash_pattern keyword argument:

using Plots
pgfplotsx()
x = 0:10
y = ones(length(x))
default(lw=2)
plot(x, 1*y, ls=:solid)
plot!(x, 2*y, ls=:dot)
plot!(x, 3*y, ls=:dash)
plot!(x, 4*y, ls=:dashdotdot)
plot!(x, 5*y, ls=:dash, dash_pattern="on 1cm off 0.5cm")    
plot!(x, 6*y, ls=:dash, dash_pattern="on 1cm off 0.5cm on 0.25 cm off 0.5cm")    

2 Likes