Hello I have a simple shiny app in which I create a scatterplot of variables found in the iris dataset. What I want is to be able to modify the plot in some ways. First of all I would like to be able to set the limits of the gridlines for each axis(by 1 for example), then set the background color to white and the marker color to blue and add trendline.
Preferred styles: Plot title - Calibri (or similar), 10 pt, bold, dark grey
Axis titles – Calibri light (or similar), 16 pt, bold, dark grey
Axis number labels – Calibri, 11 pt
Data labels – Calibri, 9 pt, black
Data markers – dark blue circles
I do not know if all of these or maybe some are available in ggplot2 in combination with plotly or I have to use only plotly as Im new to it and would like some guidance.Thanks
#ui.r
library(shiny)
library(ggplot2)
library(plotly)
fluidPage(
# App title ----
titlePanel(div("CROSS CORRELATION",style = "color:blue")),
# Sidebar layout with input and output definitions ----
sidebarLayout(
# Sidebar panel for inputs ----
sidebarPanel(
),
# Main panel for displaying outputs ----
mainPanel(
tabsetPanel(type = "tabs",
tabPanel("Correlation Plot",
fluidRow(
column(3, uiOutput("lx1")),
column(3,uiOutput("lx2"))),
plotlyOutput("sc"))
))
))
#server.r
function(input, output) {
output$lx1<-renderUI({
selectInput("lx1", label = h4("Select 1st Expression Profile"),
choices = colnames(iris[,1:4]),
selected = "Lex1")
})
output$lx2<-renderUI({
selectInput("lx2", label = h4("Select 2nd Expression Profile"),
choices = colnames(iris[,1:4]),
selected = "Lex2")
})
output$sc<-renderPlotly({
p <- ggplot(iris, aes_string(x = input$lx1, y = input$lx2)) +
geom_point()
ggplotly(p) %>%
layout(height = 400)
})
}