How can I adjust the position of the x-label in a plot using Plots.jl? e.g. if I do
using Plots
gr() # making it explicit I'm using the GR backend
plot(1:10, rand(1:2, 10))
xlabel!("my nice xlabel")
I get a plot with the xlabel centred:
I want to change the x-position of the x-label. If I try to add text centred around x = 7 using annotate!
:
plot(1:10, rand(1:2, 10))
annotate!(7, 0.8, "my nice xlabel") # guessing y would be 0.8 for the text, based on the y-axis
I get a plot with no text, because annotate!
only seems to add text to the figure area bounded by the axes:
(whereas
annotate!(7, 1, "my nice xlabel")
adds text because y ∈ [1, 2], and y position for the text ∈ [1, 2]):
Are there any specific arguments I need to pass to annotate!
in order for it to plot text in places outside the axes, or is there a more direct way of controlling the position of the x-label?