Axes Labels and Legends

Description

Here we will be placing a legend and axes labels on the graph of the function

(1)
\begin{align} f(x) = sin(\pi x) \end{align}

A legend is generated by setting legend_label when creating the plot object, and axes labels are set with the .axes_labels() method.

Sage Cell

Code

p = plot(sin(pi*x), -pi, pi, legend_label='f(x) = sin (pi x)' )
p.axes_labels(['x', 'y=f(x)'])
p.show()

Options

Tags

Related Cells

Attribute

Date: 03 Mar 2019 19:35

Submitted by: Zane Corbiere

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License