plotly

Getting separate axis labels on R plotly subplots

不问归期 提交于 2019-12-08 16:00:38
问题 When using the R plotly package version 4.5.6 I haven't been able to figure out how to get axis labels to appear when combining multiple plots using subplot . Here is an example where no x-axis labels appear. require(plotly) a <- data.frame(x1=1:3, y=30:32) b <- data.frame(x2=11:13, y=31:33) u <- plot_ly(a) u <- add_lines(u, x=~x1, y=~y) v <- plot_ly(b) v <- add_lines(v, x=~x2, y=~y) subplot(u, v, shareY=TRUE) 回答1: To get x-axis labels to show up with subplot , you can set titleX = TRUE . The

plotly js remove title and title area

十年热恋 提交于 2019-12-08 15:44:39
问题 How does on remove the title from a plotly js chart? Example chart I have is as follows <head> <script src="https://cdn.plot.ly/plotly-latest.min.js"></script> </head> <div id="myDiv" style="width: 800px; height: 400px;"></div> <script> var trace1 = { x: [1, 2, 3, 4], y: [10, 15, 13, 17], mode: 'markers' }; var trace2 = { x: [2, 3, 4, 5], y: [16, 5, 11, 9], mode: 'lines' }; var trace3 = { x: [1, 2, 3, 4], y: [12, 9, 15, 12], mode: 'lines+markers' }; var data = [ trace1, trace2, trace3 ]; var

Displaying the table details from sankey chart in R shiny

不羁的心 提交于 2019-12-08 14:02:11
问题 The script below works on the patients data from bupaR package,and creates a sankey plot listing the relation between a resource from the "employee" column with the activity he is involved in from the "handling" column in the patients data. Besides the plot there is a data table available from DT which gives details of every sankey plot path when clicked. I want a functionality such that when I click on any path, say path connecting "r1" employee and "Registration" handling activity, I want

Make plot out of multiple plot.ly figures in Python

三世轮回 提交于 2019-12-08 13:24:28
I've made 4 figures in plot.ly, for example: import plotly.plotly as py import plotly.graph_objs as go trace1 = go.Scatter( x=[0, 1, 2, 3, 4, 5, 6, 7, 8], y=[8, 7, 6, 5, 4, 3, 2, 1, 0] ) trace2 = go.Scatter( x=[0, 1, 2, 3, 4, 5, 6, 7, 8], y=[0, 1, 2, 3, 4, 5, 6, 7, 8] ) data = [trace1, trace2] fig1 = go.Figure(data=data, layout=layout) fig2 = go.Figure(data=data, layout=layout) fig3 = go.Figure(data=data, layout=layout) fig4 = go.Figure(data=data, layout=layout) Now I want to make a subplot, and add each figure to a quadrant of it: from plotly import tools fig = tools.make_subplots(rows=2,

Plotly x-axis hover text issue

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-08 13:07:14
问题 When using a Scatter plot with Plotly i am unable to get hover text when i have more than 1 marker with the same x-axis value. Can anyone please help me fix this? Or is this a bug with plotly? Check the marker that is closest to the line. Code is here https://jsfiddle.net/qjdt92h2/ var trace1 = { x: [13.5, 12, 13, 14,13], y: [15, 17, 13.6, 17,18], text: ['4.17 below the mean', '4.17 below the mean', '0.17 below the mean', '0.17 below the mean', '0.83 above the mean', '7.83 above the mean'],

plotly with Python - limits of Gantt Chart

谁说我不能喝 提交于 2019-12-08 12:02:19
问题 I have a dataframe like this which is an application log: +---------+----------------+----------------+---------+----------+-------------------+------------+ | User | ReportingSubId | RecordLockTime | EndTime | Duration | DurationConverted | ActionType | +---------+----------------+----------------+---------+----------+-------------------+------------+ | User 5 | 21 | 06:19.6 | 06:50.5 | 31 | 00:00:31 | Edit | | User 4 | 19 | 59:08.6 | 59:27.6 | 19 | 00:00:19 | Add | | User 25 | 22 | 29:09.4

How to render a plotly plot with preset traces hidden i.e. 'legendonly' based on list

走远了吗. 提交于 2019-12-08 10:45:10
问题 Thanks to help on a previous question here I can now record in a list which traces are hidden in a plotly plot by reading out the legend list of TRUE/legendonly with a piece of javascript , which I use to change the list entries, and the color of associated buttons. What I'm now also looking to do, is to maintain that TRUE/legendonly status when the plot is re-rendered. In the dummy app below, the plot can be re-rendered with the switch actionbutton , which causes a re- render due to a change

Write a function for traces in a bar chart

╄→гoц情女王★ 提交于 2019-12-08 09:50:41
问题 I created a pivot table: df = data.pivot_table(index='col_A', columns='col_B', values='col_C', fill_value=0) The dataframe df is a 10*25 dataframe. I want to plot all the columns in a single graph as traces. However, it would be super tedious to write code for all 25 traces. Is there a way I can write a function like: import plotly.plotly as py import plotly.tools as tls from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot import plotly.graph_objs as go init_notebook

Plotting multiple lines in python [duplicate]

无人久伴 提交于 2019-12-08 09:02:01
问题 This question already has answers here : matplotlib - black & white colormap (with dashes, dots etc) (4 answers) Are there really only 4 Matplotlib Line Styles? (1 answer) Closed 2 years ago . I am new in Python and I want to plot multiple lines in one graph like in the figure below. I have tried write simple plotting code like this: I know these parameters # red dashes, blue squares and green triangles plt.plot(t, t, 'r--', t, t**2, 'bs', t, t**3, 'g^') But I have a lot of lines such in the

How to plot contours with a log scale in an interactive graph in R?

不问归期 提交于 2019-12-08 08:45:24
问题 I have a contour plot displayed with plotly: x <- rep(seq(0.01, 0.1, length.out = 50), 50) y <- rep(seq(0.01, 0.1, length.out = 50), each = 50) z <- 1 / (x^2 + y^2) my.data <- data.frame(x, y, z) p <- plot_ly(data = my.data, x = x, y = y, z = z, type = "contour") Here is the result: Question: How to use a log scale for the z colors? Or how to manually control the contour levels? I tried layout(p, zaxis = list(type = "log")) but it does not work. Remark #1: I don't want to plot log(z) , which