code: public void drawTextBaseRatio(String label, double horizontalReference, double verticalReference, double rotation, double[] coord) {
          int[] sc = projection.screenProjectionBaseRatio(coord);
          int x = sc[0];
          int y = sc[1];
  
          AffineTransform transform = g2d.getTransform();
  
          // Corner offset adjustment : Text Offset is used Here
          FontRenderContext frc = g2d.getFontRenderContext();
          Font font = g2d.getFont();
          double w = font.getStringBounds(label, frc).getWidth();
          double h = font.getSize2D();
  
          if (rotation != 0) {
              g2d.rotate(rotation, x, y);
          }
  
          x -= (int) (w * horizontalReference);
          y += (int) (h * verticalReference);
  
          g2d.drawString(label, x, y);
  
          g2d.setTransform(transform);
      }
docs: Draw a string with given reference point and rotation angle. (0.5, 0.5)
  is center, (0, 0) is lower left, (1, 0) is upper left, etc.
  The angle of rotation is in radians. The logical  are proportional to
  the base coordinates.