plotly

Adding config modes to Plotly.Py offline - modebar

别等时光非礼了梦想. 提交于 2019-11-27 03:05:47
问题 Plotly.js includes all the parameters needed to configure the ModeBar, which allows one to take away options from the display bar (such as the link to edit the graph online). However, this does not appear implemented in the Plotly.py API. In the js version: Plotly.newPlot('myDiv', data, layout, {displayModeBar: false}); Removes the modebar entirely. Plotly.newPlot('myDiv', data, layout, {displaylogo: false}, {modeBarButtonsToRemove: ['sendDataToCloud','hoverCompareCartesian']}) allows one to

Plotly chart is not displayed in PyCharm

扶醉桌前 提交于 2019-11-27 02:55:28
问题 How can I display interactive plotly graphs in Pycharm? I run the following code: import plotly.offline as py import plotly.graph_objs as go py.init_notebook_mode(connected=True) data = [go.Bar( x=['giraffes', 'orangutans', 'monkeys'], y=[20, 14, 23] )] py.iplot(data, filename="barplot") The result in PyCharm is a blank field: In Jupyter Notebook this code gives a (proper) interactive chart as the result. Update: Answers from Embed Plotly HTML in PyCharm IDE don't work for me. When I use the

date format in tooltip of ggplotly

假如想象 提交于 2019-11-27 02:16:16
问题 I am using ggplotly to show an interactive time-series plot. The x axis is in date format, yet the hover tool tip in plotly is converting the date format to a numeric (screenshot attached). Any ideas on how to get the date to show as a proper date in the tooltip? Below is a short piece of the code: output$ggplot <- renderPlotly({ plotbycity<-df_postgres %>% group_by(city, date, bedroooms) %>% filter(city %in% input$checkGroup & bedroooms==input$radio) %>% summarise(count=n(),rent=median(rent)

Formatting mouse over labels in plotly when using ggplotly

こ雲淡風輕ζ 提交于 2019-11-27 00:37:18
问题 I am struggling with text formatting when using ggplotly and the mouse over functionality. library(plotly) df <- data.frame(a=letters, b=LETTERS, x=runif(26), y=runif(26)) g <- ggplot(df, aes(x,y)) + geom_point(aes(text=sprintf('letter: %s\nLetter: %s', a, b))) g (gg <- ggplotly(g)) I would like to have some formatted text or at least a newline in my mouse over label. Is there a good documentation on how to design this mouse over bubble thing? 回答1: plotly can make use of the line break HTML

Exporting PNG files from Plotly in R

杀马特。学长 韩版系。学妹 提交于 2019-11-26 21:20:41
问题 How can I export a Plotly chart as a image from R using code? (Not using the export button on the chart). For example, this code from the Plotly site, create this chart: library(plotly) set.seed(100) d <- diamonds[sample(nrow(diamonds), 1000), ] plot_ly(d, x = carat, y = price, text = paste("Clarity: ", clarity), mode = "markers", color = carat, size = carat) How can I save it as a image? The official site has this material in python, but I didn't find something similar in R. 回答1: There is a

Selection of activity trace in a chart and display in a data table in R shiny

邮差的信 提交于 2019-11-26 18:40:50
问题 If you run the R shiny script below, you get two boxes in an R shiny dashboard, The chart on the left displays a plot for all the traces or set of activities that occur in the eventlog data "patients_eventlog". "patients2" is a data in the script that explains each and every case appearing in column "a1", and corresponding activities basides in column "a2". My requirement is that when I click anywhere on a particular trace in the chart on left, I should get the relevant columns "a1","a2" and

Plotly notebook mode with google colaboratory

匆匆过客 提交于 2019-11-26 12:44:33
问题 I am am trying out colaboratory with plotly notebook mode - I open a new notebook, copy and paste the following simple example from plotly\'s documentation, but don\'t see an output. There is a large blank in the output space where the plot whould normally be. This works fine in my local notebook (which is a newer version of plotly, but per their docs offline mode should work with the google colab version) Any ideas? import plotly from plotly.graph_objs import Scatter, Layout plotly.offline

Horizontal/Vertical Line in plotly

*爱你&永不变心* 提交于 2019-11-26 06:46:40
问题 I\'m using the plotly package and I\'m trying to add a horizontal line to a graph. Is there any way of doing it using plotly? It can be done using ggplot2 and the ggplotly function as shown below: library(plotly) p <- ggplot() + geom_hline(yintercept = 4) + xlim(c(0,10)) + ylim(c(0,10)) ggplotly(p) But I can\'t add this to an existing plotly plot. Also, the axis of my charts are not fixed, so it would be difficult (but not impossible) to just work out an x and y coordinate system for a