Make the X-Axis title
543578
def _make_x_title(self):
        """"""
        y = (self.height - self.margin_box.bottom + self._x_labels_height)
        if self._x_title:
            for i, title_line in enumerate(self._x_title, 1):
                text = self.svg.node(
                    self.nodes['title'],
                    'text',
                    class_='title',
                    x=self.margin_box.left + self.view.width / 2,
                    y=y + i * (self.style.title_font_size + self.spacing)
                )
                text.text = title_line
1028396
function prependTitle(html, title, svgWidth) {
        if (!title || !svgWidth) {
            return html;
        }
        let {grey} = colorSchemas;

        html =  html.replace(/<g/,`<text x="${this.margin().left}" y="${config.titleTopOffset}" font-family="${config.titleFontFamily}" font-size="${config.titleFontSize}" fill="${grey[6]}"> ${title} </text><g `);

        return html;
    }
1329509
function ( axis, startX, startY, endX, endY ) {
        var result = 'none';

        if ( axis == 'horizontal' ) {
            if ( startX > endX ) {
                result = 'left';
            } else if ( startX < endX ) {
                result = 'right';
            }
        } else {
            if ( startY > endY ) {
                result = 'top';
            } else if ( startY < endY ) {
                result = 'bottom';
            }
        }

        return result;
    }
1181350
function (str, x, y) {

		var defaultChartStyle = defaultOptions.chart.style;

		return this.createElement('span')
			.attr({
				text: str,
				x: mathRound(x),
				y: mathRound(y)
			})
			.css({
				whiteSpace: 'nowrap',
				fontFamily: defaultChartStyle.fontFamily,
				fontSize: defaultChartStyle.fontSize
			});
	}
368023
def set_title(self, row, column, text):
        
        subplot = self.get_subplot_at(row, column)
        subplot.set_title(text)
315872
def mmGetPermanencesPlot(self, title=None):
    
    plot = Plot(self, title)

    data = numpy.zeros((self.getNumColumns(), self.getNumInputs()))
    for i in xrange(self.getNumColumns()):
      self.getPermanence(i, data[i])

    plot.add2DArray(data, xlabel="Permanences", ylabel="Column")
    return plot
1339960
def header(self, axis, x, level=0):
        
        ax = self._axis(axis)
        return ax.values[x] if not hasattr(ax, 'levels') \
            else ax.values[x][level]
375037
function title(title, widths, opt){
  var wid = title.length;
  var total = widths.reduce((a, b) => a + b + 3, 0) - 1;
  var left = parseInt((total - wid) / 2);
  if (!opt.plain) title = '\u001b[1m' + title + '\u001b[22m';
  log(p[0][0] + widths.map(col => p.h + strN(col, p.h) + p.h).join(p.h) + p[0][2]);
  log(p.v + widths.map(col => ' ' + strN(col, ' ') + ' ').join(' ') + p.v);
  log(p.v + strN(left) + title + strN(total - left - wid) + p.v);
  log(p.v + widths.map(col => ' ' + strN(col, ' ') + ' ').join(' ') + p.v);
}
453870
def make_title(self, chan, cycle, stage, evt_type):
        """"""
        cyc_str = None
        if cycle is not None:
            cyc_str = [str(c[2]) for c in cycle]
            cyc_str[0] = 'cycle ' + cyc_str[0]

        title = [' + '.join([str(x) for x in y]) for y in [chan, cyc_str,
                 stage, evt_type] if y is not None]

        return ', '.join(title)
560076
def _plot(self, axes_list):
        '''
        
        '''

        axes = axes_list[0]

        if self.plot_settings:
            axes.imshow(self.data['image_data'], cmap=self.plot_settings['cmap'], interpolation=self.plot_settings['interpol'], extent=self.data['extent'])
            axes.set_xlabel(self.plot_settings['xlabel'])
            axes.set_ylabel(self.plot_settings['ylabel'])
            axes.set_title(self.plot_settings['title'])

        self._update(axes_list)
479875
private void drawTitle(Graphics2D chartGraphics) {
    if (title != null) {
      // Strings are drawn from the baseline position of the leftmost char.
      int yTitle = (margin / 2) + titleAscent;
      int xTitle = (chartSize.width / 2) - (titleSize.width / 2);

      chartGraphics.setFont(titleFont);
      chartGraphics.setColor(titleColour);
      chartGraphics.drawString(title, xTitle, yTitle);
    }
  }
582252
def __map_axis(self, axis):
        """"""
        start_code, start_value = axis
        value = start_value
        code = self.manager.codes['xpad'][start_code]
        return code, value
1298169
def _get_label(self, axis):
        """"""

        if axis == 'x':
            colname = self.x_col
        else:  # y
            colname = self.y_col

        if colname == self._idxname:
            label = 'Index'
        else:
            col = self.tab[colname]
            if col.unit:
                label = '{0} ({1})'.format(col.name, col.unit)
            else:
                label = col.name

        return label
952103
def relabel(self, xlabel=None, ylabel=None,
                y2label=None, title=None, delay_draw=False):
        " "
        n = self.labelfont.get_size()
        self.titlefont.set_size(n+1)
        # print("  plot relabel ", delay_draw)
        rcParams['xtick.labelsize'] =  rcParams['ytick.labelsize'] =  n
        rcParams['xtick.color'] =  rcParams['ytick.color'] =  self.textcolor

        if xlabel is not None:
            self.xlabel = xlabel
        if ylabel is not None:
            self.ylabel = ylabel
        if y2label is not None:
            self.y2label = y2label
        if title is not None:
            self.title = title

        axes = self.canvas.figure.get_axes()
        kws = dict(fontproperties=self.titlefont, color=self.textcolor)
        axes[0].set_title(self.title, **kws)
        kws['fontproperties'] = self.labelfont

        if len(self.xlabel) > 0 and self.xlabel not in ('', None, 'None'):
            axes[0].set_xlabel(self.xlabel, **kws)

        if len(self.ylabel) > 0 and self.ylabel not in ('', None, 'None'):
            axes[0].set_ylabel(self.ylabel, **kws)
        if (len(axes) > 1 and len(self.y2label) > 0 and
            self.y2label not in ('', None, 'None')):
            axes[1].set_ylabel(self.y2label, **kws)

        for ax in axes[0].xaxis, axes[0].yaxis:
            for t in (ax.get_ticklabels() + ax.get_ticklines()):
                t.set_color(self.textcolor)
                if hasattr(t, 'set_fontsize'):
                    t.set_fontsize(n)

        self.set_added_text_size()
        if self.mpl_legend is not None:
            for t in self.mpl_legend.get_texts():
                t.set_color(self.textcolor)
        if not delay_draw:
            self.canvas.draw()
170626
function () {
		var chart = this,
			options = this.options,
			xAxisOptions = options.xAxis = splat(options.xAxis || {}),
			yAxisOptions = options.yAxis = splat(options.yAxis || {}),
			optionsArray,
			axis;

		// make sure the options are arrays and add some members
		each(xAxisOptions, function (axis, i) {
			axis.index = i;
			axis.isX = true;
		});

		each(yAxisOptions, function (axis, i) {
			axis.index = i;
		});

		// concatenate all axis options into one array
		optionsArray = xAxisOptions.concat(yAxisOptions);

		each(optionsArray, function (axisOptions) {
			axis = new Axis(chart, axisOptions);
		});

		chart.adjustTickAmounts();
	}
373894
function () {
		var center = this.center,
			chart = this.chart,
			titleOptions = this.options.title;
		
		return { 
			x: chart.plotLeft + center[0] + (titleOptions.x || 0), 
			y: chart.plotTop + center[1] - ({ high: 0.5, middle: 0.25, low: 0 }[titleOptions.align] * 
				center[2]) + (titleOptions.y || 0)  
		};
	}
312130
def ExportTextFile(self, fname, title='unknown plot'):
        ""

        buff = ["# Plot Data for %s" % title,
                "#---------------------------------"]

        out = []
        labels = []
        itrace = 0
        for ax in self.panel.fig.get_axes():
            for line in ax.lines:
                itrace += 1
                x = line.get_xdata()
                y = line.get_ydata()
                ylab = line.get_label()

                if len(ylab) < 1:
                    ylab = 'Y%i' % itrace
                for c in ' .:";|/\\(){}[]\'&^%*$+=-?!@#':
                    ylab = ylab.replace(c, '_')
                xlab = (' X%d' % itrace + ' '*3)[:4]
                ylab = ' '*(18-len(ylab)) + ylab + '  '
                out.extend([x, y])
                labels.extend([xlab, ylab])

        if itrace == 0:
            return

        buff.append('# %s' % (' '.join(labels)))

        npts = [len(a) for a in out]
        for i in range(max(npts)):
            oline = []
            for a in out:
                d = np.nan
                if i < len(a):
                    d = a[i]
                oline.append(gformat(d, 12))
            buff.append(' '.join(oline))

        buff.append('')
        with open(fname, 'w') as fout:
            fout.write("\n".join(buff))
        fout.close()
        self.write_message("Exported data to '%s'" % fname, panel=0)