phipsgabler
phipsgabler

Reputation: 20950

Labelling functions in Gadfly plot

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?

Upvotes: 7

Views: 234

Answers (1)

evan.oman
evan.oman

Reputation: 5572

Set the color argument to a list of labels:

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

Update labels

Upvotes: 5

Related Questions