Like ggplot2, can we have separate legends for Color, Symbol, etc. for a Plotly Express visualization?
from pydataset import data
import plotly.express as px
mtcars = data('mtcars')
mtcars.am = mtcars.am.astype('category')
mtcars.gear = mtcars.gear.astype('category')
plt = px.scatter(mtcars, x = 'mpg', y='qsec', color ='disp', symbol = 'am', size = 'wt')
plt.show()
Here, no separate legends are generated.
Also, If one of the legends has continuous value strip, then other legends become invisible.
Now, compare this with GGPLOT (I have used python package plotnine):
ggplot(mtcars, aes(x = 'mpg', y='qsec', color ='disp', shape = 'am', size = 'wt')) + geom_point()
So, simple and complete. How can we get an output like this using Plotly?
Thank you in advance.


