The GGplot documentation seems to indicate you can save a figure as jpg by using the device paramter, however when I try to use it I get the error: Exception, `
unknown format jpg.
def chart(dataframe, stock_name, title):
title = str(title)
name = str(stock_name)
graph_title = "TYD Chart for " + title
df = dataframe.set_index('date')
df = df[(df["stock_name"]==name)].ix['2016/01/01':'2016/02/09']
ggplot_obj = ggplot(df.reset_index(), aes('date','close')) + geom_line() + ggtitle(graph_title)
ggsave(filename="/Users/Joshua/Documents/stocks/" + title, device="jpg",plot = ggplot_obj, width = 10, height = 6)
print ("Saved File for " + str(title))
Saved the file to png
instead using the tutorial here on GGSAVE
Using the tutorial here, GGSAVE tutorial, saved the file as png instead of JPG.