Warning: Trying to access array offset on value of type null in /home/u623081920/domains/hindilearn.in/public_html/tutorials.php on line 241
R Line Graph In Hindi - R Programming - Hindilearn

आपकी ऑफलाइन सहायता

BACK
49

सी प्रोग्रामिंग

149

पाइथन प्रोग्रामिंग

49

सी प्लस प्लस

99

जावा प्रोग्रामिंग

149

जावास्क्रिप्ट

49

एंगुलर जे.एस.

69

पी.एच.पी.
माय एस.क्यू.एल.

99

एस.क्यू.एल.

Free

एच.टी.एम.एल.

99

सी.एस.एस.

149

आर प्रोग्रामिंग

39

जे.एस.पी.





डाउनलोड पी.डी.एफ. ई-बुक्स
R - R Line Graph

R में Line Graph ये plot() इस function का इस्तेमाल किया जाता है | Line Graph में दिए हुए values को point करके line को draw किया जाता है |

Syntax for plot() Function in R

plot(x,type,col,xlab,ylab)

Syntax for plot() Function in R

x : यहाँ पर numeric vector दिया जाता है |

type : character. अगर 'p' दिया जाता है तो सिर्फ points को draw किया जाता है | अगर 'l' दिया जाता है तो सिर्फ line को draw किया जाता है | अगर 'o' दिया जाता है तो points और lines को draw किया जाता है |

col : points और lines को color दिया जाता है |

xlab : x-axis को label दिया जाता है | default x-axis label 'Index' होता है |

ylab : y-axis को label दिया जाता है | default y-axis label 'vector या उसका variable_name' होता है |

xlim : x-axis को limit दी जाती है |

ylim : y-axis को limit दी जाती है |


Simple Example for plot() Function in R

Example पर दिए हुए vector से points दिए गए है |

Source Code :
vec = c(12,45,11,58,74)
plot(vec)



Draw Lines using plot() function's type parameter in R

Example पर points पर lines को draw किया गया है |

Source Code :
vec = c(12,45,11,58,74)
plot(vec, type = 'o')



Remove Points from line graph using type parameter in R

Example पर plot() function के type parameter के 'l' value की मदद से सिर्फ lines को ही draw किया गया है |

Source Code :
vec = c(12,45,11,58,74)
plot(vec, type = 'l')



Color lines using col parameter in R

Example पर plot() function के col parameter से lines को color किया गया है |

Source Code :
vec = c(12,45,11,58,74)
plot(vec, type = 'l', col = 'green')



Add Title, x-axis label and y-axis label in R

Example पर line graph पर title, x-axis label और y-axis label को set किया गया है |

Source Code :
vec = c(12,45,11,58,74)
plot(vec, type = 'o', col = 'green', xlab = 'X-Axis', 
ylab = 'Y-Axis', main = 'Line Graph')



Draw Multiple line graphs on single plot in R

Example पर lines() function की मदद से multiple line graphs को एक ही plot पर draw किया गया है |

Source Code :
vec1 = c(12,45,11,58,74)
vec2 = c(45,12,1,87,10)
vec3 = c(10,4,15,56,25)
plot(vec1, type = 'o', col = 'red', xlab = 'X-Axis', 
ylab = 'Y-Axis', main = 'Line Graph', ylim = c(0,100))
lines(vec2, type = "o", col = "green")
lines(vec3, type = "o", col = "purple")