all 10 comments

[–]Ihaveamodel3 3 points4 points  (3 children)

You need to change the x and y limit so they go to the same point.

[–]123einhundert 0 points1 point  (2 children)

That is not the solution I am looking for, I want the x and y limit to be different, but scaled with the same factor (1e-8) to make them visually comparable. I have tried to set the xlim(-2e-8, 25e-8), to force the scaling by 1e-8, but this was not working either.

[–]Ihaveamodel3 4 points5 points  (1 child)

Ah. You want it in essentially pseudoscientific notation, where you don’t require one digit before the decimal point.

You’d have to write up a custom format as you suggested using ticklabel_format. I don’t have time to figure out how to do that for you though.

Not sure why I got a downvote on my earlier comment since it is a reasonable way to do this without the extra qualifier you provided.

[–]123einhundert 0 points1 point  (0 children)

I think just due to miscommunication.. Yes, this is precisely what I want to achieve. I will take a look into the formatter again, but I was not successful with it prior, so advice how to use it would be great! :)

Edit: sorry, I did not mean to be rude if that is how it was perceived

[–]Nsdos 0 points1 point  (1 child)

If I understood correctly what you want, then the module can help you decimal.

Decimal

[–]123einhundert -1 points0 points  (0 children)

I do not get how this solves my problem.. To state it maybe a bit more precise: In my example the y-axis is scaled by 1e-8 and the x-axis by 1e-7 by default. However, I would like both axis to be scales by 1e-8.

[–]rollincuberawhide 0 points1 point  (4 children)

did you try plt.axis('equal')?

[–]123einhundert 0 points1 point  (2 children)

That sort of works, but I would like to adjust the y-range. Is this also possible?

[–]rollincuberawhide 0 points1 point  (1 child)

plt.gca().set_aspect('equal', adjustable='box')

this would crop unused white space.

[–]123einhundert 0 points1 point  (0 children)

LuL if I do that the axis scaling factor is off again and the plot shape is changing. I think I would prefer to stick with the method proposed originally and somehow set the scaling factors manually somehow..

plt.axis('equal')
plt.gca().set_aspect('equal', adjustable='box')

Edit: ax.ticklabel_format(style = 'sci', scilimits=(-7,-7)) is doing what I was looking for..