Hi,
I am trying to write some annotations in a plot, but instead of horizontally, I would like them to do that vertically.
I am using Julia 0.6.4. My code is like:
using Plots # Notice: I'm not using Pyplot package, but just the back-end!
pyplot()
# Initialize plot
wanted_font = font(9, "georgia")
fig_2 = plot(
tickfont = wanted_font, legendfont = wanted_font, guidefont = wanted_font,
xlabel = "My x-axis", ylabel = "My y-axis",
size = (600,300),
legend = false, grid = false,
xmin = 0, ymin = 0,
)
scatter!(fig_2,
x_vector, y_vector,
c = [1], marker = (:circle, 2), markerstrokewidth = 0.1,
)
how_many = 50 # After how many points to draw a vertical line
vline!(fig_2, [x_vector[how_many],
xaxis = [0, 1000], yaxis = [0, 500],
annotations=(x_vector[how_many], 250, text("My description", font(9,"georgia"))),
leg = false,
)
This piece of code simply plots an horizontal annotation saying “My description”. Does anyone have any suggestion on how to rotate such annotation?
Note: I have already checked https://discourse.julialang.org/t/text-in-figure-using-pyplot/1337 but if I try using e.g.: text(4, 0.5, "hello", rotation=30)
I get the following error message: function text does not accept keyword arguments
.
Thank you in advance!