Move Axis Label Closer to Plot in Base R (Example) | How to Decrease Space | plot & title Function

preview_player
Показать описание
R code of this video:

y_axis = 1:5)

plot(data, # Create plot with default text
xaxt = "n",
yaxt = "n")

plot(data, # Plot without axis text
xaxt = "n",
yaxt = "n",
xlab = "",
ylab = "")
title(xlab = "x_axis", line = 0) # Add x-axis text
title(ylab = "y_axis", line = 0) # Add y-axis text

plot(data, # Plot without axis text
xaxt = "n",
yaxt = "n",
xlab = "",
ylab = "")
title(xlab = "x_axis", mgp = c(1, 1, 0)) # Add x-axis text
title(ylab = "y_axis", mgp = c(1, 1, 0)) # Add y-axis text

Follow me on Social Media:
Рекомендации по теме
Комментарии
Автор

Thanks a lot for the tutorial!!! Despite the popularity of the ggplot2, it is always great to be proficient in generating graphs with base R.

agsoutas
visit shbcf.ru