filled contour plot in plotly.express
See original GitHub issueIs there a way to create filled contour plots with plotly.express similar to the following one? (reference: https://plot.ly/python/contour-plots/)
The only ones I have seen so far with plotly.express are not filled, e.g.:
import plotly.express as px
df = px.data.iris()
fig = px.density_contour(df, x="sepal_width", y="sepal_length", color="species", marginal_x="rug", marginal_y="histogram")
fig.show()
(reference: https://plot.ly/python/plotly-express/)
Any help is appreciated! 😃
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Contour plots in Python - Plotly
A 2D contour plot shows the contour lines of a 2D numerical array z , i.e. interpolated lines of isovalues of z ....
Read more >Contour Plots using Plotly in Python - GeeksforGeeks
A contour plot has a function of two variables of curves along which the function has constant values so that these curves join...
Read more >Plotly.Express.Density_contour - Linux Hint
A density contour refers to a 2d histogram resembling a contour plot but is computed by grouping a set of data points as...
Read more >plotly.graph_objects.Contour — 5.11.0 documentation
fillcolor – Sets the fill color if contours.type is “constraint”. Defaults to a half-transparent variant of the line color, marker color, or marker...
Read more >Plotly: how to fill the background of a contour ... - Stack Overflow
Some plot types have the connectgaps=True option to fill in the gaps but this does not seem to be available for the Histogram2dContour...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In case this is useful to anyone, I needed this kind of plot in combination with animation frames.
Although the solution below might not be very beautiful using the iris dataset, you might have a better usecase for other dataframes:
You can set the
colorscale
in theupdate_traces()
call like this: