Generic plot types in R software


Introduction

plot() function is the generic function for plotting in R. It can be used to create basic graphs.

A simplified format of the function is

plot(x, y, type="p")
  • x and y: the coordinates of points to plot
  • type : the type of graph to create; Possible values are :
  • type=“p”: for points (by default)
  • type=“l”: for lines
  • type=“b”: for both; points are connected by a line
  • type=“o”: for both ‘overplotted’;
  • type=“h”: for ‘histogram’ like vertical lines
  • type=“s”: for stair steps
  • type=“n”: for no plotting

Examples

x<-1:10; y=x*x
plot(x, y, type="b")
plot(x, y, type="h")
plot(x,y, type="s")

Echelle des axesEchelle des axesEchelle des axes

Infos

This analysis has been performed using R statistical software (ver. 3.1.0).


Enjoyed this article? I’d be very grateful if you’d help it spread by emailing it to a friend, or sharing it on Twitter, Facebook or Linked In.

Show me some love with the like buttons below... Thank you and please don't forget to share and comment below!!
Avez vous aimé cet article? Je vous serais très reconnaissant si vous aidiez à sa diffusion en l'envoyant par courriel à un ami ou en le partageant sur Twitter, Facebook ou Linked In.

Montrez-moi un peu d'amour avec les like ci-dessous ... Merci et n'oubliez pas, s'il vous plaît, de partager et de commenter ci-dessous!





This page has been seen 62517 times