alpha is the transparency degree of color. # change point color transparency (alpha) according # Change point color according to another variable Use the argument brewerPalette, to specify colors using RColorBrewerpalette. In this case, the length of groupColors should be the same as the number of the groups. Use the argument groupColors, to specify colors by hexadecimal code or by name. To change scatter plot color according to the group, you have to specify the name of the data column containing the groups using the argument groupName. The different color systems available in R have been described in detail here. You can also use other color scales, such as ones taken from the RColorBrewer package. Default value is c(0.5, "solid", "#E5E5E5").įor more details follow this link : ggplot2.customize.Ĭhange scatter plot color according to the groupĬolors can be specified as a hexadecimal RGB triplet, such as "#FFCC00" or by names (e.g : "red" ). Default value is FALSE.Ī vector of length 3 indicating respectively the size, the line type and the color of axis lines. Rotation angle of x and y axis tick labels. Default value are xTickLabelFont=c(12, "bold", "black"), yTickLabelFont=c(12, "bold", "black"). Default values are TRUE.Ī vector of length 3 indicating respectively the size, the style and the color of x and y axis tick label fonts. If TRUE, x and y axis tick mark labels will be shown. Default values are xtitleFont=c(14,"bold", "black"), ytitleFont=c(14,"bold", "black"). Color can be specified as an hexadecimal code (e.g: “#FFCC00”) or by the name (e.g : “red”, “green”). Possible values for the style:“plain”, “italic”, “bold”, “alic”. Default values are NULL.Ī vector of length 3 indicating respectively the size, the style and the color of x and y axis titles. Set the value to FALSE to hide axis labels. If TRUE, x and y axis titles will be shown. Default value is: mainTitleFont=c(14, “bold”, “black”). The arguments that can be used to customize x and y axis are listed below : ParametersĪ vector of length 3 indicating respectively the size, the style (“italic”, “bold”, “alic”) and the color of x and y axis titles. # Extend the regression lines beyond the domain of the data GroupName='cyl', size=3, backgroundColor="white", # Add regression line and confidence interval Ggplot2.scatterplot(data=df, xName='wt',yName='mpg', # The plot is colored by the groupName 'cyl' We will set color/shape by another variable (cyl) # plot of variable 'mpg' according to xName 'wt'.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |