def height_implied_by_aspect_ratio(W, X, Y):
    """
    Utility function for calculating height (in pixels)
    which is implied by a width, x-range, and y-range.
    Simple ratios are used to maintain aspect ratio.

    Parameters
    ----------
    W: int
      width in pixel
    X: tuple(xmin, xmax)
      x-range in data units
    Y: tuple(xmin, xmax)
      x-range in data units

    Returns
    -------
    H: int
      height in pixels

    Example
    -------
    plot_width = 1000
    x_range = (0,35
    y_range = (0, 70)
    plot_height = height_implied_by_aspect_ratio(plot_width, x_range, y_range)
    """
    return int((W * (Y[1] - Y[0])) / (X[1] - X[0]))