Ask Your Question

Change tick mark format for y-axis to 10^n

asked 2015-03-23 13:58:42 -0500

calc314 gravatar image

I would like to have the tick mark labels on the y-axis only switch from the exponential format using e to a format using 10^n. For example, instead of 1e19, I would like to see 10^19.

I'm sure this is a tick_formatter thing, but it is escaping me.

edit retag flag offensive close merge delete


I wish, but I fear it is not. You may want to see the matplotlib documentation to see if it is easily possible; they have some algorithms for when to switch to the e thing, but don't know what else it does...

kcrisman gravatar imagekcrisman ( 2015-03-23 15:27:45 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2015-03-24 10:04:23 -0500

calc314 gravatar image

Thanks @kcrisman! I had to "do it by hand" in some sense. I specified the tick marks with ticks=[[10,20],[1*10^9,2*10^9]]. Then, I specified the labels using latex with tick_formatter=[None,['$1.0\\times 10^9$', '$2.0\\times 10^9$']].

edit flag offensive delete link more


Great! But why not try this:

kcrisman gravatar imagekcrisman ( 2015-03-24 20:10:22 -0500 )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

1 follower


Asked: 2015-03-23 13:58:42 -0500

Seen: 235 times

Last updated: Mar 24 '15