That’s great. This pretty much solves my problem. Thank you!
Besides that, can I ask you, what those 1, 1 in scatter!(1,1, markershape=:star, color=:blue, label="the star series") mean?
I tried scatter(10...) and it plotted the legend 10 times. According to documentation - Basics · Plots the number means count of series. But what about the second 1?
To be honest, I’m sometimes confused by the versatility of arguments.
E.g.
scatter(1, 1, ...)
vs.
scatter([1], [1], ...)
I’m comming from statically typed languages (.NET world) and I can quite easily determine what method will be caled, based on the arguments I pass. Here I’m a little bit lost.
I understand completely. Plots.jl can be tricky, like many other plotting packages.
To answer your question, I do not know why I have a second “1” in those scatter! lines. I had this method of building a legend stored away in a file of my “helper functions” for several years now. So maybe at one time the second “1” was required - I do not remember. But as you probably already figured out, the code works without the second “1”.
Unfortunately this solution does not work anymore, the marker is not displayed because Plots considers that data are empty… It works if you replace 1 by [1] but it adds a point on the plot…