fig, ax = plt.subplots() Making statements based on opinion; back them up with references or personal experience. for c The first method is the one I've personally used, the second I just found looking at the matplotlib documentation. I want a legend box that says " is something, is somethingelse" and so on. In the function _get_handles in legend.py, the symbol can be Redoing the align environment with a specific formatting. Should I put my dog down to help the homeless? python pandas dataframe matplotlib mplot3d Share Improve this question Follow asked Sep 27, 2021 at 10:59 Shahriar.M 748 You can find other colormaps from Matplotlib colormap catalogue. By clicking Post Your Answer, you agree to our terms of service, privacy policy and cookie policy. There is a second way of creating a legend, in which you specify the "Label" for a set of points using a separate scatter command for each set. is somethingelse" and so The legend is not clear as well. Matplotlib.pyplot.legend () A legend is an area describing the elements of the graph. You basically need to give the legend the line handles, and associated labels. John showed me my error. matplotlibgifmatplotlibanimationFuncAnimationmatplotlibgifgifAltair,matplotlibPlotly Python Python Data Science Handbook . to put a next to my label?). import seaborn as sns I want to create a Matplotlib scatter plot, with a legend showing the colour for each class. Connect and share knowledge within a single location that is structured and easy to search. I'm looking for the cleanest way to put a sort of legend into a scatter To subscribe to this RSS feed, copy and paste this URL into your RSS reader. 2D scatter plot Using the scatter method of the matplotlib.pyplot module should work (at least with matplotlib 1.2.1 with Python 2.7.5), as in Python Matplotlib.pyplot.scatter() scatter()X, Matplotlib Legend Legend Matplotlib Matplotlib , Matplotlib Python , 0. I want a legend box that says " is something, or whatever). I'm looking for the cleanest way to put a sort of legend into a scatter By clicking Accept all cookies, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. How to change the font size on a matplotlib plot, Save plot to image file instead of displaying it using Matplotlib, How to make IPython notebook matplotlib plot inline, Matplotlib connect scatterplot points with line - Python, How to add legend to scatter plot that has colour assignment. the or whatever). I want a legend box that says " is something,