ayeayeron
ayeayeron

Reputation: 63

Custom Matplotlib Axis Scale

I'm trying to make a graph with the same axis scales as this one:

enter image description here

The y axis can be done simply by setting the y scale to 'Log', but I don't know how to set the x axis to be stretched at both extremes as shown in the graph, or what that scale is called. It doesn't have built in support in matplotlib.

It looks like it could be related to a normal curve. How can I set an axis to this scale in matplotlib?

Upvotes: 3

Views: 3056

Answers (1)

Nelz11
Nelz11

Reputation: 3266

I had nearly the same problem! The scale is a probability scale that reflects the cumulative density function of some distribution. I created a scale class that you can use to create this. Check out this matplotlib probability axis scale here for the implementation. With this scale class you can adjust your scale to match any normal distribution by passing the mean, mu, and standard deviation, sigma to the scale class.

You can also check out this implementation if you want the appearance of a probability scale but with more resolution at the tails.

Upvotes: 4

Related Questions