Gplots Color
Color palette can be changed like in any ggplot2 chart. Above are 3 examples using different methods: scalefillgradient to provide extreme colors of the palette scalefilldistiller) to provide a ColorBrewer palette scalefillviridis to use Viridis. Do not forget discrete=FALSE for a continuous variable. Col2hex: Convert color names to hex RGB strings; colorpanel: Generate a smoothly varying set of colors; gplots-defunct: Defunct functions; gplots-deprecated: Deprecated functions; heatmap.2: Enhanced Heat Map; hist2d: Compute and Plot a 2-Dimensional Histogram; lmplot2: Plots to assess the goodness of fit for the linear model. Lowess: Scatter. Colors a vector of color names for the backgrounds of each part of the diagram. Title a string containing the graph title. Rot a numeric value for the number of degrees to rotate the graph. Details NOTICE: This only works for 3-dimensional data. By definition, value ’000’ lays outside the plotted diagram. Therefore, it will not be plotted.
Often you want to set the fixed colors for particular range of your dataset to be sure that the visual output is correctly represented. This is particularly useful for time series data, where the range or your dataset might drastically change during the course of the simulation.
To do that in R, we need to set the “breaks” parameter in plotting functions such as image or heatmap.2.
Enjoy plotting! mintgene