Questions tagged [plotly-express]
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.
plotly-express
395
questions
0
votes
1
answer
16
views
Subplot two plotly python express choropleth maps including time animations next to each other
I would like to plot multiple plotly express choropleth maps with their own time sliders next to each other.
I have tried lots of different approaches by now, but nothing seems to work. I am aware of ...
0
votes
0
answers
17
views
Streamlit Plotly choropleth re-drawing on slider change
I am using Streamlit to create a Plotly Express choropleth map of counties in Georgia (USA) with shading based on the county population. I also have a slider widget above the map for the user to ...
0
votes
1
answer
46
views
How Do I Make This Graph Cleanly From Saturday to Sunday Without the Half Bars?
I am trying to create a bar graph to represent data over a week. Everything seems fine but the first and last bars (for Saturday) appear to be cut in half. My code is below. How can I fix this?
nf = ...
0
votes
1
answer
84
views
Plotly Figures not displaying in Quarto
I have an IPYNB file (notebook downloaded from Google Colab). It has a cell in it that makes a chart in plotly:
import plotly.express as px
fig = px.line(x=[1,2,3], y=[1,2,3])
fig.show()
I see the ...
0
votes
2
answers
45
views
Tasks with the same name in Gantt diagram using plotly.express.timeline
Is there a way to separate tasks on a Gantt diagram if they have the same names?
import plotly.express as px
import pandas as pd
df = pd.DataFrame([
dict(Task="Job A", Start='2009-01-01'...
0
votes
1
answer
47
views
Plotly px.Timeline y marks do not adjust when using facet_row
With a simple dataFrame that look like this
The following code
fig = px.timeline(df,
x_start="Target Date Start",
x_end="Target Date End",
...
1
vote
2
answers
49
views
How to set independent parameters for subplots in Plotly?
I’m working with Plotly in Python to create a figure with two subplots, each containing a density contour plot. I want to set different bin sizes (nbinsx and nbinsy) for each subplot. However, it ...
1
vote
0
answers
37
views
Importing plotly.express gives attribution error
I am trying to import plotly.express for a project but python is throwing me an error:
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`...
0
votes
1
answer
52
views
Labelling default ticks Plotly Express
I want to display the x-axis values in my plotly express chart in a standard format, as opposed to having raw labels; while preserving the tick layouts.
Basically, I like the fact there's only a few '...
0
votes
0
answers
24
views
Issue with color treemap
I'm new here. i have a problem with this code with the color scale: some high values have red color and others have green, but the idea is the negative values were red and positive green.
range_color =...
1
vote
1
answer
47
views
Generating a plotly.express.bar chart for two population categories + extending to animation frame
I am freshman in all things Python, pandas and plotly. I am doing a personal project on population of individual countries and I would like to make a plotly.express + dash graph environment, but I ...
0
votes
2
answers
44
views
Plotly Express - Scatter Plot - X axis issue (zoom issue?)
I am trying to create a plot with time slider for the checkpoints a marathon runner has crossed with respect to time.
The code is as below -
fig = px.scatter(data_frame=marathon_data, x="...
1
vote
1
answer
66
views
How can I make France completely transparent in the map resulting from this code?
I'm using this code to create a map of Europe and I would like France to be completely invisible in some views, I wouldn't want to delete it from the list of countries. Changing the opacity does not ...
0
votes
0
answers
30
views
Plotly stacked bar chart in subplot -- visually differentiate the "stacked" values inside the subplot
Assume we're using the plotly px.data.iris() dataset to generate a stacked bar chart. This is pretty straight-forward using plotly express:
import plotly.express as px
df = px.data.iris()
df = df[[&...
0
votes
1
answer
40
views
Customizing Color Gradient for non-sorted Ordinal Variables using plotly.express
I have a dataset that I would like to visualize using a line plot sorted by date. Each line in the plot represents a distinct variable, and I intend to assign a gradient of colors to these lines.
...