@Override
    public String getCode() {
        double maxY = 0;
        double minX = 0;
        double minY = 0;
        double[] graphSize = PSTricksGraphEditor.canvas.getGraphSize();
        if(graphSize != null){
            maxY = graphSize[1]/50;
            minX = graphSize[2]/50;
            minY = graphSize[3]/50;
        }
        double codeX = (double)x/50;
        codeX -= minX;
        //double middleY = (maxY + minY)/2;
        double codeY = (double)y/50;
        //if(codeY == middleY) codeY = 0;
        //else codeY = middleY - codeY;
        if(codeY == maxY) codeY = 0;
        else codeY = maxY - codeY;
        String textCode = text.replaceAll("\\\\", "\\\\textbackslash ");
        if(!comments.isEmpty())
            return comments + System.getProperty("line.separator") + 
                    "\\uput[0]("+codeX+","+codeY+"){"+textCode+"}";
        
        return "\\uput[0]("+codeX+","+codeY+"){"+textCode+"}";
    }