Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pairplot seaborn legend best position set

g = sns.pairplot(iris, hue='species', palette='husl', markers='d', size=2.5, plot_kws=
    {
    "s":40,
    "alpha":1.0,
    'lw':0.5,
    'edgecolor':'k'
    })

handles = g._legend_data.values()
labels = g._legend_data.keys()
g.fig.legend(handles=handles, labels=labels, loc='upper center', ncol=1)
g.fig.legend(handles=handles, labels=labels, loc='lower center', ncol=3)
g.fig.legend(handles=handles, labels=labels, loc='upper left', ncol=3)
g.fig.subplots_adjust(top=0.92, bottom=0.08)
Comment

default pairplot seaborn legend to control position

    g._legend.set_bbox_to_anchor((0.5, 0.5))
Comment

PREVIOUS NEXT
Code Example
Python :: purge python3.y from every place in my path 
Python :: dateentry python centered 
Python :: logout from linux using python 
Python :: python netcdf double 
Python :: matplotlib doesnt show suptitle 
Python :: tkinter trig calculator 
Python :: what is primary key in python 
Python :: django create ap 
Python :: idiomatic python 
Python :: range function in python use cases 
Python :: placeholder in model form 
Python :: python min date from dictionary 
Python :: tf.stop_gradient in pytorch 
Python :: print a commans in python 
Python :: jupter notebook save session variables 
Python :: python program to multiply two numbers and multiply the answer with 2nd variables 
Python :: prime numbers from 1 to 100 in python 
Python :: fomat json load python 
Python :: how to take matrix input in python 
Python :: check internet speed using python 
Python :: jumpssh execute multiple commands 
Python :: pandas melt and stack 
Python :: if ele in python 
Python :: python loop increment by 2 
Python :: convert to string except missing 
Python :: set focus in last position entry tkinter 
Python :: method 01 of making GUI with tkinter in python 
Python :: Convert PySpark RDD to DataFrame 
Python :: how to get the string between brackets in a string in python 
Python :: How to convert string to uppercase, lowercase and how to swapcase in python 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =