Ask Your Question
1

Tick Size in Plots

asked 11 years ago

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:

\begin{sagesilent}
f(x) = (x-2)*(x+3)
p = plot( f(x), (x, -4, 4), thickness = 10, fontsize = 42 )
\end{sagesilent}

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?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 11 years ago

ppurka gravatar image

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

Preview: (hide)
link

Comments

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 ( 11 years ago )

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 ( 11 years ago )

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 11 years ago

Seen: 1,607 times

Last updated: Aug 11 '13