The plotly.express module (usually imported as px) contains functions that can create entire figures at once, and is referred to as Plotly Express or PX. Plotly Express is a built-in part of the plotly library, and is the recommended starting point for creating most common figures.
Questions tagged [plotly-express]
365 questions
0
votes
1 answer
Plotly scatter plot divided by month and year
I'm trying to plot a scatter plot with plotly express. I have a dataset of jobs, that has a column called ['Posting Updated']. I want to plot the year that the job was posted against the count with information given on which month is was posted in.…

Cam Deardon
- 15
- 6
0
votes
1 answer
Plotly Express prevent text values from appearing in hover template
How do I prevent the text values passed as text=df.petal_width.values in the example below from showing up in the hover tooltip? They should only display as annotations directly on the plot.
import plotly.express as px
df = px.data.iris()
fig =…

Janosh
- 3,392
- 2
- 27
- 35
0
votes
1 answer
Plotly express box plot hover data not working
Trying to add data to hover of boxplot express in plotly and following the instructions here in plotly 5.4.1. It is mentioned in the tutorial that additional information to be shown in the hover can be added by hover_data and hover_name argument.…

Masih
- 15
- 5
0
votes
1 answer
How to remove gaps between consecutive and adjacent dates in plotly.express.timeline?
In my Python script I gather the datetime objects for two time periods via dateutil.parser like so:
from dateutil import parser
start_date_1 = parser.parse("2010-08-01").date()
end_date_1 = parser.parse("2010-11-05").date()
start_date_2 =…

quadratecode
- 396
- 1
- 2
- 12
0
votes
1 answer
How to plot multiple lines on same graph using plotly express (XYXY format data)?
I have an excel file with multiple columns data in XYXY format Data.png. How can I use plotly express to plot multiple lines on same graph? For your reference, I achieved this using the Origin software.Result.png
Comments: (1) different lines with…

JeffChou666
- 3
- 1
0
votes
1 answer
ValueError: Wrong number of items passed 3, placement implies 1
I want to plot plotly express grouped bar chart to show no of births in each decade just like this graph.
pivot_dayofweek=final.pivot_table(values='births',index='dayofweek',columns='decade',aggfunc='mean') …
0
votes
1 answer
Plotting ways (linestrings) over a map in Python
this is my second try for the same question and I really hope that someone may help me...
Even thought some really nice people tried to help me. There is a lot I couldn't figure out, despite there help.
From the beginning:
I created a dataframe.…

Rebecka
- 51
- 1
- 6
0
votes
1 answer
Custom Sorting in Plotly Express Icicle Visualizations
I am dealing with a dataset that has quarterly tasks, and I am trying to visualize it through a plotly express icicle chart. The way the data is structured is like this:
Objective
Quarter
Task
Status
Value
Finish Project A
1
Sort…

meforprez2032
- 15
- 1
- 1
- 7
0
votes
1 answer
Plotly Express Chart Gaps Even with Index
I am having trouble eliminating datetime gaps within a dataset that i'm trying to create a very simple line chart in plotly express and I have straight lines on the graph connecting datapoints over a gap in the data (weekends).
Dataframe simply has…

StormsEdge
- 854
- 2
- 10
- 35
0
votes
1 answer
How to show every value in y-axis using Plotly Express?
When I do:
fig = px.line(df, x="day", y="avg_spending")
fig.show()
It doesn't put values in y axis by 2 (0, 2, 4,...). I want it to be 1 by 1 (0,1,2,3,..). My maximum value of "avg_spending" in df is 17, so I would like there to be 1,2,3,...,17…

french_fries
- 1,149
- 6
- 22
0
votes
1 answer
Build a plotly scatterplot with two drop down buttons one for x and one for y axis
I wish to build a scatter plot but using 2 drop down where I can switch between variables one for x axis and the other for y axis(e.g Total tests and Total cases, or Recent cases and Total cases), i have tried building off a solution i found by…

Rich
- 9
- 6
0
votes
1 answer
Add dropdown button to plotly express choropleth map
I already saw this and i am trying to build off this solution (Dropdown menu for Plotly Choropleth Map Plots) but I keep getting errors for the visible section, here is my code.
import pandas as pd
import numpy as np
import plotly.graph_objs as…

Rich
- 9
- 6
0
votes
1 answer
is there a way to make a plotly trendline intercept specific values?
I would like to know if someone knows of an easy way to make an OLS trendline in ploty express pass through the origin. I have been looking for quite some time now so it would be much appreciated.

Joshua Schaafsma
- 1
- 1
0
votes
1 answer
Dash update colors after figure is created
If I create a plotly express figure like so:
fig = px.line(data, color_discrete_map={"Gold": "gold","Silver": "silver"}),
it works fine.
But if I want to update the colors after the figure is created, like so:
fig =…

Robin Andrews
- 3,514
- 11
- 43
- 111
0
votes
1 answer
Plotly express export to png inside for loop
I have a code where I am generating the pots using fig(show) inside a loop and this works fine. I would like to be able to export this into the different PNG files based on the for loop. I have tried different options like %s, but doesn't…

Kamikaze K
- 181
- 1
- 11