Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow customized tick color #9578

Open
kcrisman opened this issue Jul 23, 2010 · 2 comments
Open

Allow customized tick color #9578

kcrisman opened this issue Jul 23, 2010 · 2 comments

Comments

@kcrisman
Copy link
Member

Such as arbitrary ticks, color... Here are some hints for this from sage-devel

> I figure with some polishing it could go into Sage. Part of that 
> polishing would require to figure out how one can make 
> sage: pylab.clf() 
> sage: _ = pylab.pcolor(pylab.rand(2,2)) 
> sage: pylab.savefig('foo.png',dpi=96) 
> not print out indices for x and y from 0 to n but from a to b. I 
> couldn't figure this out. Maybe someone on this list knows from the 
> top of the head? 


Here's one way to do it, just by changing the tick labels.  There are 
other more flexible ways too: 
sage: import pylab 
sage: pylab.clf() 
sage: p = pylab.pcolor(pylab.rand(2,2)) 
sage: p.axes.get_xticks() # see what ticks are in the plot 
array([ 0. ,  0.5,  1. ,  1.5,  2. ]) 
sage: _=p.axes.set_xticklabels(['0','1000','2000','3000','4000']) 
sage: pylab.savefig('foo.png',dpi=96) 
Or if you just want to multiply each tick label by a certain amount: 
sage: _=p.axes.set_xticklabels([str(i) for i in 1000*p.axes.get_xticks()]) 
sage: pylab.savefig('foo.png',dpi=96) 
Thanks, 
Jason 

and

Yes, I think it would be pretty easy.  Note that matplotlib just added 
some nice convenience functions for dealing with changing the styles of 
ticks too, so we could easy change the colors or weights or whatever as 
well. 

Component: graphics

Issue created by migration from https://trac.sagemath.org/ticket/9578

@kcrisman
Copy link
Member Author

comment:1

#1431 and #2189 are also relevant.

@kcrisman
Copy link
Member Author

kcrisman commented Jul 7, 2012

comment:2

We have arbitrary ticks now, and some formatting. Since this is a little vague, I'm making it be about color.

See also #13078.

@kcrisman kcrisman changed the title Add even more customization of ticks in plots Allow customized tick color Jul 7, 2012
@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@mkoeppe mkoeppe removed this from the sage-6.4 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants