Every line of 'subplot 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.
402 def setTitle(self, title=''): 403 """Set the title at the top of graph""" 404 self.title = title
97 def 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)
574 def 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()
466 def subplot(self, axes, subfigure): 467 """ 468 Draw a range-compare plot on an :class:`matplotlib.axes` 469 instance, with a logarithmic scale on the x-axis. Data and 470 labels are contained in a tuple. x-ticks presented as integer 471 values. A grid is added with a call to 472 :meth:`RangeFigure.addGrid`. 473 474 :param axes: :class:`matplotlib.axes` instance. 475 :param tuple subfigure: Holds the data and labels to be added 476 to the subplot. 477 478 """ 479 xdata, y1, y2, y2max, y2min, xlabel, ylabel, title = subfigure 480 481 axes.semilogx(xdata, y1, color='r', lw=2, label="", subsx=xdata) 482 axes.semilogx(xdata, y2, color='k', lw=2, label="", subsx=xdata) 483 self.addRange(axes, xdata, y2min, y2max) 484 ylim = (0., np.max([100, np.ceil(y2.max()/10.)*10.])) 485 axes.set_ylim(ylim) 486 487 axes.set_xlabel(xlabel) 488 axes.set_ylabel(ylabel) 489 axes.set_title(title) 490 self.addGrid(axes)
104 def setup_axis(X, Y, ax=None, fig=None, ylims=None): 105 """Setup axis, including timer for animation or snaps 106 107 Parameters 108 ---------- 109 X : 110 space disctretization to get limits 111 Y : 112 solution to get limits 113 ax : 114 ax where to put everything, if None current axes are used (Default value = None) 115 fig : 116 fig where to put everything, if None current figure is used (Default value = None) 117 ylims : 118 custom ylims, if None y axis limits are calculated from Y (Default value = None) 119 120 Returns 121 ------- 122 ax 123 124 fig 125 126 time_text 127 object to fill in text 128 129 """ 130 if ax is None: 131 fig = plt.gcf() 132 ax = plt.gca() 133 if ylims is None: 134 lowery = nm.min(Y) - nm.min(Y) / 10 135 uppery = nm.max(Y) + nm.max(Y) / 10 136 else: 137 lowery = ylims[0] 138 uppery = ylims[1] 139 ax.set_ylim(lowery, uppery) 140 ax.set_xlim(X[0], X[-1]) 141 time_text = ax.text(X[0] + nm.sign(X[0]) * X[0] / 10, 142 uppery - uppery / 10, 143 'empty', fontsize=15) 144 return ax, fig, time_text