I am using Julia for Financial Data Processing and then plotting graphs based on the financial data.
on X-Axis of graph I am plotting dates (per day prices) on Y-Axis I am plotting Stock Prices, MovingAverage13 and MovingAverage21
I am currently using DataFrames to plot the data
Code-
df=DataFrame(x=dates,y1=pricesClose,y2=m13,y3=m21)
l1=layer(x="x",y="y1",Geom.line,Theme(default_color=color("blue")));
l2=layer(x="x",y="y2",Geom.line,Theme(default_color=color("red")));
l3=layer(x="x",y="y3",Geom.line,Theme(default_color=color("green")));
p=plot(df,l1,l2,l3);
draw(PNG("stock.png",6inch,3inch),p)
I am Getting the graphs correctly but I am not able to add a Legend in the Graph that shows blue line is for Close Prices red line is for moving average 13 green line is for moving average 21
How can we add a legend to the graph?