plotly

Change line thickness in plotly

可紊 提交于 2019-12-14 03:56:45
问题 I have some data theData <- structure(list(matter_date = structure(c(16921, 16940, 16941, 16944, 16947, 16976, 17013, 16921, 16976, 17013, 16921, 17013, 16921, 16944, 16947, 16976, 17013, 16944, 17013, 16921, 16921, 16941, 16976, 17013, 16921, 17013, 16921, 16940, 16976, 17013, 16921, 16941, 16976, 16921, 16976, 17013, 16921, 16944, 16976, 17013, 16921, 16940, 16941, 16944, 16947, 16976, 17013), class = "Date"), variable = c("meanOfMeans", "meanOfMeans", "meanOfMeans", "meanOfMeans",

Diplaying activity details in a data table in R shiny

无人久伴 提交于 2019-12-14 03:32:22
问题 When I run this R shiny script below, I get two plots with a chart for activity path derived from the patients dataset of the bupaR library called trace explorer on the left and a data table to display the activity/trace details. The chart on the left is such,that we observe various paths with sequence of horizontal traces of activities which occur one after the other. When clicked on any box in a particular trace, the trace details are presented on the right table. My requirement is that,

How to add annotations horizontal or vertical reference line in plotly?

人走茶凉 提交于 2019-12-14 01:59:36
问题 I am using plotly for R. output using shiny if that matters. I want to add annotations to horizontal or vertical reference line created by layout(shapes = ) . It should be able to dynamically change position so that it stays visible no matter how plotly graph is zoomed in or out. Approximate Example So far I can only find fixed location text. I don't mind if it is dynamically located on axis or arrow pointing to reference lines. %Edited I found the sulotion to the problem: dt <- data.table(x

Title of Subplots in Plotly

爱⌒轻易说出口 提交于 2019-12-14 01:28:06
问题 I am trying to make a grid of 3x3 subplots in Plotly. I'm trying to get titles for each subplot and a main title on the top and I can't seem to get it to work. I see this wonderful site for Python but I can't seem to find its equivalent for R. all <- subplot(graph1, graph2, graph3, graph4, graph5, graph6, graph7, graph8, graph9, nrows = 3) That gave me the grid I wanted but don't have the titles I want on the subplots: 1. Graph 1 2. Graph 2 3. Graph 3 4. Graph 4 5. Graph 5 6. Graph 6 7. Graph

Colour Map on scatter plot [duplicate]

有些话、适合烂在心里 提交于 2019-12-13 23:30:28
问题 This question already has answers here : Matplotlib scatterplot; colour as a function of a third variable (3 answers) Closed 3 years ago . I have three columns in a csv file which reads like this: X,Y, Cosine efficiency 989.565,670.17,0.868684456 660.941,-1502.48,0.597998523 685.683,-1491.35,0.600137189 -1454.88,-316.582,0.666894492 -510.86,1016.79,0.870398677 -1350.21,-788.027,0.61601682 -944.034,-1342.79,0.565497692 -966.098,-1327,0.56678693 -1206.4,-1054.63,0.590095562 1004.18,648.067,0

Updating multiple infobox using plotly_click in R and plotly

天大地大妈咪最大 提交于 2019-12-13 20:16:26
问题 If you please run the script, it gives you a basic Sankey Chart in R and plotly and a data table besides. Also, there are three infoBoxes on top. When I click on the Sankey lines in the plot, I see the value in the data table using plotly_click. I want a functionality when I click on any Sankey Line, it picks "pointNumber" Column value in the data table and then multiplies by 2 and put in first infobox, by 3 in second infobox, and multiply by 4 in third infobox as in the snap attached. Thanks

plotly - multiple traces using a shared slider variable

元气小坏坏 提交于 2019-12-13 20:07:07
问题 As the title hints, I'm struggling to create a plotly chart that has multiple lines that are functions of the same slider variable. I hacked something together using bits and pieces from the documentation: https://pastebin.com/eBixANqA. This works for one line. Now I want to add more lines to the same chart, but this is where I'm struggling. https://pastebin.com/qZCMGeAa. I'm getting a PlotlyListEntryError: Invalid entry found in 'data' at index, '0' Path To Error: ['data'][0] Can someone

R chart convert to html format without other files

落花浮王杯 提交于 2019-12-13 16:09:29
问题 My sample dataset: library(plotly) library(htmlwidgets) d <- data.frame( "name" = c("bily", "mary", "ken"), "fruit" = c("cherry", "apple", "apple"), "count" = c(1, 10, 30) ) gg <- ggplot(data = d, aes(x = fruit, y = count, group = name)) + geom_line(aes(color = name)) + geom_point(aes(color = name)) plotly <- ggplotly(gg) save graph: d <- # please put your directory where you want to save the graph "xxxx/graph.html" I have searched these three functions that can output the HTML format but

Using Shiny actionButton() function in onRender() function of htmlWidgets

柔情痞子 提交于 2019-12-13 16:06:43
问题 I have a Shiny application in which a user can select black points in a Plotly scatterplot using the Plotly "box select" icon. The points the user selects will be highlighted in red. I have a MWE of this application below: library(plotly) library(htmlwidgets) library(shiny) ui <- shinyUI(fluidPage( plotlyOutput("myPlot") )) server <- shinyServer(function(input, output) { p <- ggplot(mtcars, aes(x = wt, y = mpg)) + xlim(10,40) +ylim(0,10) ggPS <- ggplotly(p) output$myPlot <- renderPlotly(ggPS

Partially shaded background for ggplotly-object

喜夏-厌秋 提交于 2019-12-13 15:26:00
问题 I'm trying to create a lineplot of a timeseries with ggplot2 and convert it to plotly. A part of the background of this plot is supposed to be shaded in a different color (like this one: Using geom_rect for time series shading in R). Unfortunately annotate() as well as geom_rect aren't transferred to the ggplotly-object as it seems. Therefore I tried to retroactively add a shape using plotly-code (based on this example: https://plot.ly/r/shapes/), but it is not working either, as shown in