plotly-python

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 Express hovermode with arbitrary column

我与影子孤独终老i 提交于 2019-12-11 17:13:52
问题 I see that the hovermode attribute in layout has options for x or y , but is it possible to use an arbitrary dataframe column? instead? For example, I'm plotting precision-recall curves. The x-axis is recall, and the y-axis is precision. The independent variable is a detection threshold value (with range of np.linspace(0,1.0,101) ) with a column in my dataframe called threshold . When I hover over a precision-recall point, what I'm interested in is points on other curves with the same

How to define the structure of a sankey diagram using a dataframe?

瘦欲@ 提交于 2019-11-27 16:36:00
问题 This may sound like a very broad question, but if you'll let me describe some details I can assure you it's very specific . As well as discouraging, frustrating and rage-inducing. The following plot describes a scottish election and is based on code from plot.ly: Plot 1: Dataset 1: data = [['Source','Target','Value','Color','Node, Label','Link Color'], [0,5,20,'#F27420','Remain+No – 28','rgba(253, 227, 212, 0.5)'], [0,6,3,'#4994CE','Leave+No – 16','rgba(242, 116, 32, 1)'], [0,7,5,'#FABC13',