plotly

How to hide legend with Plotly Express and Plotly

时间秒杀一切 提交于 2019-12-12 11:19:25
问题 I am trying to learn Plotly by firstly creating a simple bar chart in Plotly Express and then updating it with Plotly to finesse it. I would like to hide the legend. I am trying to update the original figure by hiding the legend, and I can't get it to work. This is my traceback error. And my code import plotly.plotly as py import plotly.graph_objs as go import plotly_express as px import pandas as pd df = pd.read_csv('C:/Users/Documents/Python/CKANMay.csv') fig = px.bar(df, x="Publisher", y=

Plotly: Hoverinfo for both points connected by line (“markers+lines”) using group_by

时光总嘲笑我的痴心妄想 提交于 2019-12-12 10:23:23
问题 I am making a line chart and I would like to have hoverinfo for both points connected by line. I know that ggplotly() uses tooltip for this. I think I should use hovermode in plot_ly() layout. The highlight in my follwoing example does exactly what I want: highlight both marks and the line connecting them. I would like to have hoverinfo for both marks when I hover either of them (and if possible the line connecting them), i.e. hoverinfo by variable used in group_by() . This SO post is does

Why are plotly-rendered graphs not working on Mozilla

馋奶兔 提交于 2019-12-12 09:58:26
问题 I am getting the following error when trying to open an html document put together with knitr in Mozilla Firefox. The error is a result of the graph element composed with the plotly package. unknownError: error occurred while processing 'getCachedMessages: out of memory The entire contents of the rmarkdown file (default everything else): library(plotly) library(ggplot2) theData <- data.frame(A=1:26, B=letters, C=rnorm(26,19)) g<-ggplot(theData, aes(x=A, y=C)) + geom_point() ggplotly(g) I have

open plotly in qwebview in interactive mode

微笑、不失礼 提交于 2019-12-12 09:57:48
问题 I'm using plotly library in offline mode with python and what I'm trying to do is to create some plot, save them as local html and load in a second moment into a QWebView. This is the code for a boxplot with a dummy variable: from PyQt5.QtWebKitWidgets import QWebView import plotly import plotly.graph_objs as go x1 = [10, 3, 4, 5, 20, 4, 3] trace1 = go.Box( x = x1) layout = go.Layout( showlegend = True ) data = [trace1] fig = go.Figure(data=data, layout = layout) fn = '/home/matteo/plot.html'

Is it possible to use R Plotly library in R Script Visual of Power BI?

那年仲夏 提交于 2019-12-12 09:45:55
问题 Has anyone tried using Plotly or Highchart in R Script Visual of Power BI, when I try this in R script editor and Run: library(ggplot2) library(plotly) x <- 1:5 y <- c(1, 3, 2, 3, 1) plot_ly(x = dataset$period, y = dataset$mean, name = "spline", line = list(shape = "spline")) Error Message: No image was created. The R code did not result in creation of any visuals. Make sure your R script results in a plot to the R default device. But runs perfectly on my R desktop. Any thought? 回答1: For

How to create two y-axes streaming plotly

 ̄綄美尐妖づ 提交于 2019-12-12 09:26:35
问题 I followed the plotly examples to successfully create a streaming temperature graph using my DHT22 sensor. The sensor also provides humidity which I would like to plot as well. Is it possible somehow? The following code is what I'm trying but an exception is thrown: plotly.exceptions.PlotlyAccountError: Uh oh, an error occured on the server. no data is being plot to the graph (see bellow). with open('./plotly.conf') as config_file: plotly_user_config = json.load(config_file) py.sign_in(plotly

Disable mouse click to show another slide in rmarkdown slidy_presentation

℡╲_俬逩灬. 提交于 2019-12-12 09:15:08
问题 I'm wondering how to disable left mouse click to show another slide in rmarkdown slidy_presentation. If I'm trying to disable/enable some category in plotly chart, it'll skip to another slide. Is there any option how to handle it. Many thanks for your suggestions in forward. 回答1: In my current version of slidy (rmarkdown 1.6) you can disable/enable mouse click advance by pressing key 'k' , when viewing the presentation. To change the default (on file open) behavior I had to change line 55 in

Plotly 3d surface graph has incorrect x and y axis values

和自甴很熟 提交于 2019-12-12 09:04:48
问题 I would like to make a 3d surface plot with plotly. This is going quite well, however the values on the x and y axis make no sense. They are much higher than they should be. I used a matrix for the plot, the x and y values are the row and column names and the z value (called elevation) of course the matrix itself. Plotly doesn't seem to use the values of the x and y data. The x and y values range from 0 to 6 in the matrix. This is a small sample of my matrix: head(m.dune) > 1.90 1.95 2 2.05 2

Change size of hover text in Plotly

 ̄綄美尐妖づ 提交于 2019-12-12 08:45:26
问题 I am building a Plotly plot based on a ggplot in R. I would like to increase the size of the text in the hover boxes. Suppose I have a scatterplot like this: library(plotly) library(ggplot2) d <- data.frame(a = sample(1:50, 30, T), b = sample(1:50, 30, T), col = factor(sample(1:3, 30, T))) gg <- ggplot() + geom_point(aes(x = a, y = b, color = col), data = d) p <– plotly_build(gg) p Is there a way to change the size of the hover text? 回答1: Currently there seems to be no built-in way to pass

start bar from a particular point in y axis instead of zero in plotly bar graph

半腔热情 提交于 2019-12-12 06:42:08
问题 language : javascript & chart framework : plotly I want my bar to start from a particular point on Y axis instead of 0 on Y axis. By default the bar always start from 0 on Y axis. I am using plotly bar chart var offset = 19; var tick_str = ['19', '20', '21', '22', '23', '24', '01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18']; var trace1 = { x: ['JP', 'CN', 'TW', 'AU', 'HK', 'MY', 'PH', 'SG', 'SP', 'BN', 'LK', 'MO', 'TH', 'VB', 'VN',