Set Aspect Ratio of Scatter Plot and Bar Plot in R Programming - Using asp in plot() Function Last Updated : 30 Jun, 2020 Comments Improve Suggest changes Like Article Like Report asp is a parameter of the plot() function in R Language is used to set aspect ratio of plots (Scatterplot and Barplot). Aspect ratio is defined as proportional relationship between width and height of the plot axes. Syntax: plot(x, y, asp ) Parameters: x, y: Coordinates of x and y axis asp: Aspect ratio Example 1: r # Set seed for reproducibility set.seed(86000) # Create random x variable x <- runif(120) # Create y variable correlated with x y <- x + runif(120) # Plot without setting aspect ratio plot(x, y) # Plot with asp = 5 plot(x, y, asp = 5) Output: Plot Without Aspect Ratio: Plot with Aspect Ratio: Example 2: r # Set seed for reproducibility set.seed(86000) # Create random x variable x <- runif(120) # Create y variable correlated with x y <- x + runif(120) # Regular barplot barplot(x) # Barplot with aspect ratio of 5 barplot(x, asp = 5) Output: Bar Plot Without Aspect Ratio: Bar Plot with Aspect Ratio: Here, the asp option increases the width of the y-axis. Comment More infoAdvertise with us Next Article Set Aspect Ratio of Scatter Plot and Bar Plot in R Programming - Using asp in plot() Function K kaurbal1698 Follow Improve Article Tags : R Language R Statistics R Plot-Function Similar Reads Plotting of Data using Generic plots in R Programming - plot() Function In this article, we will discuss how we plot data using Generic plots in R Programming Language using plot() Function. plot functionplot() function in R Programming Language is defined as a generic function for plotting. It can be used to create basic graphs of a different type. Syntax: plot(x, y, t 5 min read Printing plots generated in a function using R Markdown in RStudio In this article, we will explore how to generate and print the plots created within the function using R Markdown in RStudio. R Markdown is a powerful tool for creating dynamic documents that integrate code, results, and narrative text. We will demonstrate how to create the plot within the R functio 3 min read Merge and Perfectly Align Histogram and Boxplot using ggplot2 in R Visualizing data distributions effectively is crucial for data analysis, and combining different types of plots can enhance our understanding of the data. A powerful combination is merging a histogram with a boxplot. The histogram shows the frequency distribution, while the boxplot provides a summar 3 min read Add Correlation Coefficients with P-values to a Scatter Plot in R In this article, we will discuss how to add correlation coefficients with P-value to a scatter plot in the R Programming Language. To add correlation coefficient with P-value to a scatter plot, we use the stat_cor() function of the ggpubr package in the R Language. The ggpubr package provides some e 2 min read Plot Paired dot plot and box plot on same graph in R R Programming Language is used for statistical computing and graphics. R was first developed at the University of Auckland by two professors Ross Ihanka and Robert Gentleman Dot Plot The dot plot is a graphical representation of how one attribute varies with respect to another attribute. On the x-ax 7 min read Like