Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168728
Image: ubuntu2004

This is very simple and bad example of logarithim plot in sage, but I found no standard examples.

from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure from matplotlib.ticker import *
def log_plot(x,y, title='', xlabel='', ylabel=''): fig = Figure() plot1 = fig.add_subplot(111) plot1.set_title(title) plot1.set_ylabel(ylabel) plot1.set_xlabel(xlabel) plot1.plot(x,y) plot1.set_yscale('log') canvas = FigureCanvas(fig) canvas.print_figure('sage.png')
log_plot(range(10),[10*i*i for i in range(10)], title='Title', xlabel='X Label', ylabel='Y Label')