I would like to put on the lower right corner of my plots a notification text string, typically citing the the “data source : date of production”
Although I can put text using
annotate!(xpos, ypos, "my text", :color)
it is presently missing some needed options for which I didn’t manage to find a solution either going through the Plots.jl documentation or searching discourse.
What I’m looking for is:
how to change the font used (presently by default it’s way too big)
how to make it right aligned.
N.B. all this is possible by using PyPlot directly, but I want to move away from that to a more Julian-like and consistent way of doing.
with the gr() backend that does the trick! THANKS.
however when using the pgfsplots() backend (which is the one I usually employ), one cannot annotate below the x-axis, nor change the font-size
Can I bother you for how to change the font to “Courier”, “Sans” for instance (again I do not manage to extract this from the docs, nor ? or methods(text) get me any furher)?
One thing to consider if you’re using pgfplots because you’re embedding in LaTeX. Consider savefig("myfigure.tex"), the resulting figure should take fonts and stuff from the latex document.
Is it possible to place an annotation at position (x,y) on a plot as described above but to also have the value of a variable displayed? I have in mind something like “Position =” z. Here the value of the variable z would be placed after the text.
You can achieve this by using $ in a string to specify the value of your variables.
For example: annotate!(x, y, Plots.text("$x, $y", :red, :right, 10))