code: def size_r_img_inches(width, height):
      
      # both width and height are given
      aspect_ratio = height / (1.0 * width)
      return R_IMAGE_SIZE, round(aspect_ratio * R_IMAGE_SIZE, 2)
docs: Compute the width and height for an R image for display in IPython
  
      Neight width nor height can be null but should be integer pixel values > 0.
  
      Returns a tuple of (width, height) that should be used by ggsave in R to
      produce an appropriately sized jpeg/png/pdf image with the right aspect
      ratio.  The returned values are in inches.