private void plot(int[] plot, int depth) {
        java.util.List<Point> pts = new ArrayList<Point>();
        
        for (int i = 0; i < 1000; i++) {
            
            double x0 = random(-2.0, 1.0), y0 = random(-1.5, 1.5), x = 0, y = 0;
            boolean escapes = false;
            
            for (int j = 0; j < depth && !(escapes = x * x + y * y > 4); j++) {
                
                double px = x * x - y * y + x0;
                double py = 2 * x * y + y0;
                x = px;
                y = py;
                
                int ix = (int) (image.getHeight() * (px + 2.0) / 3.0);
                int iy = (int) (image.getWidth() * (py + 1.5) / 3.0);
                
                if (ix >= 0 && iy >= 0 && iy < image.getWidth() && ix < image.getHeight())
                    pts.add(new Point(iy, ix));
            }
            
            if (escapes) 
                for (Point p : pts) 
                    plot[p.y * image.getWidth() + p.x]++;
            
            pts.clear();
        }
    }