private void markAxes(Graphics gr)
    {
        gr.setColor(Color.LIGHT_GRAY);
        int h = getSize().height;
        int w = getSize().width;
        double W = (maxX - minX)*1.1;
        double H = (maxY - minY)*1.1;
        double  minx = minX - (maxX - minX)*0.05,
                maxx = maxX + (maxX - minX)*0.05,
                miny = minY - (maxY - minY)*0.05,
                maxy = maxY + (maxY - minY)*0.05;
        double interval = getInterval(W);
        Font font = new Font("Monospace", Font.PLAIN, (8 > h/50 ? 8 : h/50));
        gr.setFont(font);
        double x = 0;
        while (x < minx)
            x += interval;
        while (x-interval > minx)
            x -= interval;
        while (x < maxx)
        {
            PlotPoint pp = translate(new PlotPoint(x,miny));
            //System.out.println(pp.x + " " + pp.y);
            if (showGrid) gr.drawLine((int) (pp.x), (int) (pp.y), (int) (pp.x), 0);
            else gr.drawLine((int) (pp.x), (int) (pp.y), (int) (pp.x), (int) (pp.y - 5));
            String str = Double.toString( (double)(Math.round(100*x))/100 );
            gr.drawString( str, (int)(pp.x-5), (int)(pp.y-5) );
            x += interval;
        }
        interval = getInterval(H);
        double y = 0;
        while (y < miny)
            y += interval;
        while (y-interval > miny)
            y -= interval;
        while (y < maxy)
        {
            PlotPoint pp = translate(new PlotPoint(minx,y));
            if (showGrid) gr.drawLine(0, (int) (pp.y), w, (int) (pp.y));
            else gr.drawLine(0, (int) (pp.y), 5, (int) (pp.y));
            String str = Double.toString( (double)( Math.round(100*y))/100 );
            gr.drawString( str, 5, (int)(pp.y) );
            y += interval;
        }
    }