Resolved: Legend not displaying properly
Hi,
In the scatter plot, the "square" marker for the first class '0' is not displayed correctly in the legend. Please see attached image. What could be wrong?
Regards,
Dhaivat Parekh
Hey Dhaivat,
Thank you for reaching out!
Frankly, I'm not sure why this problem occurs. Could you please try switching the places of the markers? For example, could you experiment with ['^', ',', 'P']
or any other combination. You could also try substituting the square marker with any of the other markers listed on seaborn
's website:
https://seaborn.pydata.org/tutorial/properties.html#marker
Does the problem persist?
If yes, then another possibility would be to access seaborn
's legend
property and use it to construct the legend, as suggested in the following Stackoverflow thread:
Finally, could you tell me the versions of matplotlib
and seaborn
you are working with?
Kind regards,
365 Hristina
Hi Hristina,
Issue resolved by choosing a different marker symbol! Thanks for the support!
Incidentally, the square marker has an 's' as the symbol, and comma (',') is not seen as a symbol of any marker. Maybe during an update, they have removed the comma string as any marker indication. Please check if you need to make any modifications in the lesson to eliminate use of comma string for any marker representation. Please see attached screenshot of the available marker strings as taken from the site https://seaborn.pydata.org/tutorial/properties.html#marker
Hey Dhaivat,
Thank you for the follow-up! We'll add this remark to the course as soon as possible.
Kind regards,
365 Hristina