data(Salaries, package="carData") library(ggplot2) # geom_boxplot箱线图,notch是否有凹槽,更清晰分离2/4和3/4的数据 # geom_point散点图,position="jitter"把点抖动分散开 # geom_rug地毯图,指示数据点分布情况,sides="lr"图形两边同时绘制 ggplot(Salaries, aes(x=rank, y=salary)) +geom_boxplot(...
(ggplot2) # 创建数据集 data <- data.frame( x = 1:10, y = rnorm(10) ) # 绘制散点图并添加水平线 ggplot(data, aes(x = x, y = y)) + geom_point() + geom_hline(yintercept = 0, linetype = "dashed", color = "red") + labs(title = "Scatter Plot with Horizontal Line", ...
add labels to a horizontal column plot (stacked by default) ggplot(data = df, aes(x2, x1, group = grp)) + geom_col(aes(fill = grp), width=0.5) + geom_hline(yintercept = 0) + geom_text( aes(label = grp), position = position...
图例高度 legend_direction= 图例方向,vertical竖直,horizontal横直 row_title和column_title参数设定行和...
# Change the plot orientation: horizontal 变换坐标轴的方向 p3 <- ggbarplot(df, "dose", "len", orientation = "horiz") p3 1 2 3 4 # Change the default order of items 设定指定的排列顺序 p4 <- ggbarplot(df, "dose", "len",
Functions:geom_boxplot(),stat_boxplot(),stat_summary() ··· 中间省略 25个章节 Rotate a plot: flip and reverse Horizontal plot : coord_flip() Reverse y axis Functions:coord_flip(),scale_x_reverse(),scale_y_reverse() Faceting: split a plot into a matrix of panels ...
qplot(): Quick plot with ggplot2 Scatter plots Bar plot Box plot, violin plot and dot plot Histogram and density plots Box plots Basic box plots Box plot with dots Change box plot colors by groups Change box plot line colors Change box plot fill colors ...
Add horizontal or vertical ablines with geom_hline and geom_vline. Curved arrows Dicover how to draw curved arrows in ggplot Marginal plot Marginal plots are not natively supported byggplot2, but their realisation is straightforward thanks to theggExtralibrary as illustrated ingraph #277. ...
- line:曲线图 - smooth:平滑曲线,拟合曲线 - jitter:另一种散点图 - boxplot:箱线图 - histogram:直方图 - density:密度分布图 - bar:柱状图 # 曲线图 qplot(x=carat, y=price, data=datax, color=cut, geom="line", main="曲线图")
line-chart-several-groups-ggplot2_files line-plot-log-scale_files line_chart_annotation_files parallel-plot-ggally_files piechart-ggplot2_files portfolio scss tanya_assets upset-plot_files vendor violin_and_boxplot_ggplot2_files violin_grouped_files violin_grouped_ggplot2_...