如何更改facet_grid的图例?

时间:2018-04-02 17:06:53

标签: r ggplot2 facet-grid

我使用R和ggplot来做一个小的多重图。

ggplot(data=datatest,aes(x=Percentage,y=Accuracy,group=interaction(Classifiers, Feature), color=interaction(Classifiers, Feature)))+geom_line()+facet_grid(OS ~ Dataset)

我得到的图表是: enter image description here

如何删除更改图例,例如,我想将交互(分类器,功能)更改为“方法”,以及如何将SVM.Ngram,LG.WE,SVM.WE更改为仅'approach1','approach2'和'approach3'。

1 个答案:

答案 0 :(得分:0)

尝试

public class Point {
    private double xCoord;
    private double yCoord;

    public double getXCoord(){
        return xCoord;
    }

    public double getYCoord(){
        return yCoord;
    }
}

public class Circle {
    /*
    Is it a variable defined type of Point?
    Is it possible or should it have been defined as below.
    What is the difference?
    */
    private Point center;
    // Point center = new Point();

    public double getCenterX(){
        return center.getXCoord(); // Delegation
    }

    public double getCenterY(){
        return center.getYCoord(); // Delegation
    }
}

这是来自http://ggplot2.tidyverse.org/reference/labeller.html - 如果您在那里查看,它会提供您可能感兴趣的更多选项。