render - matplotlib agg ticks when rendering floating points -
this same problem here: python odd axis ticks, matplotlib. except no 1 following question make little clearer:
i'm using linux machine:
$ uname -a $ linux stokes1 2.6.32.59-0.3-default #1 smp 2012-04-27 11:14:44 +0200 x86_64 x86_64 x86_64 gnu/linux
so happens matplotlib (version 1.0.0) when using agg (v2.2; combination suspect, tkagg etc. can't check sure because tkagg available on machine). not pc don't have root access can talk administrators , let them know it, wanted details on matter.
so if take @ pictures can see problem ticks. found out happens when ticks floating point numbers can seen. don't think it's font problem since i'm using standard bitstream vera , doesn't happen if use svg backend.
this can reproduced by:
import matplotlib m m.use('tkagg') pylab import * plot() show()
i didn't find answer problem boxes around floating point numbers, administrator of machine gave me workaround:
import matplotlib m m.use('agg') import matplotlib.pyplot plt matplotlib.ticker import formatstrformatter plt.gca().xaxis.set_major_formatter(formatstrformatter('%.1f')) plt.gca().yaxis.set_major_formatter(formatstrformatter('%.1f')) plt.plot() plt.savefig('test')
which produces result:
if explanation administrator of machine weird boxes appear add answer. meanwhile hope helps someone.
Comments
Post a Comment