Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to put legend outside pie plot in python

title = plt.title('What slows down my computer')
title.set_ha("left")
plt.gca().axis("equal")
pie = plt.pie(total, startangle=0)
labels=["Trojans", "Viruses", "Too many open tabs", "The anti-virus software"]
plt.legend(pie[0],labels, bbox_to_anchor=(1,0.5), loc="center right", fontsize=10, 
           bbox_transform=plt.gcf().transFigure)
plt.subplots_adjust(left=0.0, bottom=0.1, right=0.45)
Comment

PREVIOUS NEXT
Code Example
Python :: how to get prime numbers in a list in python using list comprehension 
Python :: get column index of maximum value in each row pandas 
Python :: python md5sum 
Python :: compile python folder 
Python :: python smtp sendmail 
Python :: python last 3 list elements 
Python :: how do you change a string to only uppercase in python 
Python :: scatter matrix plot 
Python :: list files in python 
Python :: python string contains 
Python :: Iterate string 2 characters at a time in python 
Python :: pandas normalize columns 
Python :: Python program to count positive and negative numbers in a list 
Python :: pandas print dataframe without index 
Python :: How to develop a UDP echo server in python? 
Python :: pandas isin 
Python :: split into list into even chunks 
Python :: flatten list python 
Python :: queue using linked list in python 
Python :: short if python 
Python :: python test if list of dicts has key 
Python :: print with no newline 
Python :: python check samplerate of mp3 
Python :: change index to dataframe pandas 
Python :: question command python 
Python :: normalize numpy array 
Python :: play sound python 
Python :: remove prefix in python 3.6 
Python :: django pass parameters in url 
Python :: try with multiple except python 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =