In Plots, I’m using custom ticks and save the plot in high resolution with
size attribute. However, as far as I have seen Plots does not adjust the font size of anything when this attribute is used, and the user has to adjust them manually for different sizes of plots.
Take a look here for example:
Ticks are nearly invisible, but if zoom you can actually see them. Luckily, I found the optimal font size for this plot to be 60. But changing the font size now poses another problem where texts exit the plot and get truncated. Therefore, there should be another 2 variables to adjust,
y_offset. Here is a minimal example:
using Plots, TestImages arr = hvcat(5,[testimage("cameraman") for i in 1:30]...) rangeX = range(256; step=512, stop=size(arr)) rangeY = reverse(range(256; step=512, stop=size(arr))) _xticks = (rangeX, string.(rangeX)); _yticks = (rangeY, string.(rangeY)); x_offset = 100; #if 0, ticks on y axis get truncated y_offset = 0; _tickfontsize = 60; plot(1:size(arr), 1:size(arr), arr, xticks=_xticks, yticks=_yticks, tickfontsize=_tickfontsize, size=(size(arr)+x_offset,size(arr)+y_offset), xrotation=70) png(joinpath(@__DIR__,"img.png"))
Is there a workaround for this problem or do I have to manually adjust these parameters for every plot?