Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

plt legend top right outside

import matplotlib.pyplot as plt
import numpy as np

x = np.arange(10)

fig = plt.figure()
ax = plt.subplot(111)

for i in xrange(5):
    line, = ax.plot(x, i * x, label='$y = %ix$'%i)

ax.legend(loc='upper center', bbox_to_anchor=(0.5, 1.05),
          ncol=3, fancybox=True, shadow=True)
plt.show()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #plt #legend #top
ADD COMMENT
Topic
Name
3+5 =