zoukankan      html  css  js  c++  java
  • ggplot2 specific command

    
    # By default, the same scales are used for all panels. You can allow
    # scales to vary across the panels with the `scales` argument.
    # Free scales make it easier to see patterns within each panel, but
    # harder to compare across panels.
    #通过实践该代码即可领悟
    ##1
    ggplot(mpg, aes(displ, hwy)) + geom_point() +facet_wrap(~class, scales = "free")
    ggplot(mpg, aes(displ, hwy)) + geom_point() +facet_wrap(~class)

    # To repeat the same data in every panel, 
    # simply construct a data frame that does not contain the facetting variable.
    #通过实践该代码即可领悟
    ggplot(mpg, aes(displ, hwy)) + geom_point(data = transform(mpg, class = NULL), colour = "grey85") + geom_point() + facet_wrap(~class)
    
    ggplot(mpg, aes(displ, hwy)) + geom_point() + facet_wrap(~class)
    #labs() ----Modify axis, legend, and plot labels
    #ggplot2 绘图时使用该参数来调整坐标轴、图例和标签
    
    #reorder 根据数值型变量对分类变量进行重新排序
    #reorder is a generic function. The "default" method treats its first argument as a categorical variable, and reorders its levels based on the values of a second variable, usually numeric.
  • 相关阅读:
    struct&Method
    SetFinalizer、runtime.GC
    Map(没有写底层)
    数组和切片
    函数
    指针、Time
    字符串、strings、strconv
    基本类型和运算符
    第二阶段的事后诸葛亮
    第二个冲刺阶段第10天
  • 原文地址:https://www.cnblogs.com/adawong/p/7429866.html
Copyright © 2011-2022 走看看