Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Labelling functions in Gadfly plot

Tags:

julia

gadfly

Plotting functions directly is easy in Gadfly:

plot([sin, cos], 0, 25)

This gives my two differently colored lines, automatically labelled in the legend as something like f_1 and f_2:

enter image description here

How can I change the default names in the "Color" legend?

like image 984
phipsgabler Avatar asked May 05 '17 09:05

phipsgabler


1 Answers

Set the color argument to a list of labels:

plot([sin, cos], 0, 25, color=["sine", "cosine"])

Update labels

like image 58
evan.oman Avatar answered Nov 15 '22 07:11

evan.oman