import numpy as np
import pandas as pd
import matplotlib_venn
import matplotlib.pyplot as plt
import brewer2mpl
import itertools
import seaborn as sns
import collections
import itertools

set1 = brewer2mpl.get_map('Set1', 'qualitative', 9).mpl_colors
red = set1[0]
blue = set1[1]
green = set1[2]
purple = set1[3]
orange = set1[4]
yellow = set1[5]
brown = set1[6]
pink = set1[7]
grey = set1[8]
@@ -144,16 +144,207 @@
  as sns%0A
+%0Asns.set(style='ticks', context='talk')%0A%0Aimport matplotlib as mpl%0A# Set the svg output text as actual text and not outlines of paths%0A# (easier to edit)%0Ampl.rcParams%5B'svg.fonttype'%5D = 'none'%0A%0A
 import c
@@ -576,8 +576,717 @@
  set1%5B8%5D
+%0A%0A%0A# To put the legend outside the plot, on the right side, add these keyword%0A# arguments (%22kwargs%22) to your legend making, e.g.:%0A# legend = ax.legend(**OUTSIDE_LEGEND_KWARGS)%0AOUTSIDE_LEGEND_KWS = dict(bbox_to_anchor=(1, 0.5), loc='center left')%0A%0A# As a placeholder. Should be the output from%0A# %22ax.legend(**OUTSIDE_LEGEND_KWARGS)%22%0Alegend = None%0A%0A# Also need to save the figure in a special way so that the legend doesn't%0A# get cut off. Make sure to save the %22legend%22 object that %22ax.legend%22 returns%0A# and then save that as %22legend%22, then add these keyword arguments to your%0A# savefig call:%0AOUTSIDE_LEGEND_SAVEFIG_KWS = dict(bbox_extra_artists=(legend,),%0A                                  bbox_inches='tight')

add matplotlib helpers like for making your legend outside the figure