What is the correct way to replace matplotlib tick labels with computed values?
I have a figure with a log axis and I would like to relabel the axis ticks with logs of the values, rather than the values themselves The way I've accomplished this is with plt.axes().set_xticklabels([math.log10(x) for x in plt.axes().get_xticks()]) but I wonder if there isn't a less convoluted way to do this. What is the correct idiom for systematically relabeling ticks on matplotlib plots with values computed from the original tick values? tacaswell Look into the Formatter classes. Unless you are putting text on your ticks you should almost never directly use set_xticklabels or set