1

I am trying to create square plots (equal axes length) on log-log scale, but I have no luck. Can any one help me with this.

2
  • 1
    Can you show any of what you have done to this point? Commented Dec 20, 2014 at 11:46
  • Tried axis square? ;) Commented Dec 20, 2014 at 11:51

1 Answer 1

1

You can use this function:

def set_aspect_ratio_log(plot, aspect_ratio):
        x_min, x_max = plot.get_xlim()
        y_min, y_max = plot.get_ylim()
        return plot.set_aspect(aspect_ratio * ((math.log10(x_max / x_min)) / (math.log10(y_max / y_min))))

Hope this helps.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.