Add a series for a Category type chart using using double arrays with error bars

@param seriesName
@param xData the X-Axis data
@param xData the Y-Axis data
@param errorBars the error bar data
@return A Series object that you can set properties on
354808
public CategorySeries addSeries(
      String seriesName, double[] xData, double[] yData, double[] errorBars) {

    return addSeries(
        seriesName,
        Utils.getNumberListFromDoubleArray(xData),
        Utils.getNumberListFromDoubleArray(yData),
        Utils.getNumberListFromDoubleArray(errorBars));
  }
119735
def add_to_bar_plot(ax, x, number, name = '', color = '0.'):
    '''  '''
    plt.sca(ax)
    plt.setp(ax,xticks=np.append(ax.get_xticks(),np.array([x]))\
             ,xticklabels=[item.get_text() for item in ax.get_xticklabels()] +[name])
    plt.bar([x],number , color = color, width = 1.)
    return ax
61998
private void initData(final List<ChartData> DATA) {
        if (null == DATA || DATA.isEmpty()) {
            for (int i = 0; i < (getNoOfSectors() + 1); i++) { addData(new ChartData(0d)); }
        } else {
            setData(DATA);
        }
    }
30439
public static double xbarStd(TransposeDataCollection sampleDataCollection, int populationM, double Nbar) {
        return Math.sqrt(xbarVariance(sampleDataCollection, populationM, Nbar));
    }
312957
function (options) {
		var chart = this,
			optionsChart = chart.options.chart,
			type = options.type || optionsChart.type || optionsChart.defaultSeriesType,
			series,
			constr = seriesTypes[type];

		// No such series type
		if (!constr) {
			error(17, true);
		}

		series = new constr();
		series.init(this, options);
		return series;
	}
310909
public OHLCSeries addSeries(
      String seriesName, float[] openData, float[] highData, float[] lowData, float[] closeData) {

    return addSeries(seriesName, null, openData, highData, lowData, closeData);
  }
952882
public BubbleSeries addSeries(
      String seriesName,
      List<? extends Number> xData,
      List<? extends Number> yData,
      List<? extends Number> bubbleData) {

    return addSeries(
        seriesName,
        Utils.getDoubleArrayFromNumberList(xData),
        Utils.getDoubleArrayFromNumberList(yData),
        Utils.getDoubleArrayFromNumberList(bubbleData));
  }
17247
def _add_legend_or_colorbar(adata, ax, cax, categorical, value_to_plot, legend_loc,
                            scatter_array, legend_fontweight, legend_fontsize,
                            groups, multi_panel):
    
    # add legends or colorbars
    if categorical is True:
        # add legend to figure
        categories = list(adata.obs[value_to_plot].cat.categories)
        colors = adata.uns[value_to_plot + '_colors']

        if multi_panel is True:
            # Shrink current axis by 10% to fit legend and match
            # size of plots that are not categorical
            box = ax.get_position()
            ax.set_position([box.x0, box.y0, box.width * 0.91, box.height])

        if groups is not None:
            # only label groups with the respective color
            colors = [colors[categories.index(x)] for x in groups]
            categories = groups

        if legend_loc == 'right margin':
            for idx, label in enumerate(categories):
                color = colors[idx]
                # use empty scatter to set labels
                ax.scatter([], [], c=color, label=label)
            ax.legend(
                frameon=False, loc='center left',
                bbox_to_anchor=(1, 0.5),
                ncol=(1 if len(categories) <= 14
                      else 2 if len(categories) <= 30 else 3),
                fontsize=legend_fontsize)

        if legend_loc == 'on data':
            # identify centroids to put labels
            all_pos = np.zeros((len(categories), 2))
            for ilabel, label in enumerate(categories):
                _scatter = scatter_array[adata.obs[value_to_plot] == label, :]
                x_pos, y_pos = np.median(_scatter, axis=0)

                ax.text(x_pos, y_pos, label,
                        weight=legend_fontweight,
                        verticalalignment='center',
                        horizontalalignment='center',
                        fontsize=legend_fontsize)

                all_pos[ilabel] = [x_pos, y_pos]
            # this is temporary storage for access by other tools
            utils._tmp_cluster_pos = all_pos
    else:
        # add colorbar to figure
        pl.colorbar(cax, ax=ax, pad=0.01, fraction=0.08, aspect=30)
1035255
public PieSeries updatePieSeries(String seriesName, Number value) {

    Map<String, PieSeries> seriesMap = getSeriesMap();
    PieSeries series = seriesMap.get(seriesName);
    if (series == null) {
      throw new IllegalArgumentException("Series name >" + seriesName + "< not found!!!");
    }
    series.replaceData(value);

    return series;
  }
1274788
public void replaceData(
      List<?> newXData, List<? extends Number> newYData, List<? extends Number> newExtraValues) {

    // Sanity check
    if (newExtraValues != null && newExtraValues.size() != newYData.size()) {
      throw new IllegalArgumentException("error bars and Y-Axis sizes are not the same!!!");
    }
    if (newXData.size() != newYData.size()) {
      throw new IllegalArgumentException("X and Y-Axis sizes are not the same!!!");
    }

    xData = newXData;
    yData = newYData;
    extraValues = newExtraValues;
    calculateMinMax();
  }
1240140
public XYSeries getSeries( String seriesName ) {
        XYSeries series = new XYSeries(seriesName);
        dataset.addSeries(series);
        return series;
    }
817004
function () {
		var axis = this,
			chart = this.chart,
			legendItems = this.legendItems,
			legendOptions = chart.options.legend,
			valueDecimals = legendOptions.valueDecimals,
			valueSuffix = legendOptions.valueSuffix || '',
			name;

		if (!legendItems.length) {
			each(this.dataClasses, function (dataClass, i) {
				var vis = true,
					from = dataClass.from,
					to = dataClass.to;
				
				// Assemble the default name. This can be overridden by legend.options.labelFormatter
				name = '';
				if (from === UNDEFINED) {
					name = '< ';
				} else if (to === UNDEFINED) {
					name = '> ';
				}
				if (from !== UNDEFINED) {
					name += Highcharts.numberFormat(from, valueDecimals) + valueSuffix;
				}
				if (from !== UNDEFINED && to !== UNDEFINED) {
					name += ' - ';
				}
				if (to !== UNDEFINED) {
					name += Highcharts.numberFormat(to, valueDecimals) + valueSuffix;
				}
				
				// Add a mock object to the legend items
				legendItems.push(extend({
					chart: chart,
					name: name,
					options: {},
					drawLegendSymbol: LegendSymbolMixin.drawRectangle,
					visible: true,
					setState: noop,
					setVisible: function () {
						vis = this.visible = !vis;
						each(axis.series, function (series) {
							each(series.points, function (point) {
								if (point.dataClass === i) {
									point.setVisible(vis);
								}
							});
						});
						
						chart.legend.colorizeItem(this, vis);
					}
				}, dataClass));
			});
		}
		return legendItems;
	}
1151061
public CategorySeries addSeries(
      String seriesName,
      List<?> xData,
      List<? extends Number> yData,
      List<? extends Number> errorBars) {

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

    CategorySeries series;
    if (xData != null) {

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

      series = new CategorySeries(seriesName, xData, yData, errorBars, getDataType(xData));
    } else { // generate xData
      xData = Utils.getGeneratedDataAsList(yData.size());
      series = new CategorySeries(seriesName, xData, yData, errorBars, getDataType(xData));
    }

    seriesMap.put(seriesName, series);

    return series;
  }
735417
private function addSeriesData($returnValues)
    {
        foreach ($this->getSeries() as $serieName => $serieValues) {
            $returnValues['series'][] = array(
                'name' => (isset($serieValues['name']) && $serieValues['name']) ? $serieValues['name'] : $serieName,
                'data' => (isset($serieValues['data']) && $serieValues['data']) ? $serieValues['data'] : $serieValues,
                'type' => (isset($serieValues['type']) && $serieValues['type']) ? $serieValues['type'] : 'line',
            );
        }

        return $returnValues;
    }
1244252
def addRasterPoints(self, xdata, repnum, plotname=None):
        
        if plotname is None:
            plotname = self.responsePlots.keys()[0]
        ydata = np.ones_like(xdata)*repnum
        self.responsePlots[plotname].appendData('raster', xdata, ydata)
435261
public OHLCSeries addSeries(
      String seriesName,
      List<? extends Number> openData,
      List<? extends Number> highData,
      List<? extends Number> lowData,
      List<? extends Number> closeData) {

    return addSeries(seriesName, null, openData, highData, lowData, closeData);
  }
888469
def add_series(params)
      # Check that the required input has been specified.
      unless params.has_key?(:values)
        raise "Must specify ':values' in add_series"
      end

      if @requires_category != 0 && !params.has_key?(:categories)
        raise  "Must specify ':categories' in add_series for this chart type"
      end

      @series << Series.new(self, params)

      # Set the secondary axis properties.
      x2_axis = params[:x2_axis]
      y2_axis = params[:y2_axis]

      # Store secondary status for combined charts.
      if ptrue?(x2_axis) || ptrue?(y2_axis)
        @is_secondary = true
      end

      # Set the gap and overlap for Bar/Column charts.
      if params[:gap]
        if ptrue?(y2_axis)
          @series_gap_2 = params[:gap]
        else
          @series_gap_1 = params[:gap]
        end
      end

      # Set the overlap for Bar/Column charts.
      if params[:overlap]
        if ptrue?(y2_axis)
          @series_overlap_2 = params[:overlap]
        else
          @series_overlap_1 = params[:overlap]
        end
      end
    end