I have created a plot recipe for one of my types in GeoStats.jl:
@recipe function f(γ::EmpiricalVariogram; bincounts=true) # get the data x, y, n = values(γ) # discard empty bins x = x[n .> 0]; y = y[n .> 0]; n = n[n .> 0] # draw bin counts as a measure of confidence if bincounts @series begin # plot a "frequency" instead of raw counts f = n*(maximum(y) / maximum(n)) / 10. seriestype := :bar fillalpha := .5 color := :blue label := "bin counts" x, f end # annotate the bins @series begin seriestype := :scatter primary := false markersize := 0 series_annotations := string.(n) # how to set the font size and color? x, zeros(x) + .001 end end seriestype := :scatter xlim := (0, γ.maxlag) color --> :orange xlabel --> "Lag h" ylabel --> "Variogram(h)" label --> "variogram" x, y end
It is working nicely, except that I don’t know how to set the font size and color for the annotations in the bins. Could someone help? Is it possible to control font and color without depending on Plots.jl? I would like to have RecipesBase.jl as my only dependency.
The problem is that with too many bins, the annotations overlap. If you know a better approach to annotating in this case, I’d love to hear.