Hello,
I want to plot many data points whose x values are very close to each other. To be able to separate them out a little more so that they can be seen more clearly, I want to increase the plot width (it can be much larger than the paper size; I don’t need to print it). I tried the MWE shown below. The problem is that this creates (1) Long tick lines for the y-axis; and (2) Big gap between the tick labels and the axis line.
My main question is:
How can I manipulate both these settings in Plots.jl so that this does not happen? I want the tick labels next to the axis line and tick lines to be smaller. I would really appreciate any help.
Thank you.
module CodeQuestion
import Plots
import Dates
import StatsBase; Sb = StatsBase
function plotdata()
xtickvals = Dates.DateTime(2020,1,4,0,0,0):Dates.Second(3600):Dates.DateTime(2020,1,5,0,0,0) |> collect
xvals = Dates.DateTime(2020,1,4,0,0,0):Dates.Second(10):Dates.DateTime(2020,1,5,0,0,0) |> collect
xvalsplt = Sb.sample(xvals, 6000, replace = false) |> sort
numobs = length(xvalsplt)
yvals = [rand(-5:-2) for i = 1:numobs]
Plots.plot( xvalsplt, yvals,
seriestype = :scatter,
label = :none,
xticks = xtickvals,
yticks = -10:2.5:0,
ytickfonthalign = :left,
left_margin = 20Plots.mm,
bottom_margin = 40Plots.mm,
xrotation = 90,
xlims = [Dates.value(xtickvals[1]), Dates.value(xtickvals[end])],
ylims = [-10, 1],
markersize = 4,
markerstrokecolor = "gray",
marketstrokewidth = 0.5,
size = (7200,500))
Plots.savefig("fig_temp.pdf")
end
end ## end module