##Boxplot using notch Program:
# Plot the chart.
boxplot(mpg ~ cyl, data = mtcars,
xlab = "Number of Cylinders", ylab = "Miles Per Gallon",
main = "Mileage Data",
notch = TRUE,
varwidth = TRUE,
col = c("green", "red", "blue"), names = c("High", "Medium", "Low"))
#Get the library.
library(plotrix)
# Create data for the graph.
geeks <- c(23, 56, 20, 63)
labels <- c("Mumbai", "Pune", "Chennai", "Bangalore")
piepercent<- round(100 * geeks / sum(geeks), 1)
# Plot the chart.
pie3D(geeks, labels = piepercent,
main = "City pie chart", col = rainbow(length(geeks)))
legend("topright", c("Mumbai", "Pune", "Chennai", "Bangalore"), cex = 0.5, fill = rainbow(length(geeks)))
##Boxplots Creating a Dataset Program:
input <- mtcars[, c('mpg', 'cyl')]
print(head(input))
#Creating the Boxplot Program:
# Plot the chart.
boxplot(mpg ~ cyl, data = mtcars, xlab = "Number of Cylinders",
ylab = "Miles Per Gallon",
main = "Mileage Data")
##Multiple Boxplot Program:
set.seed(20000)
data <- data.frame( A = rpois(900, 3),
B = rnorm(900),
C = runif(900)
)
# Applying boxplot function
boxplot(data)
To embed this program on your website, copy the following code and paste it into your website's HTML: