Ask Your Question

Tick Size in Plots

asked 2013-08-10 17:13:20 +0100

Chris Chudzicki gravatar image

Is it possible to increase the size of the tick marks on a plot made in sage? I would like to be able to insert plots into LaTeX documents using SageTeX's sageplot:

f(x) = (x-2)*(x+3)
p = plot( f(x), (x, -4, 4), thickness = 10, fontsize = 42 )

sageplot[width = 0.33 \textwidth]{p}

Because the plot has been scaled down in TeX, the tick marks are hardly visible. Can I increase their size?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-08-11 00:12:12 +0100

ppurka gravatar image

According to this stackoverflow question, you can use rcParams to set the tick size and width.

edit flag offensive delete link more


I've got the method using rcParams to work, using matplotlib.rcParams['xtick.major.size'] = 10 to increase tick length. When I try to increase thickness using matplotlib.rcParams['xtick.major.width'] = 4, sage complains that "xtick.major.width is not a valid rc parameter". In matplotlib.rcParams.keys() in Python clearly lists this as a valid paramter, though . . . ?

Chris Chudzicki gravatar imageChris Chudzicki ( 2013-08-14 11:56:42 +0100 )edit

Are you sure you didn't type it incorrectly in your sage prompt or sage cell? It works here sage: matplotlib.rcParams['xtick.major.width'] 0.5 sage: matplotlib.rcParams['xtick.major.width'] = 4 sage: matplotlib.rcParams['xtick.major.width'] 4.0

ppurka gravatar imageppurka ( 2013-08-14 13:02:42 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-08-10 17:13:20 +0100

Seen: 1,136 times

Last updated: Aug 11 '13