JLabel jl = new JLabel();
jl.setForeground(plotColor); // GlobalValues.defaultFormulaColor);
if (useLogical == false) // do not use logical coordinates
icon.paintIcon(jl, g2, coordx, coordy);
else // use logical coordinates to place the formula
{
double [] logicalCoords = { logicalx, logicaly};
int [] screenCoords = draw.project(logicalCoords[0], logicalCoords[1]);
icon.paintIcon(jl, g2, screenCoords[0], screenCoords[1]);