Demonstration of Ploty Charts in R

Data Visualisations are more fun when they are interactive. Interactive charts allow the user to zoom in and out of plot and can provide more information when clicked with the mouse.

This interactive component of the charts requires the support of Javascript libraries. Different tools exist to create interactive data visualisations in R and Python which can be viewed in Web or html-based applications. Plotly is one option that provides interactive charts with graphing libraries for Python, R, MATLAB, Perl and others.

Interactive Histogram

p <- ggplot(df.NT_pmData, aes(Avg_RRC_ConnUser))
p <- p + geom_histogram(binwidth = 5, fill = 'blue') + ggtitle("Darwin Cells Average Users per Day") + ylab("Cell Count") + xlab("Avg Users per Day") + xlim(0, 200) 
p <- ggplotly(p)
p

Interactive Barchart

# Plot Box Chart of Downlink Volumes by Cell Frequency Band
f <- list(
  family = "Calibri, monospace",
  size = 18,
  color = "#7f7f7f"
)
x <- list(
  title = "Cell DL Volumes",
  titlefont = f
)

y <- list(
  type='category',
  categoryorder ="array",
  title = "Frequency Bands",
  titlefont = f
)

p <- plot_ly(df.NT_pmCellData, x = ~DL_Thrpt_Vol, color = ~freqBand, type = "box") %>%
  layout(title = "Cell DL Volumes by Freq Band",xaxis = x, yaxis = y)
p

3D Scatter Plot

# Plot Box Chart of Downlink Volumes by Cell Frequency Band
# Choose a random sample from the dataset
chosen1 <- sample(nrow(df.NT_pmCellData[df.NT_pmCellData$freqBand == 3,]), 25)
chosen2 <- sample(nrow(df.NT_pmCellData[df.NT_pmCellData$freqBand == 28,]), 25)
chosen3 <- sample(nrow(df.NT_pmCellData[df.NT_pmCellData$freqBand == 7,]), 25)
chosen12 <- append(chosen1,chosen2)
chosen <- append(chosen12,chosen3)
df_subset <- df.NT_pmCellData[chosen,]

p2 <- plot_ly(df_subset, x = ~DL_Thrpt_Vol, y= ~LTE_PrbUtilUl_Avg, z=~ Ues_2Scell,color = ~freqBand,colors = c('#4d94ff','#ff4d4d','#00b300')) %>% add_markers() %>%
  layout(
    title = "DL Volumes, Prb Utilization and CA Penetration per Cell",
    scene = list(
      xaxis = list(title = "DL Thrput Volume"),
      yaxis = list(title = "Prb Util Average"),
      zaxis = list(title = "CA Penetration")
    ))
p2