Announcing Dash Bio 1.0.0 🎉 : a one-stop-shop for bioinformatics and drug development visualizations.

Legend with Graph Objects

I want to create something like in Plot 1 here in vestland’s reply but using graph objects instead of plotly express as I need to use FigureWidget.

Basically, I want x-axis to be a column of continuous data, y-axis to be a column of categorical data, and the color to be another column of continuous data.

The problem is if you don’t use plotly express, the legend is not generated. While you can set “showlegend=True” and "marker_color=df[‘continuous_data’] , the legend is wrong as illustrated here:

Screenshot 2021-12-14 184055

  1. How do I use graph objects to generate a bar chart and legend similar to “Plot 1” in the stackoverflow reply by vestland?

  2. Or alternatively, is there is a way to use plotly express with FigureWidget?