Programming
Python
R
Java
C
C++
C#
WEB
HTML
CSS
JavaScript
BootStrap4
jQuery
SVG
MORE
Examples1
Python
GO
R
Java
C
C++
C#
Examples2
Python
R
Java
C
C++
C#
HTML
CSS
JavaScript
BootStrap4
jQuery
SVG
Seo Tools
Code Minifier
Code Beautifier
Language Compiler
Misc Tools
File Converter
References
C
C++
Python
Java
PHP
JavaScript
Examples
Python
R
Java
C
C++
C#
HTML
CSS
JavaScript
BootStrap4
jQuery
SVG
Home
About
Contact
JetPack
Multi Themes-->>
Code it ALL
Scroll TOP
Plotting Data using Scatter Plot in R - CodeGK
Δ R Examples
Box_plot
Plotting Data using Box Plot in R
Linear_regression
Linear Regression in R
Scatter_plot
Plotting Data using Scatter Plot in R
Mean_mode_mode
Mean in R
Median in R
Mode in R
Bar_chart
Plotting Data Using Bar Chart in R
Array
Array in R
Histogram
Plotting Data using Histogram in R
Line_graph
Plotting Data using Line Graph in R
Pie_chart
Plotting Data In Pie Char in R
Lists
R Lists
♦ Plotting Data using Scatter Plot in R
♣ Example1: Plotting Data using Scatter Plot in R
In this example: Plotting Mileage vs Cylinder consumption as scatter plot.
Example
Input:
Run CODE
Reload Code
Copy Code
# Get the input values. input <- mtcars[,c('mpg','cyl')] # Give the chart file a name. png(file = "scatterplot.png") # Plot the chart for cars Mileage vs Cylinder plot(x = input$mpg, y = input$cyl, xlab = "Mileage", ylab = "Cylinder", xlim = c(14,25), ylim = c(3,12), main = "Mileage vs Cylinder" ) # Save the file. dev.off()
Output:
Scatter_plot
Plotting Data using Scatter Plot in R