g2D.drawString(label, dx, ascent+dy);
}
public static ImageIcon asIcon(String expression, String label) {
Argument argument = ArgumentParser.parseArgument(expression, knownArguments, null, mathCollection); // null clipboard
Box box = argument.toBox(Box.X_CENTRE_ALIGN|Box.Y_CENTRE_ALIGN, colourScheme);
BufferedImage image = ImageTools.boxToBufferedImage(box, 160, 120, colourScheme, false);
labelImage(image, label);
ImageIcon imageIcon = new ImageIcon(image);
return imageIcon;
}