Tristan
Tristan

Reputation: 127

Get Colorbar Ticks

I am using a colorbar in matplotlib and because I want my graph to be more sensitive I take the square root of each value. This gives me square rooted values on my colorbar, but now I want to scale the ticks labels back to the real values. I am thusly having a hard time doing. I see that colorbar has a set_ticks function but I need to be able to get my ticks in the first place to do this generally. Is there an easy way to do this that I am not seeing, or some other way around this?

Upvotes: 5

Views: 1191

Answers (2)

pcu
pcu

Reputation: 1214

In matplotlib 2.1 you may use method colorbar.get_ticks().

Upvotes: 1

Static Void
Static Void

Reputation: 688

Calling the locator for the colorbar instance should return the tick locations. colorbar.locator().

Upvotes: 4

Related Questions