private synchronized void updateImage(int width, int height) {
		image = createImage(width, height);
		int w = width - (leftMargin + rightMargin);
		int h = height - (topMargin + botMargin);
		if (w <= 0 || h <= 0)
			return;
		if (xmin >= xmax || ymin >= ymax)
			return;
		xscale = (double) w / (double) (xmax - xmin);
		yscale = (double) h / (double) (ymax - ymin);
		Graphics g = image.getGraphics();
		// x-axis
		g.setColor(Color.LIGHT_GRAY);
		drawLine(g, xmin, ymin, xmax, ymin);
		drawLine(g, xmin, ymax, xmax, ymax);
		g.setColor(Color.BLACK);
		g.drawString(Integer.toString(xmax), wpos(xmax), hpos(ymin) + botMargin
				/ 4);
		// y-axis
		drawLine(g, xmin, ymin, xmin, ymax);
		g.drawString(Integer.toString(ymin), leftMargin / 3, hpos(ymin) + 5);
		g.drawString(Integer.toString(ymax), leftMargin / 3, hpos(ymax) + 5);
		g.drawString("time=" + current_x, wpos(xmin), hpos(ymin) + botMargin
				/ 2);

		for (int i = 0; i < solvers.size(); i++) {
			Solver solver = solvers.get(i);
			Integer[] data = solverData.get(solver);
			if (data == null)
				continue;
			g.setColor(colors[i % colors.length]);
			String msg = solver.toString() + "=" + solver.getBestValue();
			g.drawString(msg, wpos(xmin) + 100 * (i + 1), hpos(ymin)
					+ botMargin / 2);
			int x0 = -1;
			int y0 = -1;
			for (int j = 0; j < data.length; j++) {
				if (data[j] == null)
					continue;
				int x = xmin + j;
				int y = data[j].intValue();
				if (x0 >= 0) {
					drawLine(g, x0, y0, x, y);
				}
				x0 = x;
				y0 = y;
			}
		}
	}