plotly

Plotly.js: Initial Zoom

Deadly 提交于 2020-01-03 13:32:10
问题 I have 256 data points. When the plot first appears I'd like the x axis to be automatically zoomed to a specific range along the X axis. Is there way? Must I punch down to D3 somehow? 回答1: Something like: Plotly.plot('graph', [{ /* some data trace */ }], { xaxis: { range: [0, 1] // to set the xaxis range to 0 to 1 } }); More info in the plotly.js chart attributes reference. 来源: https://stackoverflow.com/questions/36706791/plotly-js-initial-zoom

Launch Dash from Jupyter Notebook

和自甴很熟 提交于 2020-01-03 03:06:06
问题 Is there a way I can launch a Dash dahsboard using the below line of code in Jupyter notebook? # if __name__ == '__main__': # app.run_server(debug=True) When I try to launch this I get an error. The only way to correct it is to set debug to false. But then the Dashboard does not update automatically when the data feeding the charts is altered. 回答1: EDIT I just found out that a valuable GitHub user published the following library. This is the direct link to the respective repo. See his

How can I retain desired order in R Plotly bar chart with color variable

假如想象 提交于 2020-01-03 01:35:14
问题 Pretty self-evident. Values on x-axis are not ordered correctly if color parameter is invoked df <- structure(list(count = c(8, 3, 5, 9), names = c("I", "want", "this", "order"), type = c("H", "A", "H", "A")), .Names = c("count", "names", "type"), row.names = c(NA, -4L), class = "data.frame") plot_ly(data=df,x=names,y=count,type="bar", color = type) This is somewhat similar to a previous question but that seemed a bit of a hack that may be difficult to apply here anyways TIA 回答1: Update:

In a network graph, how do I highlight the network components when hovering over them?

↘锁芯ラ 提交于 2020-01-02 19:18:30
问题 I have made a network graph. Now I want to add 3 functionalities - when hovering over an edge, it should highlight the nodes connected with that edge when hovering over a node, it should highlight all the nodes and edges connected to that node when selecting a sub-area in the network (by dragging the mouse), instead of zooming into the graph, it should highlight the nodes and edges in that selected sub-area How do I do these? I found this pen, but I don't know how to adapt it to Python do

Reduce number of gridlines in plotly scatter plots with log scale in R shiny

孤街浪徒 提交于 2020-01-02 19:14:45
问题 I've build the following test app where I solve the issue to get the tick labels as scientific annotation, but I would now like to reduce the number of grid lines to only be placed at the "main" ticks, i.e. the ones that have a text label. This question was posted based on discussion / comment on this previous SO question I would like to find a way that works for both 2D and 3D plotly scatter plots since I am using both. Here is the 3D app. library(shiny) library(plotly) shinyApp( ui =

Plotly legend entry to show/hide all plotting characters

前提是你 提交于 2020-01-02 14:39:50
问题 Suppose I am building a plotly scatterplot that displays three different groups (here specified by colour). I can show/hide each group individually by clicking at the groups in the legend. library(ggplot2) library(plotly) d <- data.frame("a" = sample(1:50, 20, T), "b" = sample(1:50, 20, T), "col" = factor(sample(1:3, 20, T))) gg <- ggplot() + geom_point(aes(x = a, y = b, color = col), data = d) gg plotly_build(gg) Is there a way to add a button to the legend to show/hide all points ? 回答1: I

Creating Process Map Diagrams using different packages in R

随声附和 提交于 2020-01-02 09:31:49
问题 the given script simply creates a process map diagram showing the flow of events in R. This field of study is called event log mining or process mining. I wish to know any other packages or functionality in R using which I can create similar maps and also make them interactive like ggplotly. Please help me with some links if possible. Thanks and please help. library(bupaR) library(edeaR) library(eventdataR) library(processmapR) library(processmonitR) library(xesreadR) library(petrinetR)

Creating Process Map Diagrams using different packages in R

≯℡__Kan透↙ 提交于 2020-01-02 09:31:37
问题 the given script simply creates a process map diagram showing the flow of events in R. This field of study is called event log mining or process mining. I wish to know any other packages or functionality in R using which I can create similar maps and also make them interactive like ggplotly. Please help me with some links if possible. Thanks and please help. library(bupaR) library(edeaR) library(eventdataR) library(processmapR) library(processmonitR) library(xesreadR) library(petrinetR)

conditional shading in plotly

a 夏天 提交于 2020-01-02 07:59:46
问题 I'm plotting two step functions using the R interface to plotly and shading the space between them, like so: df <- structure(list(datetime = structure(c(1469869200, 1469871000, 1469872800, 1469874600, 1469876400, 1469878200, 1469880000, 1469881800, 1469883600, 1469885400, 1469887200, 1469889000, 1469890800, 1469892600, 1469894400, 1469896200, 1469898000, 1469899800, 1469901600, 1469903400, 1469905200, 1469907000, 1469908800, 1469910600), tzone = "Europe/Berlin", class = c("POSIXct", "POSIXt")

Color code a scatter plot by group with a gradient

爷,独闯天下 提交于 2020-01-02 07:11:16
问题 I have XY data which I'd like to graph using a scatter plot , with R 's plotly package. set.seed(1) df <- data.frame(x=c(rnorm(30,1,1),rnorm(30,5,1),rnorm(30,9,1)), y=c(rnorm(30,1,1),rnorm(30,5,1),rnorm(30,9,1)), group=c(rep("A",30),rep("B",30),rep("C",30)),score=runif(90,0,1)) Each point is assigned to one of three groups ( df$group ) and has a score in the [0,1] range. I'm looking for a way to graph the data such that each group is colored with a different color but the shade of that color