10 examples of 'add title to seaborn plot' in Python

Every line of 'add title to seaborn plot' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
51def decorate_singleplot(ax, **kwarg):
52 ax.axis('tight')
53 ax.set_yscale('log')
54 ax.set(**kwarg)
1516def _add_axis_labels(self):
1517 """Add labels to the left and bottom Axes."""
1518 for ax, label in zip(self.axes[-1, :], self.x_vars):
1519 ax.set_xlabel(label)
1520 for ax, label in zip(self.axes[:, 0], self.y_vars):
1521 ax.set_ylabel(label)
70def set_x_title(self, t, plotid=0):
71 '''
72 '''
73 axis = self._get_x_axis(plotid)
74 axis.title = t
75 # print axis.title, axis, t
76 super(TimeSeriesGraph, self).set_x_title(t, plotid=plotid)
402def setTitle(self, title=''):
403 """Set the title at the top of graph"""
404 self.title = title
97def title(self, title, x=0.5, y=0.95, fontsize=14, **keywords):
98 pylab.figure(num=self.figure.number)
99 pylab.figtext(x, y, title, fontsize=fontsize, **keywords)
84def add_to_canvas(self, ax, plots, legend=False, title=None, **kwargs):
85 #ax.autoscale_view()
86 fontdict=dict(family='sans-serif', weight='light', size=9)
87 if legend is True:
88 ax.legend(*ax.get_legend_handles_labels())
89 elif legend >= 1:
90 #ax.legend(prop=fontdict)
91 legend_ontop(ax, ncol=legend, fontdict=fontdict)
92 if title is not None: ax.figure.suptitle(title)
93 return ax
414@invalidate_plot
415def annotate_title(self, field, title):
416 """Set the unit used to plot the field
417
418 Parameters
419 ----------
420 field: str or field tuple
421 The name of the field to set the units for
422 title: str
423 The title to use for the plot
424 """
425 self._titles[self.data_source._determine_fields(field)[0]] = title
21def plot(ax, x, y, **kwargs):
22 '''
23
24 '''
25
26 # Determine the label text
27 label = kwargs.pop('label', None)
28 if label is None:
29 label = '%s (%s)' % (y.name, y.parent)
30
31 # Determine the color
32 color = kwargs.pop('color', None)
33 if color is None:
34 color = y.color
35
36 # Axis labels
37 if len(x.unit):
38 ax.set_xlabel('%s (%s)' % (x.description, x.unit))
39 else:
40 ax.set_xlabel(x.description)
41 if len(y.unit):
42 ax.set_ylabel('%s (%s)' % (y.description, y.unit))
43 else:
44 ax.set_ylabel(y.description)
45
46 # Plot
47 l = ax.plot(x, y, color = color, label = label, **kwargs)
48
49 return l
31def add_title(text, loc, bg):
32 lab = Title(text=text, background_fill_color=bg)
33 p.add_layout(lab, loc)
37def _set_texts(self, plot_title, horizontal_axis_title, vertical_axis_title):
38 fontsize = 15
39 plt.title(plot_title, fontsize=fontsize)
40 plt.xlabel(horizontal_axis_title, fontsize=fontsize)
41 plt.ylabel(vertical_axis_title, fontsize=fontsize)

Related snippets