7 examples of 'matplotlib set_title' in Python

Every line of 'matplotlib set_title' 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
this disclaimer
574def set_xaxis_title(self, xtitle):
575 """Set x-axis title"""
576 self.x_title = text_window(self, xtitle)
577 self.all_titles[1] = self.x_title
578 self.update()
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

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)
402def setTitle(self, title=''):
403 """Set the title at the top of graph"""
404 self.title = title
370def _set_title(self):
371 tprop = vtk.vtkTextProperty()
372 tprop.BoldOff()
373 tprop.SetFontSize(self._axis.getp('fontsize'))
374 tprop.SetColor(self._axis.getp('fgcolor'))
375 tprop.SetFontFamilyToArial()
376 tprop.SetVerticalJustificationToTop()
377 tprop.SetJustificationToCentered()
378 mapper = vtk.vtkTextMapper()
379 mapper.SetInput(self._fix_latex(self._axis.getp('title')))
380 mapper.SetTextProperty(tprop)
381 actor = vtk.vtkActor2D()
382 actor.SetMapper(mapper)
383 actor.GetPositionCoordinate().SetCoordinateSystemToView()
384 actor.GetPositionCoordinate().SetValue(0.0, 0.95)
385 self._axis._renderer.AddActor(actor)
97def set_title(self,s,panel=None):
98 "set plot title"
99 if panel is None: panel = self.current_panel
100 self.panels[panel].set_title(s)
345def __prepare_plot_with_matplotlib(
346 wrange, figsize, grid, wireframe, noaxis):
347 import matplotlib.pyplot as plt
348
349 fig = plt.figure(figsize=(figsize, figsize))
350 ax = fig.gca()
351 ax.set_aspect('equal')
352
353 # if wireframe:
354 # ax.w_xaxis.set_pane_color((0, 0, 0, 0))
355 # ax.w_yaxis.set_pane_color((0, 0, 0, 0))
356 # ax.w_zaxis.set_pane_color((0, 0, 0, 0))
357
358 ax.grid(grid)
359 ax.set_xlim(*wrange['x'])
360 ax.set_ylim(*wrange['y'])
361 ax.set_xlabel('X')
362 ax.set_ylabel('Y')
363
364 if noaxis:
365 ax.set_axis_off()
366
367 return (fig, ax)
88def set_info(self, title=None, xlabel=None, ylabel=None):
89 """Set title and labels for the axis of the canvas."""
90 # Set label / title only for grid axis :
91 if self._axis:
92 # X-label :
93 if xlabel is not None:
94 self.xaxis.axis.axis_label = xlabel
95 self.xaxis.update()
96 # Y-label :
97 if ylabel is not None:
98 self.yaxis.axis.axis_label = ylabel
99 self.yaxis.update()
100 # Title :
101 if title is not None:
102 self._titleObj.text = title
103 self.canvas.update()
104 else:
105 raise ValueError("For defining infos, you must use an axis canvas")

Related snippets