banner



Draw And Label Line Ef

This role can describe either a grapheme cord or mathematical expression at the given coordinates. It works both on top of ggdraw and directly with ggplot, depending on which coordinate system is desired (see examples).

          draw_label(          characterization,   10 =          0.5,   y =          0.5,   hjust =          0.v,   vjust =          0.5,   fontfamily =          "",   fontface =          "plain",   color =          "black",   size =          fourteen,   angle =          0,   lineheight =          0.9,   alpha =          1,          colour          )

Arguments

label

String or plotmath expression to be fatigued.

x

The x location (origin) of the label.

y

The y location (origin) of the label.

hjust

Horizontal justification. Default = 0.5 (centered on x). 0 = flush-left at x, 1 = flush-right.

vjust

Vertical justification. Default = 0.v (centered on y). 0 = baseline at y, 1 = ascender at y.

fontfamily

The font family unit

fontface

The font face ("plain", "assuming", etc.)

color, color

Text color

size

Point size of text

angle

Bending at which text is drawn

lineheight

Line height of text

alpha

The alpha value of the text

Details

By default, the x and y coordinates specify the center of the text box. Ready hjust = 0, vjust = 0 to specify the lower left corner, and other values of hjust and vjust for whatever other relative location you desire to specify.

Meet also

Examples

          

library(ggplot2) # setup plot and a label (regression clarification) p <- ggplot(mtcars, aes(disp, mpg)) + geom_line(color = "blueish") + theme_half_open() + background_grid(minor = 'none') out <- cor.exam(mtcars $ disp, mtcars $ mpg, method = 'sp', exact = Fake) label <- substitute( paste("Spearman ", rho, " = ", judge, ", P = ", pvalue), listing(gauge = signif(out $ estimate, ii), pvalue = signif(out $ p.value, ii)) ) # Add together label to plot, centered on {10,y} (in information coordinates) p + draw_label(label, x = 300, y = 32)

# Add label to plot in data coordinates, flush-left at x, baseline at y. p + draw_label(characterization, x = 100, y = 30, hjust = 0, vjust = 0)

# Add together labels via ggdraw. Uses ggdraw coordinates. # ggdraw coordinates default to xlim = c(0, one), ylim = c(0, 1). ggdraw(p) + draw_label("centered on 70% of x range,\n90% of y range", 10 = 0.seven, y = 0.9)

ggdraw(p) + draw_label("bottom left at (0, 0)", x = 0, y = 0, hjust = 0, vjust = 0) + draw_label("top right at (ane, 1)", ten = 1, y = 1, hjust = one, vjust = 1) + draw_label("centered on (0.5, 0.5)", ten = 0.five, y = 0.5, hjust = 0.v, vjust = 0.5)

Draw And Label Line Ef,

Source: https://wilkelab.org/cowplot/reference/draw_label.html

Posted by: madsenreflonch.blogspot.com

0 Response to "Draw And Label Line Ef"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel