plotly

Show non-numerical variables / columns in hover text

Show non-numerical variables / columns in hover text Question: I have this code to create a plot and this dataframe df2.dtypes Out[464]: Device category time datetime64[ns] Path category variable object value float64 path category dtype: object df3 = df2.query(‘variable==@signals’).groupby(‘path’).first() fig_general = px.scatter(df3 , x = "time" , y = ‘value’ , custom_data = [‘Path’] , …

Total answers: 1

Choropleth map with plotly

Choropleth map with plotly Question: I’m trying to make a choropleth map with folium and with plotly in python. The data is from CBS: https://www.cbs.nl/nl-nl/onze-diensten/open-data/statline-als-open-data/cartografie. The folium choropleth works, but the plotly choropleth doesn’t. The legend is showing, but the map is not. What am I doing wrong? #Make choropleth map with folium and with …

Total answers: 1

How to mention custom daterange using polars Dataframe in python plotly plots?

How to mention custom daterange using polars Dataframe in python plotly plots? Question: I am new to python polars and trying to create a line plot using plotly express with custom start date & max date as the x-axis date range of the plot. Doubt: Do I need to pass the whole polars dataframe again …

Total answers: 1

How to draw multiple pie chart circles using Plotly?

How to draw multiple pie chart circles using Plotly? Question: How can you draw such a plotly graph? Input x=np.array([]), y=np.array([]), a and b parameters for pie chart. For example, in the figure: x = [1,2,3,4] y = [1,2,3,4] ab = [[1,1], [1,2], [3,7], [15,2]] There is a similar answer here. But this solution does …

Total answers: 1

Plotly – multiple labels on x axis

Plotly – multiple labels on x axis Question: I have a dataset with columns for week and month respectively, and I would like to plot variable in time using both week and month as labels. Can something like this be done with plotly in python? Thanks, Lukas Asked By: Lukas Tomek || Source Answers: Please …

Total answers: 1

Redirect to a url in dash

Redirect to a url in dash Question: I’m using dash to build a dashboard where I am creating a unique url whenever a particular data point is clicked, how can I redirect users to this created url? I’m using the below given code where whenever someone click on any data points, click event will trigger …

Total answers: 2

change graph dataframe by selecting button in plotly

change graph dataframe by selecting button in plotly Question: import pandas as pd import plotly.graph_objs as go import plotly.express as px tmp_df = { "col_a" : [1,2,3,4,5,6], "col_b":[0,1,0,1,0,1], "col_c":[2,4,6,8,10,12], "col_d":[9,8,7,6,5,4]} tmp_df = pd.DataFrame(tmp_df) fig = px.scatter_3d(data_frame = tmp_df, x="col_a", y=’col_c’, z=’col_d’, color="col_b") data_type = tmp_df.col_b.unique() buttons = [] for counter, i in enumerate(data_type): buttons.append(dict(method=’update’, label …

Total answers: 1

Left Align the Titles of Each Plotly Subplot

Left Align the Titles of Each Plotly Subplot Question: I have a facet wraped group of plotly express barplots , each with a title. How can I left align each subplot’s title with the left of its plot window? import lorem import plotly.express as px import numpy as np import random items = np.repeat([lorem.sentence() for …

Total answers: 2