Graph the series on the secondary Y axis.
177833
def secondYAxis(requestContext, seriesList):
    
    for series in seriesList:
        series.options['secondYAxis'] = True
        series.name = 'secondYAxis(%s)' % series.name
    return seriesList
833723
def Y_more(self):
        """"""
        self.parent.value('y_scale', self.parent.value('y_scale') * 2)
        self.parent.traces.display()
448515
function drawLinesDataset(axis, animPc, data, config, ctx, offsets, vars) {
		var xAxisPosY = vars.xAxisPosY;
		var yAxisPosX = vars.yAxisPosX;
		var valueHop = vars.valueHop;
		var nbValueHop = vars.nbValueHop;
		var scaleHop = vars.scaleHop;
		var zeroY = vars.zeroY;
		var calculatedScale = vars.calculatedScale;
		var logarithmic = vars.logarithmic;
		var currentAnimPc = animationCorrection(animPc, data, config, 0, 0, 0);
		var totvalue = new Array();
		var maxvalue = new Array();
		var lmaxvalue = new Array();
		var lminvalue = new Array();
		for (var i = 0; i < data.datasets.length; i++) {
			lmaxvalue[i] = -999999999;
			lminvalue[i] = 999999999;
			if ((axis == 2 && data.datasets[i].axis == 2) || (axis != 2 && data.datasets[i].axis != 2)) {
				for (var j = 0; j < data.datasets[i].data.length; j++) {
					totvalue[j] = 0;
					maxvalue[j] = -999999999;
				}
			}
		}
		currentAnimPc.mainVal = 1;
		for (var i = 0; i < data.datasets.length; i++) {
			if ((axis == 2 && data.datasets[i].axis == 2) || (axis != 2 && data.datasets[i].axis != 2)) {
				for (var j = 0; j < data.datasets[i].data.length; j++) {
					totvalue[j] += data.datasets[i].data[j];
					maxvalue[j] = Max([maxvalue[j], data.datasets[i].data[j]]);
					lmaxvalue[i] = Max([lmaxvalue[i], yPos(i, j)]);
					lminvalue[i] = Min([lminvalue[i], yPos(i, j)]);
				}
			}
		}
		for (var i = 0; i < data.datasets.length; i++) {
			if ((axis == 2 && data.datasets[i].axis == 2) || (axis != 2 && data.datasets[i].axis != 2)) {
				var prevpt = -1;
				var frstpt = -1;
				if (typeof data.datasets[i].strokeColor == "function") {
					ctx.strokeStyle = data.datasets[i].strokeColor("STROKECOLOR", data, config, i, -1, animPc, -1, "Line", ctx, yAxisPosX, lmaxvalue[i], yAxisPosX + valueHop * (data.datasets[i].data.length - 1), lmaxvalue[i] - ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * (lmaxvalue[i] - lminvalue[i]));
				} else if (typeof data.datasets[i].strokeColor == "string") {
					ctx.strokeStyle = data.datasets[i].strokeColor;
				} else ctx.strokeStyle = config.defaultStrokeColor;
				ctx.lineWidth = config.datasetStrokeWidth;
				ctx.beginPath();
				var prevAnimPc;
				var prevXpos;
				prevAnimPc = 0;
				prevnotempty = 0;
				for (var j = 0; j < data.datasets[i].data.length; j++) {
					var xposj = xPos(i, j, data);
					currentAnimPc = animationCorrection(animPc, data, config, i, j, 0);
					if (currentAnimPc.mainVal == 0 && prevAnimPc > 0) {
						ctx.stroke();
						ctx.strokeStyle = "rgba(0,0,0,0)";
						//          ctx.lineWidth =0.01;                                                                   
						ctx.lineTo(prevXpos, xAxisPosY - zeroY);
					}
					prevAnimPc = currentAnimPc.mainVal;
					if (currentAnimPc.mainVal >= 1) {
						if (typeof(data.datasets[i].title) == "string") lgtxt = data.datasets[i].title.trim();
						else lgtxt = "";
					}
					if (!(typeof(data.datasets[i].data[j]) == 'undefined')) {
						prevXpos = xPos(i, j, data);
						if (prevpt == -1) {
							ctx.moveTo(xposj, yPos(i, j));
							frstpt = j;
						} else {
							if (config.bezierCurve) {
								ctx.bezierCurveTo(xPos(i, j - (j - prevpt) / 2, data), yPos(i, prevpt), xPos(i, j - (j - prevpt) / 2, data), yPos(i, j), xPos(i, j, data), yPos(i, j));
							} else {
								ctx.lineTo(xPos(i, j, data), yPos(i, j));
							}
						}
						if ((typeof(data.datasets[i].data[j + 1]) !== 'undefined') || (true == config.extrapolateMissingData)) {
							if (currentAnimPc.subVal > 0) {
								// next not missing value
								nxtnotmiss = -1;
								for (t = j + 1; t < data.datasets[i].data["length"] && nxtnotmiss == -1; t++) {
									if (!(typeof(data.datasets[i].data[t]) == 'undefined')) nxtnotmiss = t;
								}
								if (nxtnotmiss != -1) {
									prevXpos = xPos(i, j + currentAnimPc.subVal, data);
									if (config.bezierCurve) {
										ctx.bezierCurveTo(xPos(i, j + currentAnimPc.subVal / 2, data), yPos(i, j), xPos(i, j + currentAnimPc.subVal / 2, data), yPos(i, nxtnotmiss), xPos(i, j + currentAnimPc.subVal, data), yPos(i, nxtnotmiss));
									} else {
										ctx.lineTo(xPos(i, j + currentAnimPc.subVal, data), yPos(i, j + 1));
									}
								}
							}
							prevpt = j;
							if (animPc >= 1) {
								if (i == 0) divprev = data.datasets[i].data[j];
								else divprev = data.datasets[i].data[j] - data.datasets[i - 1].data[j];
								if (i == data.datasets.length - 1) divnext = data.datasets[i].data[j];
								else divnext = data.datasets[i].data[j] - data.datasets[i + 1].data[j];
								lgtxt2 = "";
								if (typeof data.datasets[i].xPos != "undefined") {
									if (!(typeof data.datasets[i].xPos[j] == "undefined")) lgtxt2 = data.datasets[i].xPos[j];
								}
								if (lgtxt2 == "" && !(typeof(data.labels[j]) == "undefined")) lgtxt2 = data.labels[j];
								if (typeof lgtxt2 == "string") lgtxt2 = lgtxt2.trim();
								jsGraphAnnotate[ctx.ChartNewId][jsGraphAnnotate[ctx.ChartNewId].length] = ["POINT", xPos(i, j, data), yPos(i, j), lgtxt, lgtxt2, 1 * data.datasets[i].data[j], divprev, divnext, maxvalue[j], totvalue[j], i, j];
								if (config.inGraphDataShow) {
									ctx.save();
									ctx.textAlign = config.inGraphDataAlign;
									ctx.textBaseline = config.inGraphDataVAlign;
									ctx.font = config.inGraphDataFontStyle + ' ' + config.inGraphDataFontSize + 'px ' + config.inGraphDataFontFamily;
									ctx.fillStyle = config.inGraphDataFontColor;
									var dotX = yAxisPosX + (valueHop * k),
										dotY = xAxisPosY - currentAnimPc.mainVal * (calculateOffset(logarithmic, data.datasets[i].data[j], calculatedScale, scaleHop)),
										paddingTextX = config.inGraphDataPaddingX,
										paddingTextY = config.inGraphDataPaddingY;
									var dispString = tmplbis(config.inGraphDataTmpl, {
										config: config,
										v1: fmtChartJS(config, lgtxt, config.fmtV1),
										v2: fmtChartJS(config, lgtxt2, config.fmtV2),
										v3: fmtChartJS(config, 1 * data.datasets[i].data[j], config.fmtV3),
										v4: fmtChartJS(config, divprev, config.fmtV4),
										v5: fmtChartJS(config, divnext, config.fmtV5),
										v6: fmtChartJS(config, maxvalue[j], config.fmtV6),
										v7: fmtChartJS(config, totvalue[j], config.fmtV7),
										v8: roundToWithThousands(config, fmtChartJS(config, 100 * data.datasets[i].data[j] / totvalue[j], config.fmtV8), config.roundPct),
										v9: fmtChartJS(config, yAxisPosX + (valueHop * k), config.fmtV9),
										v10: fmtChartJS(config, xAxisPosY - (calculateOffset(logarithmic, data.datasets[i].data[j], calculatedScale, scaleHop)), config.fmtV10),
										v11: fmtChartJS(config, i, config.fmtV11),
										v12: fmtChartJS(config, j, config.fmtV12),
										data: data
									});
									ctx.translate(xPos(i, j, data) + paddingTextX, yPos(i, j) - paddingTextY);
									ctx.rotate(config.inGraphDataRotate * (Math.PI / 180));
									ctx.fillTextMultiLine(dispString, 0, 0, ctx.textBaseline, config.inGraphDataFontSize);
									ctx.restore();
								}
							}
						}
					} else {
						if (false == config.extrapolateMissingData) {
							ctx.stroke();
							if (config.datasetFill) {
								ctx.lineTo(prevXpos, xAxisPosY - zeroY);
								ctx.lineTo(xPos(i, frstpt, data), xAxisPosY - zeroY);
								ctx.lineTo(xPos(i, frstpt, data), yPos(i, frstpt));
								ctx.closePath();
								if (typeof data.datasets[i].fillColor == "function") ctx.fillStyle = data.datasets[i].fillColor("FILLCOLOR", data, config, i, -1, currentAnimPc.mainVal, -1, "Line", ctx, yAxisPosX, lmaxvalue[i], yAxisPosX + valueHop * (data.datasets[i].data.length - 1), lmaxvalue[i] - ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * (lmaxvalue[i] - lminvalue[i]));
								else if (typeof data.datasets[i].fillColor == "string") ctx.fillStyle = data.datasets[i].fillColor;
								else ctx.fillStyle = config.defaultFillColor;
								ctx.fill();
							}
							ctx.beginPath();
							prevpt = -1;
							frstpt = -1;
							prevAnimPc = 0;
							prevnotempty = 0;
						} else {
							if (currentAnimPc.subVal > 0) {
								nxtnotmiss = -1;
								for (t = j + 1; t < data.datasets[i].data["length"] && nxtnotmiss == -1; t++) {
									if (!(typeof(data.datasets[i].data[t]) == 'undefined')) nxtnotmiss = t;
								}
								if ((typeof(data.datasets[i].data[j]) !== 'undefined') || (true == config.extrapolateMissingData)) {
									if (nxtnotmiss != -1) {
										prevXpos = xPos(i, j + currentAnimPc.subVal, data);
										if (config.bezierCurve) {
											ctx.bezierCurveTo(xPos(i, prevpt + (j + currentAnimPc.subVal - prevpt) / 2, data), yPos(i, prevpt), xPos(i, prevpt + (j + currentAnimPc.subVal - prevpt) / 2, data), yPos(i, nxtnotmiss), xPos(i, j + currentAnimPc.subVal, data), yPos(i, nxtnotmiss));
										} else {
											ctx.lineTo(xPos(i, j + currentAnimPc.subVal, data), yPos(i, j + 1));
										}
									}
								}
							}
						}
					}
				}
				ctx.stroke();
				if (config.datasetFill) {
					//				ctx.lineTo(yAxisPosX + (valueHop * (data.datasets[i].data.length - 1)), xAxisPosY - zeroY);
					ctx.lineTo(prevXpos, xAxisPosY - zeroY);
					ctx.lineTo(xPos(i, frstpt, data), xAxisPosY - zeroY);
					ctx.lineTo(xPos(i, frstpt, data), yPos(i, frstpt));
					ctx.closePath();
					if (typeof data.datasets[i].fillColor == "function") { ctx.fillStyle = data.datasets[i].fillColor("FILLCOLOR", data, config, i, -1, currentAnimPc.mainVal, -1, "Line", ctx, yAxisPosX, lmaxvalue[i], yAxisPosX + valueHop * (data.datasets[i].data.length - 1), lmaxvalue[i] - ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * (lmaxvalue[i] - lminvalue[i])); }
					else if (typeof data.datasets[i].fillColor == "string") ctx.fillStyle = data.datasets[i].fillColor;
					else ctx.fillStyle = config.defaultFillColor;
					ctx.fill();
				} else {
					ctx.closePath();
				}
				if (config.pointDot) {
					if (typeof data.datasets[i].pointColor == "function") ctx.fillStyle = data.datasets[i].pointColor("POINTCOLOR", data, config, i, -1, animPc, -1, "Line", ctx, yAxisPosX, lmaxvalue[i], yAxisPosX + valueHop * (data.datasets[i].data.length - 1), lmaxvalue[i] - ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * (lmaxvalue[i] - lminvalue[i]));
					else ctx.fillStyle = data.datasets[i].pointColor;
					if (typeof data.datasets[i].pointStrokeColor == "function") ctx.strokeStyle = data.datasets[i].pointStrokeColor("POINTSTROKECOLOR", data, config, i, -1, animPc, -1, "Line", ctx, yAxisPosX, lmaxvalue[i], yAxisPosX + valueHop * (data.datasets[i].data.length - 1), lmaxvalue[i] - ((config.animationLeftToRight) ? 1 : 1*currentAnimPc.mainVal) * (lmaxvalue[i] - lminvalue[i]));
					else ctx.strokeStyle = data.datasets[i].pointStrokeColor;
					ctx.lineWidth = config.pointDotStrokeWidth;
					for (var k = 0; k < data.datasets[i].data.length; k++) {
						if (!(typeof(data.datasets[i].data[k]) == 'undefined')) {
							var currentAnimPc = animationCorrection(animPc, data, config, i, k, 0);
							if (currentAnimPc.mainVal > 0 || !config.animationLeftToRight) {
								ctx.beginPath();
								ctx.arc(xPos(i, k, data), yPos(i, k), config.pointDotRadius, 0, Math.PI * 2, true);
								ctx.fill();
								ctx.stroke();
							}
						}
					}
				}
			}
		};

		function yPos(dataSet, iteration) {
			return xAxisPosY - zeroY - currentAnimPc.mainVal * (calculateOffset(logarithmic, data.datasets[dataSet].data[iteration], calculatedScale, scaleHop) - zeroY);
		};

		function xPos(ival, iteration, data) {
			if (typeof data.datasets[ival].xPos == "object") {
				if (!(typeof data.datasets[ival].xPos[Math.floor(iteration + 0.0001)] == "undefined")) {
					var width = valueHop * nbValueHop;
					var deb = (typeof data.xBegin != "undefined") ? data.xBegin : 1 * data.labels[0];
					var fin = (typeof data.xEnd != "undefined") ? data.xEnd : 1 * data.labels[data.labels.length - 1];
					if (fin <= deb) fin = deb + 100;
					if (1 * data.datasets[ival].xPos[Math.floor(iteration + 0.0001)] >= deb && data.datasets[ival].xPos[Math.floor(iteration + 0.0001)] <= fin) {
						var p1 = yAxisPosX + width * ((1 * data.datasets[ival].xPos[Math.floor(iteration + 0.0001)] - deb) / (fin - deb));
						var p2 = p1;
						if (Math.abs(iteration - Math.floor(iteration + 0.0001)) > 0.0001) {
							var tt = iteration + Math.floor(iteration + 0.0001);
							var p2 = xPos(ival, Math.ceil(iteration - 0.0001), data);
						}
						return p1 + (iteration - Math.floor(iteration + 0.0001)) * (p2 - p1);
					}
				}
			}
			return yAxisPosX + (valueHop * iteration);
		};
	}
942718
private XYSeries addSeries(
      String seriesName, double[] xData, double[] yData, double[] errorBars, DataType dataType) {

    // Sanity checks
    sanityCheck(seriesName, xData, yData, errorBars);

    XYSeries series;
    if (xData != null) {

      // Sanity check
      if (xData.length != yData.length) {
        throw new IllegalArgumentException("X and Y-Axis sizes are not the same!!!");
      }

      series = new XYSeries(seriesName, xData, yData, errorBars, dataType);
    } else { // generate xData
      series =
          new XYSeries(
              seriesName, Utils.getGeneratedDataAsArray(yData.length), yData, errorBars, dataType);
    }

    seriesMap.put(seriesName, series);

    return series;
  }
735752
public void addSeries( String seriesName, double[] x, double[] y ) {
        XYSeries series = new XYSeries(seriesName);
        for( int i = 0; i < x.length; i++ ) {
            series.add(x[i], y[i]);
        }
        dataset.addSeries(series);
    }
391365
def plot(self):
        
        seaborn.pointplot(
            y = self.pointwise.pareto_k,
            x = self.pointwise.index,
            join = False)
1162045
function make_tree_axis(series) {
    let ylabels = series.map(s => s.name.split(","));
    let ytop = {name: null, depth: 0, categories: []};
    let maxdepth = ylabels[0].length;

    for (let i = 0; i < ylabels.length; ++i) {
        let ylabel = ylabels[i];
        let parent = ytop;

        for (let depth = 0; depth < ylabel.length; ++depth) {
            let label = ylabel[depth];
            if (depth === maxdepth - 1) {
                parent.categories.push(label);
            } else {
                let l = parent.categories.length;
                if (l > 0 && parent.categories[l - 1].name == label) {
                    parent = parent.categories[l - 1];
                } else {
                    let cat = {name: label, depth: depth + 1, categories: []};
                    parent.categories.push(cat);
                    parent = cat;
                }
            }
        }
    }
    return ytop;
}
411878
def plot_data(self, proj, ax):
        
        x, y = proj
        ax.scatter(self.ig.independent_data[x],
                   self.ig.dependent_data[y], c='b')
703655
def regressionplot(x, y, poly=None):
    
    if not isinstance(x[0], (float, int, np.float64, np.float32)):
        x = [row[0] for row in x]
    y_regression = poly[0] * np.array(x) + poly[-1]
    try:
        plt.ion()
        fig = plt.figure()
        ax = fig.add_subplot(111)
        plt.plot(x, y_regression, 'r-', x, y, 'o', markersize=5)
        plt.legend(['%+.2g * x + %.2g' % poly, 'Samples'])
        ax.grid(True)
        plt.draw()
    except:
        logger.warn('No display available')
    return y_regression
690784
def plot(self, xdata, ydata, side='left', title=None,
             xlabel=None, ylabel=None, y2label=None,
             use_dates=False, **kws):
        
        allaxes = self.fig.get_axes()
        if len(allaxes) > 1:
            for ax in allaxes[1:]:
                if ax in self.data_range:
                    self.data_range.pop(ax)
                self.fig.delaxes(ax)

        self.data_range = {}
        self.conf.zoom_lims = []
        self.conf.axes_traces = {}
        self.clear()
        axes = self.axes
        if side == 'right':
            axes = self.get_right_axes()
        self.conf.ntrace  = 0
        self.conf.yscale = 'linear'
        self.conf.user_limits[axes] = [None, None, None, None]

        if xlabel is not None:
            self.set_xlabel(xlabel, delay_draw=True)
        if ylabel is not None:
            self.set_ylabel(ylabel, delay_draw=True)
        if y2label is not None:
            self.set_y2label(y2label, delay_draw=True)
        if title is not None:
            self.set_title(title, delay_draw=True)
        if use_dates is not None:
            self.use_dates  = use_dates
        return self.oplot(xdata, ydata, side=side, **kws)
325027
def visualize(x, y, xlabel=None, ylabel=None, title=None, ylim=None):
    
    total_seconds = (x[-1] - x[0]).total_seconds()
    if total_seconds <= 86400 * 1 * 3:
        return plot_one_day(x, y, xlabel, ylabel, title, ylim)
    
    elif total_seconds <= 86400 * 7 * 2:
        return plot_one_week(x, y, xlabel, ylabel, title, ylim)
    
    elif total_seconds <= 86400 * 30 * 1.5:
        return plot_one_month(x, y, xlabel, ylabel, title, ylim)
    
    elif total_seconds <= 86400 * 90 * 1.5:
        return plot_one_quarter(x, y, xlabel, ylabel, title, ylim)
    
    elif total_seconds <= 86400 * 365 * 1.5:
        return plot_one_year(x, y, xlabel, ylabel, title, ylim)
854174
def plot(self,x,y,panel=None,**kws):
        
        if panel is None:
            panel = self.current_panel
        opts = {}
        opts.update(self.default_panelopts)
        opts.update(kws)
        self.panels[panel].plot(x ,y, **opts)
151226
def result(self):
        
        if self.subplots:
            if self.layout is not None and not is_list_like(self.ax):
                return self.axes.reshape(*self.layout)
            else:
                return self.axes
        else:
            sec_true = isinstance(self.secondary_y, bool) and self.secondary_y
            all_sec = (is_list_like(self.secondary_y) and
                       len(self.secondary_y) == self.nseries)
            if (sec_true or all_sec):
                # if all data is plotted on secondary, return right axes
                return self._get_ax_layer(self.axes[0], primary=False)
            else:
                return self.axes[0]
1188956
def _axes(self):
        """"""
        self.view._force_vertical = True
        super(HorizontalGraph, self)._axes()
        self.view._force_vertical = False
55043
def plot_time_series(x, y,
                     linewidth=1, linestyle="-",
                     xlabel=None, ylabel=None,
                     x_major_locattor=None, x_major_formatter=None,
                     x_minor_locattor=None, x_minor_formatter=None,
                     title=None, legend=None, cycol=None):
    
    x, y = preprocess_x_y(x, y)
    if cycol is None:
        cycol = cycle("brgcmyk")
    plt.close("all")
    figure, axis = create_figure()

    lines = list()
    for time, value in zip(x, y):
        lines.append(axis.plot(time, value,
                               lw=linewidth, ls=linestyle, c=next(cycol))[0])

    format_x_tick(axis,
                  x_major_locattor, x_major_formatter,
                  x_minor_locattor, x_minor_formatter,)

    y_min, y_max = get_yAxis_limit(
        np.array(y).flatten(),
        lower=0.05,
        upper=0.1 * len(x),
    )
    set_ylim(axis, y_min, y_max)

    set_title_xlabel_ylabel(axis, title, xlabel, ylabel)

    set_legend(axis, lines, legend)

    return plt
939616
def scatterplot(self, x, y, **kw):
        
        self.panel.scatterplot(x, y, **kw)
31838
def timeseries(X, **kwargs):
    """"""
    pl.figure(figsize=(2*rcParams['figure.figsize'][0], rcParams['figure.figsize'][1]),
              subplotpars=sppars(left=0.12, right=0.98, bottom=0.13))
    timeseries_subplot(X, **kwargs)