public void paint(Graphics2D g) {
		g.setColor(foregroundColor);
		g.setFont(xLabelFont);

		
		if (recalculateBounds) {
			initializeBounds(g);
		}
		
//		if (allowMouseDragSelection && mouseIsBeingDragged) {
//			int xStart = round(mouseDragStart.x*xFactor);
//			int xEnd = round(mouseDragEnd.x*xFactor);
//			int rectL = Math.min(xStart, xEnd);
//			int wid = Math.abs(xStart-xEnd);
//			g.setColor(selectionRegionColor);
//			g.fillRect(rectL, round(graphAreaTop), wid, round(graphAreaHeight));
//			g.setColor(Color.GRAY);
//			g.drawRect(rectL, round(graphAreaTop), wid, round(graphAreaHeight));	
//		}
		
		if (allowMouseDragSelection && isRangeSelected && leftMarkerPos != rightMarkerPos) {
			g.setColor(selectionRegionColor);
			g.fillRect(leftMarkerPos, round(graphAreaTop), rightMarkerPos-leftMarkerPos, round(graphAreaHeight));
			g.setColor(Color.gray);
			g.drawLine(leftMarkerPos, round(graphAreaTop), leftMarkerPos, round(graphAreaTop+graphAreaHeight));
			g.drawLine(rightMarkerPos, round(graphAreaTop), rightMarkerPos, round(graphAreaTop+graphAreaHeight));
			double dataRX = figureXtoDataX(rightMarkerPos);
			String drxStr = StringUtilities.format(dataRX);
			double dataLX = figureXtoDataX(leftMarkerPos);
			String dlxStr = StringUtilities.format(dataLX);
			g.setColor(Color.gray);
			g.setFont(mouseDragNumberFont);
			g.drawString(drxStr, rightMarkerPos, round(graphAreaTop+graphAreaHeight+10));
			g.drawString(dlxStr, leftMarkerPos-g.getFontMetrics().stringWidth(dlxStr), round(graphAreaTop+graphAreaHeight+10));
		}

		
		if (drawMousePosTick) {
			g.setColor(Color.LIGHT_GRAY);
			g.setStroke(normalStroke);
			//System.out.println("Drawing mouse pos. tick 1");
			g.drawLine(round(graphAreaLeft-yTickWidth*xFactor), mousePos.y, round(graphAreaLeft), mousePos.y);
			//System.out.println("Drawing mouse pos. tick 2");
			g.drawLine(mousePos.x, round(xAxisPos), mousePos.x, Math.max(round(xAxisPos+2),round(xAxisPos+xTickWidth*yFactor)));
		}
		
		if (isYSelected) {
			g.setStroke(highlightStroke);
			g.setColor(highlightColor);
			paintYAxis(g);
		}

		g.setStroke(normalStroke);
		g.setColor(Color.black);

		paintYAxis(g);
		
		if (isXSelected) {
			g.setStroke(highlightStroke);
			g.setColor(highlightColor);
			paintXAxis(g);
		}


		g.setStroke(normalStroke);
		g.setColor(Color.black);

		paintXAxis(g);

	}