How to add titles, axis label, and legend in sagemath?

myplot = list_plot(
    zip(range(20), range(20)), 
    legend_label='legend item 1')

myplot2 = list_plot(
    zip(range(20), [i*2 for i in range(20)]), 
    legend_label='legend item 2')

combined = myplot + myplot2

combined.axes_labels(['testing x axis', 'testing y axis'])
combined.legend(True)'Testing title', frame=True, legend_loc="lower right")

I’m not entirely certain why there’s no title method and why the title has to be specified inside show when the axes don’t have to be, but this does appear to work.

Read more here: Source link