Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Your code doesn't compile for me but the basic answer to your question is here: use the p.axes_width() command to change the axes width. Go to a Sage cell server and type in

p = plot(sin(x), (x, 0, 2*pi))
p.axes_width(10)
p.show()
p.save("MyPic.pdf")

and you'll get the output with extremely thick axes. The bottom left will have a link to the PDF and that has the thick axes as well.

Given that latex is integrated with Sage, I think you could have much better looking graph paper working in LaTeX, such as is mentioned here. The tkz-fct package, for example can give good results.

Your code doesn't compile for me but the The basic answer to your question is here: use the p.axes_width() command to change the axes width. Go to a Sage cell server and type in copy/paste your code with the extra line to thicken the axes:

k = 8
p = plot(sin(x), plot(k, (x, -k, k), 
     thickness = 0, 2*pi))
p.axes_width(10)
p.show()
p.save("MyPic.pdf")

     aspect_ratio = 1, 
     gridlines = True, 
     axes_labels=['$x$','$y$'], 
     ticks=[[-k..k],[-k..k]],
     tick_formatter = [['$-8$', '', '$-6$', '', '$-4$', '', '$-2$', '', '', '', '$2$', '', '$4$', '', '$6$', '', '$8$'], ['$-8$', '', '$-6$', '', '$-4$', '', '$-2$', '', '', '', '$2$', '', '$4$', '', '$6$', '', '$8$']], 
     gridlinesstyle = dict(color = "gray", linestyle = "-")
)

p += plot(0, (x, -k, k), thickness = 0) #to establish graph width
p += plot(-k, (x, -k, k), thickness = 0) #to establish graph height
p.axes_width(5)
show(p)

p.save('graph8l.pdf')

and you'll get the output with extremely thick axes. The bottom left the result will have a link to the PDF and that has the be thick axes for your screen output as well. well as the PDF output.

Given that latex is integrated with Sage, I think you could have much better looking graph paper working in LaTeX, such as is mentioned here. The tkz-fct package, for example can give good results.