code: def get_axes_ratio(ax):
      
      ax_bbox_points_in_fig_coord = ax.get_position().get_points()
      ax_bbox_points_in_display_coord = [
              ax.figure.transFigure.transform(point) for point in ax_bbox_points_in_fig_coord ]
      lower_left_coord, upper_right_coord = ax_bbox_points_in_display_coord
      ax_bbox_dimension_in_display_coord = upper_right_coord - lower_left_coord
      width, height = ax_bbox_dimension_in_display_coord
      ratio = height / width
      return ratio
docs: Return height / width ratio of the given Axes object.
      
      The ratio is calculated in 'display coordinate',
      defined in matplotlib document on transformation.
      Thus, the calculated ratio is what one would feels when the Axes
      is displayed to the her/him.