R language make diagram plot parameter

Source: Internet
Author: User

Function Name: Plot

Purpose: Drawing

Usage: Plot (x, Y, ...)

Parameters

1. Symbols and lines

PCH: Specifies the symbol used to draw the point, the range of values [0, 24], where 4 is the "difference", 20 is the "point"

CeX: Specifies the size of the symbol. CeX is a numeric value that represents a multiple of the PCH, which is 1.5 times times the default

Lty: Specifies the line type. Lty=1 represents a solid line, 2 to 6 are dashed, the degree of emptiness is not the same

LWD: Specifies the line width, the default value is lwd=1, can be modified 1.5 times times, twice times, etc.

2. Color

Col: default drawing color. Some functions, such as lines, pie, can accept a vector containing a color value and automatically recycle it.

For example: Col=c ("Red", "blue") need to draw three lines, then three colors are red, blue, red

Col.axis: The color of the axis scale text , not the color of the axis

Col.lab: Color of the axis label (name)

Col.main: Color of title

Col.sub: The color of the subtitle

FG: The foreground color of the graph

BG: Background color for graphics

3. Text attributes (used to specify font size, font, typeface)

Cex.axis: Scale multiples of axis scale text

Cex.lab: The zoom factor of the axis label (name)

Cex.main: The zoom multiplier of the title

Cex.sub: The scale multiplier of the subtitle

Font: Integer. Lets you specify a font style. 1 Regular, 2 bold, 3 italic, 4 bold italic

4. Graphic dimensions and graphics boundaries

Pin: Indicates the width and height of the graphic in inches

Mai: Represents the boundary size as a numeric vector, in the order of "bottom, left, top, right", in inches

Mar: The size of the boundary as a numeric vector, in the order of "bottom, left, top, right", in English, the default value C (5, 4, 4, 2) +0.1

5. Title

You can use the function title, in the following format:

Title (main = "", Sub = "", Xlab = "", Ylab = "")

You can also directly put the parameters inside the title directly in plot ()

6. Axes

Plot parameter

Axes=false will disable all axes, frame and scale are all gone

Xaxt= "n" Disables tick marks on the x-axis

Yaxt= "n" disables the tick marks on the y-axis

You can also customize by using the Axis function    Axis (...)

Side: An integer. Represents the drawing axis on which side of the graph (1=, 2 = left, 3 = on, 4 = right)

at: A numeric vector that indicates the placement of the tick mark that needs to be plotted

Labels: a character vector (which can also be numeric) that represents the text label (the scale value) next to the tick mark, and if the whole is not written, use the at value directly

Col: Color of lines and ticks

Lty: Line type

Las: Whether the label's font is parallel (=0) or vertical (=2) axis

TCK: The length of the tick mark (Default-0.01, negative value indicates the scale is outside the graph, positive value indicates the scale is inside the shape)

7. Reference line

Abline (H=yvalues, V=xvalues)

Example: Plot (1:10)

Abline (H = C (1, 5)) #则在y = 1 and 5 each have a horizontal line

Abline (v = C (1, 5)) #则在x = 1 and 5 each have a vertical line

8. Legend (Legend)

Legend (location, title, Legend, ...)

Parameters:

Cond......



R language make diagram plot parameter

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.