use R Language mapping , Modifying the coordinate axis is mainly through adjustment plot function ,axis Function sum title Parameters in functions .

<>plot function
plot(x,y, ...) axis(side, at = NULL, labels = TRUE, tick = TRUE, line = NA,
pos = NA, outer = FALSE, font = NA, lty = "solid", lwd = 1, lwd.ticks = lwd,
col = NULL,col.ticks = NULL, hadj = NA, padj = NA, ...) title(main= NULL, sub =
NULL, xlab = NULL, ylab = NULL, line = NA, outer = FALSE, ...)
In the personalization axis , The parameters that usually need to be adjusted include ann,bty,xaxt,yaxt,xaxs and yaxs：

Serial number parameter operation
1ann take FALSE The title will not be drawn （ Including the main , Subtitle and axis title ）.
2bty Set border form , The default value is "o", It means that all four borders are drawn .
Other optional values include "l"（ Lower left ）,“7”（ Up right ）,“c”（ Up down left ）,“u”（ Left down right ）,"]" （ Up down right ） and "n"（ nothing , No borders ）.
In many personalized drawings ,bty Set to "n", Later border lines use other functions （ as axis） Add it yourself .
3xaxs/yaxs set up x Axis and y Range of axes , The default value is “r”, Represents the ratio of the coordinate axis to the given drawing range , Ratio parameter xlim and ylim The range given is larger .
Assign to ”i” It means that the range of coordinate axis is exactly the same as the given drawing range .
Other values include ”s”,”e”,”d” etc .
4xaxt/yaxt take ”n” Time , Coordinate axis , Tick marks and tick values will not be drawn .
with y = x 3 y=x^3 y=x3 Drawing for example ：
x <- seq(-4, 4, 0.01) y <- x ^ 3 par(mfrow = c(2, 2), mar = c(4, 4, 1, 1)) plot
(x, y) # No treatment plot(x, y, xaxs = "i", yaxs ="i") # The drawing border is not left blank plot(x, y, bty = 'l')
# Keep only the left and bottom borders plot(x, y, ann = F, bty = "n", xaxt = "n", yaxt = "n") # frame , All axes are removed

<>axis function

Serial number parameter operation
1side Represents the axis to operate , Value 1,2,3,4 On behalf of , Left , upper , right .
2at Indicates the location of the scale mark and scale value .
3labels Represents the scale value .
4las Indicates the text direction of the coordinate scale value , The value is 0 Indicates that the text direction is parallel to the coordinate axis ,1 Indicates always horizontal ,2 Indicates that it is perpendicular to the coordinate axis ,3 Indicates that the final direction is vertical . x <- seq(-4, 4,
0.01) y <- x ^ 3 par(mfrow = c(1, 2), mar = c(4, 4, 1, 1)) # Text direction not set plot(x, y,
ann = F, xaxt = "n", yaxt = "n") axis(1, -4 : 4, -4 : 4) axis(2, seq(-64, 64, 4)
, seq(-64, 64, 4)) # Text direction horizontal plot(x, y, ann = F, xaxt = "n", yaxt = "n") axis(1, -
4 : 4, -4 : 4, las = 1) axis(2, seq(-64, 64, 4), seq(-64, 64, 4), las = 1)

<> Font size

Serial number parameter operation
1cex.axis Represents the font size of the axis scale value .
2font.axis The font that represents the scale value of the axis ,font = 1 It means orthodox ,2 Indicates bold ,3 Indicates italics ,4 Indicates black italics . x <- seq(-4, 4, 0.01) y
<- x ^ 3 par(mfrow = c(2, 2), mar = c(4, 4, 1, 1)) # Font size not set plot(x, y, ann = F,
xaxt ="n", yaxt = "n") axis(1, -4 : 4, -4 : 4) #cex.axis = 2 plot(x, y, ann = F,
xaxt ="n", yaxt = "n") axis(1,-4:4, -4:4, cex.axis = 2) #font.axis = 2 plot(x,
y, ann = F, xaxt = "n", yaxt = "n") axis(1, -4 : 4, -4 : 4, font.axis = 2)
#font.axis = 3 plot(x, y, ann = F, xaxt = "n", yaxt = "n") axis(1,-4 : 4, -4 : 4
, font.axis = 3)

<> colour

Serial number parameter operation
1col Represents the color of the graph , Used in axis Function represents the color of coordinate axis and scale line .
2col.axis Represents the color of the axis scale value .
3col.ticks Represents the color of the axis tick mark . x <- seq(-4, 4, 0.01) y <- x ^ 3 par(mfrow = c(2, 2),
mar = c(4, 4, 1, 1)) # No color set plot(x, y, ann = F, bty = "n", xaxt = "n", yaxt =
"n") axis(1,-4 : 4, -4 : 4) #col = 2 plot(x, y, ann = F, bty = "n", xaxt = "n",
yaxt ="n") axis(1,-4 : 4, -4 : 4, col = 2) #col.axis = 2 plot(x, y, ann = F,
bty ="n", xaxt = "n", yaxt = "n") axis(1,-4 : 4, -4 : 4, col.axis = 2)
#col.ticks = 2 plot(x, y, ann = F, bty = "n", xaxt = "n", yaxt = "n") axis(1,-4
: 4, -4 : 4, col.ticks = 2)

<> position

Serial number parameter operation
1line Represents the distance between the coordinate axis position and the image border , Negative numbers are drawn within the image border .
2mgp The default value is c(3, 1, 0), The three numbers represent the axis title , The scale value and the distance between the axis and the drawing border .
3tcl The default value is -0.5, The number represents the length of the tick mark , A negative value indicates that the tick marks are outward , It's facing inward .
4pos Indicates the position of the axis .
5line.outer The value is TRUE Time , The axis is drawn at the edge of the canvas .
6hadj It refers to the distance to adjust the scale value along the direction parallel to the coordinate axis .
7padj Refers to the distance to adjust the scale value along the vertical axis . x <- seq(-4, 4, 0.01) y <- x ^ 3 par(mfrow = c(2, 2),
mar = c(4, 4, 1, 1)) # Scale value position not set plot(x, y, ann = F, xaxt = "n", yaxt = "n") axis
(1, -4 : 4, -4 : 4) # use line Adjust the position of scale value plot(x, y, ann = F, xaxt = "n", yaxt = "n")
axis(1, -4 : 4, -4 : 4, line = 2) # use mgp Adjust the position of scale value plot(x, y, ann = F, xaxt = "n",
yaxt ="n") axis(1, -4 : 4, -4 : 4, mgp = c(3, 2, 0)) # use padj Adjust the position of scale value plot(x, y,
ann = F, xaxt = "n", yaxt = "n") axis(1, -4 : 4, -4:4, padj = 1)

<> title

title Usage of function

Serial number parameter operation
1main Main title
2sub Subtitle
3xlabx Axis title
4ylaby Axis title
5cex.lab Represents the font size of the axis title
6font.lab The font that represents the axis title
7col.lab Represents the color of the axis title
8 Other parameters and axis The usage is the same in Chinese x <- seq(-4, 4, 0.01) y <- x ^ 3 par(mfrow = c(2, 2), mar = c(4
, 4, 1, 1)) # Untitled plot(x, y, ann = F, xaxt = "n", yaxt = "n") axis(1, -4 : 4, -4
: 4) axis(2, seq(-64, 64, 4), seq(-64, 64, 4)) # use title Set title plot(x, y, ann = F,
xaxt ="n", yaxt = "n") axis(1, -4 : 4, -4 : 4, las = 1) axis(2, seq(-64, 64, 4),
seq(-64, 64, 4), las = 1) title(xlab= 'x', ylab = 'y') # use line Adjust the position plot(x, y,
ann = F, xaxt = "n", yaxt = "n") axis(1, -4 : 4, -4 : 4, las = 1) axis(2, seq(-
64, 64, 4), seq(-64, 64, 4), las = 1) title(xlab= 'x', ylab = 'y', line = 2)
# Adjust color font size plot(x, y, ann = F, xaxt = "n", yaxt = "n") axis(1, -4 : 4, -4 : 4,
las = 1) axis(2, seq(-64, 64, 4), seq(-64, 64, 4), las = 1) title(xlab= 'x',
ylab ='y', col.lab = 2, font.lab = 4, cex.lab = 2)

Welcome to criticize and correct .

Technology
Daily Recommendation