Creating Scatter plot using Random Distributions

Abhinav
24-Feb-2021

Introduction

  • This purpose of this project is to visualize how a scatter plot would look like when the X values and Y values are generated using a specific random distribution.
  • The values of X and Y would be plotted in pairs to form the scatter plot
  • Mean and Median values of X and Y variables will also be displayed
  • Some points can be selected and Mean and Median values corresponding to the selected points will be reactively displayed
  • This presentation will explain the input options available while creating scatter plot
  • This presentation will also explain the output of the exercise

Input options

alt text

  • Select Distribution: Uniform or Normal
  • How many random numbers should be plotted?: Default 1000
  • Pick min and max X values for Uniform distribution: between (-100,100)
  • Pick min and max Y values for Uniform distribution: between (-100,100)
  • nput mean of Normal Distribution: Default 20
  • Input Std Dev of Normal Distribution: Default 10
  • Fit Data to Graph: Expands to fill the plot
  • Add Margin to Graph: Put a blank margin around the plot

Output

alt text

  • Distribution: unif - Uniform, norm - Normal.
  • No. of Points: Actaully being considered by the graph.
  • Graph of the Random point: Plot
  • For the data generated, Mean and Median of X and Y values are calculated and displayed.
  • User documentation accessed by clicking the button

Sample Plot Output

number_of_points1<-100; gmean<-20; gsd<-20
dataX <- rnorm(number_of_points1, gmean, gsd); dataY <- rnorm(number_of_points1, gmean, gsd)
plot(dataX, dataY, xlab = "RandomX", ylab = "RandomY", main = "Normally Distributed Random Number", xlim = c(-100,100), ylim = c(-100,100))

plot of chunk unnamed-chunk-1