plotly-python

Plotly: How to remove empty dates from x axis?

泪湿孤枕 提交于 2020-06-09 05:09:50
问题 I have a Dataframe Date Category Sum 0 2019-06-03 "25M" 34 1 2019-06-03 "25M" 60 2 2019-06-03 "50M" 23 3 2019-06-04 "25M" 67 4 2019-06-05 "50M" -90 5 2019-06-05 "50M" 100 6 2019-06-06 "100M" 6 7 2019-06-07 "25M" -100 8 2019-06-08 "100M" 67 9 2019-06-09 "25M" 450 10 2019-06-10 "50M" 600 11 2019-06-11 "25M" -9 12 2019-07-12 "50M" 45 13 2019-07-13 "50M" 67 14 2019-07-14 "100M" 130 15 2019-07-14 "50M" 45 16 2019-07-15 "100M" 100 17 2019-07-16 "25M" -90 18 2019-07-17 "25M" 700 19 2019-07-18 "25M"

Plotly: How to remove empty dates from x axis?

こ雲淡風輕ζ 提交于 2020-06-09 05:09:27
问题 I have a Dataframe Date Category Sum 0 2019-06-03 "25M" 34 1 2019-06-03 "25M" 60 2 2019-06-03 "50M" 23 3 2019-06-04 "25M" 67 4 2019-06-05 "50M" -90 5 2019-06-05 "50M" 100 6 2019-06-06 "100M" 6 7 2019-06-07 "25M" -100 8 2019-06-08 "100M" 67 9 2019-06-09 "25M" 450 10 2019-06-10 "50M" 600 11 2019-06-11 "25M" -9 12 2019-07-12 "50M" 45 13 2019-07-13 "50M" 67 14 2019-07-14 "100M" 130 15 2019-07-14 "50M" 45 16 2019-07-15 "100M" 100 17 2019-07-16 "25M" -90 18 2019-07-17 "25M" 700 19 2019-07-18 "25M"

Plotly: How to remove empty dates from x axis?

戏子无情 提交于 2020-06-09 05:08:51
问题 I have a Dataframe Date Category Sum 0 2019-06-03 "25M" 34 1 2019-06-03 "25M" 60 2 2019-06-03 "50M" 23 3 2019-06-04 "25M" 67 4 2019-06-05 "50M" -90 5 2019-06-05 "50M" 100 6 2019-06-06 "100M" 6 7 2019-06-07 "25M" -100 8 2019-06-08 "100M" 67 9 2019-06-09 "25M" 450 10 2019-06-10 "50M" 600 11 2019-06-11 "25M" -9 12 2019-07-12 "50M" 45 13 2019-07-13 "50M" 67 14 2019-07-14 "100M" 130 15 2019-07-14 "50M" 45 16 2019-07-15 "100M" 100 17 2019-07-16 "25M" -90 18 2019-07-17 "25M" 700 19 2019-07-18 "25M"

How do I add and define multiple lines in a plotly time series chart?

不羁岁月 提交于 2020-05-16 02:01:05
问题 I'm creating a line based time series graph using the plotly library for python. I'd like to connect it to a time series database, but for now I've been testing with csv data. Is it possible to have an x and y axis (time vs value), and load multiple lines from another csv column value (host) and append to the x and y graph? import pandas as pd import plotly.express as px df = pd.read_csv('stats.csv') fig = px.line(df, x = 'time', y = 'connections', title='connections') fig.show() I'd like to

display datatable after filtering rows from dropdown list in dash

寵の児 提交于 2020-05-09 15:56:13
问题 I'm new to Dash. I would like to make a app, where I can select values from dropdown filter, filter dataset and display the data table. I'm using dash_table. My example app code is below. No datatable is shown. Does anyone know what I did wrong? How can I render dash table in dash app? import dash import dash_html_components as html import dash_core_components as dcc import dash_table as dt from dash.dependencies import Input, Output import pandas as pd df = pd.read_csv('https://raw

How to convert a Plotly 'Funnel' Dashboard to Dash Dashboard?

∥☆過路亽.° 提交于 2020-04-11 11:59:28
问题 I am trying to convert this simple plotly funnel dashboard to a Dash dashboard: from plotly import graph_objects as go fig = go.Figure(go.Funnel( y = ["Website visit", "Downloads", "Potential customers", "Requested price", "invoice sent"], x = [39, 27.4, 20.6, 11, 2])) fig.show() Output: I have written the following piece of code for Dash but no luck. import dash import dash_core_components as dcc import dash_html_components as html from plotly import graph_objects as go app = dash.Dash() app

Plotly.io doesn't see the psutil package even though it's installed

☆樱花仙子☆ 提交于 2020-03-22 23:13:10
问题 I'm trying to execute the following code: import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib %matplotlib inline import seaborn as sns import plotly.graph_objects as go from plotly.offline import init_notebook_mode, iplot init_notebook_mode(connected=True) from sklearn.preprocessing import QuantileTransformer import os if not os.path.exists("images"): os.mkdir("images") # import orca import plotly.io as pio pio.orca.config.executable = '/path/to/orca' pio

Plotly - Set line color

眉间皱痕 提交于 2020-01-05 04:20:57
问题 How can I set the color of a line in plotly ? import plotly.graph_objects as go from plotly.subplots import make_subplots fig = make_subplots(rows=2, cols=1, subplot_titles=('Plot 1', 'Plot 2')) # plot the first line of the first plot fig.append_trace(go.Scatter(x=self.x_axis_pd, y=self.y_1, mode='lines+markers', name='line#1'), row=1, col=1) # this line should be #ffe476 I tried fillcolor but that I suspected doesn't work because this is a simple line. 回答1: You can add line=dict(color="

How to plot a circle for each point scatter plot while each has particular radius size

爱⌒轻易说出口 提交于 2019-12-20 05:55:53
问题 I have a pandas frame with distance matrix, I use PCA to do the dim reduction. The the dataframe of this distance matrix has label for each point, and size. How can I make each scattered point become a circle with a size dependent on the size from the dataframe ```` pca = PCA(n_components=2) pca.fit(dist) mds5 = pca.components_ fig = go.Figure() fig.add_scatter(x = mds5[0], y = mds5[1], mode = 'markers+text', marker= dict(size = 8, color= 'blue' ), text= dist.columns.values, textposition='top

Plotly.py: fill to zero, different color for positive/negative

我的未来我决定 提交于 2019-12-13 03:31:06
问题 With Plotly, I can easily plot a single lines and fill the area between the line and y == 0 : import plotly.graph_objects as go fig = go.Figure() fig.add_trace(go.Scatter( x=[1, 2, 3, 4], y=[-2, -1.5, 1, 2.5], fill='tozeroy', mode='lines', )) fig.show() How can I split the filled area in two? In particular, filling with red where y < 0 and with green where y > 0 . I would like to maintain the line as continuous. That means, I am not interested in just drawing two separate filled polygons.