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
Hover text gets messed up when figures put into subplots (plotly express)
I am making a series of tiled figures, each with 4 subplots. First I make the individual figures:
def create_plot(list1, list2):
'''
Given two lists of metric values, plot corresponding distributions and
return plot object.
INPUT
2 lists
RETURN
1…

Chris
- 13
- 4
0
votes
2 answers
Plotly (Python) scatter plot that shows a bubble for mean and standard deviation
I have statistics that correspond to two different variables, X and Y. For example:
x_stats = {'count': 100.0,
'mean': -0.19,
'std': 0.23,
'min': -0.67,
'25%': -0.38,
'50%': -0.15,
'75%': -0.02,
'max': 0.34}
y_stats = {'count':…

acciolurker
- 429
- 4
- 15
0
votes
1 answer
Plotly Express - plot subset of dataframe columns by default and the rest as option
I am using plotly express to plot figures this way :
fig = px.line(df,
x=df.index,
y=df.columns
)
It displays the graph properly and shows all the columns by default (as lines in the graph) with option to uncheck (or check)…

Mehdi Zayene
- 37
- 8
0
votes
1 answer
Display aggregate value next to label in frame in treemap
Following my question here, I am now building nice treemaps.
I would like to show the aggregate value of the branch next to its label (Equities and ETFs). I have looked at px.treemap and fig.update_layout parameters but I can't find what I am…

ou_ryperd
- 2,037
- 2
- 18
- 23
0
votes
1 answer
Add multiple lines in radar plot - python plotly
I am trying to create a radar plot in plotly. I am not sure how to add multiple lines to the same plot. I could find the add_trace option in plotly.graph_objects as go (https://plotly.com/python/radar-chart/). But I am not sure how to add multiple…

Natasha
- 1,111
- 5
- 28
- 66
0
votes
1 answer
How to add the percentage value along with the value count in Plotly Express Bar chart
Shown below is the syntax used to get the bar chart for a categorical data on plotly express
df1= df['Catergory'].value_counts().reset_index(name='Total')
df1['Percentage'] = round((df1['Total'] / df1['Total'].sum())* 100,0)
fig = px.bar(df1,
…

WF30
- 213
- 1
- 3
- 16
0
votes
1 answer
Plotly Express set the width of a specific line on graph of multiple lines
I'm trying to make the 'Close' line wider than the others using plotly.express. I tried various options with a conditional statement, or adding a trace but nothing seems to work.
fig.for_each_trace(
lambda trace:…

Zen4ttitude
- 143
- 10
0
votes
2 answers
Changing the base color of ploty_express parallel_categories diagram
Creating a parallel_categories with ploty express
import plotly.express as px
df = px.data.tips()
fig = px.parallel_categories(df)
fig.show()
gives a diagram with blue base color.
I would like to change the base color without using graph object.…

Towlie
- 77
- 1
- 6
0
votes
2 answers
How to update range_color in Plotly Express?
I am using plotly express and I want to display some data:
import plotly.express as px
dfx = px.data.tips()
fig = px.scatter(dfx,
x='total_bill', y='tip',
color='size',
template='plotly_dark',
…

Federico Gentile
- 5,650
- 10
- 47
- 102
0
votes
0 answers
Plotly express: ValueError: Value of 'x' is not the name of a column in 'data_frame'
I'm having a problem producing a 3d scatter plot with plotly express.
Here is my data frame:
Here is my code:
df = pd.read_csv('/Users/alissanicolet./Desktop/QGIS_Thesis/pythongraph.csv')
print(df)
fig = px.scatter_3d(
data_frame=df,
…

miso
- 11
- 2
0
votes
1 answer
Remove series border lines from plotly express area chart
px.area shows a line atop each area series. How can I remove it?
The documentation only shows how to remove lines from go.Scatter calls (with mode='none').
Here's an example (notebook), where I'd like to remove the dark blue and red lines atop the…

Max Ghenis
- 14,783
- 16
- 84
- 132
0
votes
0 answers
Plotly express how to deselect and hide timelines (jobs) on y-axis?
I need the option to deselect multiple timeline (jobs) on y-axis so that they are hidden. For example following sample code.
import plotly.express as px
import pandas as pd
df = pd.DataFrame([
dict(Task="Job A", Start='2009-01-01',…

Faisal
- 159
- 1
- 1
- 13
0
votes
2 answers
How to resize or set the size of plotly express facet subplots?
I am using plotly express to plot the subplots that I require for the analysis I am doing. Due to the nature of the work I have more than 30 subplots resulting from faceting. The graphs that I am getting are as shown in the figure.
I would like to…

Sash7
- 73
- 1
- 11
0
votes
1 answer
Matplotlib fill_betweenx() replacement in Plotly
I have a vertical line plot of Lithology data (x=Lithology, y=Depth) and a dictionary with colors and patterns. I need to fill my line plot using plotly and patterns:colors from my dictionary, like one in this picture on the right side. In…

hikkers
- 1
0
votes
0 answers
How can I seperate each instance of a specific column value from a dataframe on a bar grpah?
I have a data frame which I have
4 columns
“Location, Sample_Date, SRB, APB”
I’ve made the “Location” the index.
And within this DF there could be multiple instances of a “Location”.
I’ve started creating my first Dash app and I have a dropdown and…

mattgcf
- 33
- 6