Adds a 2D grid plot to the canvas.
@param data an m x n x 2 array which are coordinates of m x n grid.
353351
public Grid grid(double[][][] data) {
        if (base.dimension != 2) {
            throw new IllegalArgumentException("Grid can be only painted in a 2D canvas. Try surface() for 3D grid.");
        }

        Grid grid = new Grid(data);
        add(grid);
        return grid;
    }
1134939
public void setData (Object[] data)
    {
        _data.clear();
        Collections.addAll(_data, data);
        _model.fireTableDataChanged();
    }
466623
public void add(final D data)
	{
		this.container.add(data);

		// if the size of data is known add the value to the task size
		if (data instanceof ISizeable) {
			this.byteSize += ((ISizeable) data).byteSize();
		}
	}
156964
private void addVertex(String data)
	{
		String coords[] = data.split("\\s+");
		float x = 0;
		float y = 0;
		float z = 0;
		if (coords.length != 3)
		{
			MalisisCore.log.error("[ObjFileImporter] Wrong coordinates number {} at line {} : {}", coords.length, lineNumber, currentLine);
		}
		else
		{
			x = Float.parseFloat(coords[0]);
			y = Float.parseFloat(coords[1]);
			z = Float.parseFloat(coords[2]);
		}

		vertexes.add(new Vertex(x, y, z));
	}
283352
public INDArray project(INDArray data){
        long[] tShape = targetShape(data.shape(), eps, components, autoMode);
        return data.mmul(getProjectionMatrix(tShape, this.rng));
    }
298397
protected PlotCanvas paintOnCanvas(double[][] data, int[] label) {
        PlotCanvas canvas = ScatterPlot.plot(data, pointLegend);
        for (int i = 0; i < data.length; i++) {
            canvas.point(pointLegend, Palette.COLORS[label[i]], data[i]);
        }
        return canvas;
    }
116633
public void replaceData(Map<String, String> data) {

        removeClickListener(m_clickListener);
        m_clickListener = getClickListener(getHtmlLines(data), m_additionalElements);
        addClickListener(m_clickListener);

    }
31524
@Override
    public void fit(INDArray data, INDArray labels) {
        fit(data, labels, null, null);
    }
196684
public void setWrappedData(Object data) {
        if (data == null) {
            inner = null;
            arrayFromInner = null;
            setRowIndex(-1);
        } else {
            inner = (Collection<E>) data;            
            arrayFromInner = (E[]) new Object[inner.size()];
            inner.toArray(arrayFromInner);
            setRowIndex(0);
        }
    }
111593
public void addAll(ExampleSet data)
	{
		for (int i=0;i<data.size();i++)
			add(data.x(i), data.y(i), data.id(i));

	}
221071
def plot(x, y, rows=None, columns=None):
    
    if not rows or not columns:
        rows, columns = get_terminal_size()
    # offset for caption
    rows -= 4

    # Scale points such that they fit on canvas
    x_scaled = scale(x, columns)
    y_scaled = scale(y, rows)

    # Create empty canvas
    canvas = [[' ' for _ in range(columns)] for _ in range(rows)]

    # Add scaled points to canvas
    for ix, iy in zip(x_scaled, y_scaled):
        canvas[rows - iy - 1][ix] = '*'

    # Print rows of canvas
    for row in [''.join(row) for row in canvas]:
        print(row)

    # Print scale
    print(''.join([
        '\nMin x: ', str(min(x)),
        ' Max x: ',  str(max(x)),
        ' Min y: ',  str(min(y)),
        ' Max y: ',  str(max(y))
    ]))
1157215
public void handleData(String data) {
		value = Double.valueOf(data);
		sendEvent(new SlideEvent(this.user, getPayload(), value));
		if (handler != null)
			handler.slide(value);
	}
155471
def draw_grid(self):
        """"""
        self.screen.fill((0xbb, 0xad, 0xa0), self.origin + (self.game_width, self.game_height))
        for y, row in enumerate(self.grid):
            for x, cell in enumerate(row):
                self.screen.blit(self.tiles[cell], self.get_tile_location(x, y))
948803
def grid_2d_8graph(self, m, n):
        """"""
        me = nx.Graph()
        node = me.node
        add_node = me.add_node
        add_edge = me.add_edge
        for i in range(m):
            for j in range(n):
                add_node((i, j))
                if i > 0:
                    add_edge((i, j), (i-1, j))
                    if j > 0:
                        add_edge((i, j), (i-1, j-1))
                if j > 0:
                    add_edge((i, j), (i, j-1))
                if (i - 1, j + 1) in node:
                    add_edge((i, j), (i-1, j+1))
        return self.copy_from(me)
1214328
private void add(Iterable<?> data) {

    for (Object el : data) {
      try {
        add(SoyData.createFromExistingData(el));

      } catch (SoyDataException sde) {
        sde.prependIndexToDataPath(list.size());
        throw sde;
      }
    }
  }
1126383
@Override
  public void add(Object data, Class<?>... typeSpecs) {
    //    if (data == null) return;
    //
    //    typeSpecs = determineTypeSpecs(data, typeSpecs);
    //    if (this.getDefaultDataType() == null) this.setDefaultDataType(typeSpecs);
    //
    //    mReps.put(this.getSpecsAsString(typeSpecs), data);
    Representation representation = new Representation(data, typeSpecs);
    mReps.put(representation.getTypeSpecsString(), representation);
  }
1158024
public void add(DATA data) {
		if(root == null) {
			root = new RootLeafNode(data);
			try {
				root.addData(data, 0);
			} catch (SplitNodeReplacement e) {
				throw new RuntimeException("Should never happen!");
			}
		} else {
			double distance = distanceFunction.calculate(data, root.data);
			try {
				root.addData(data, distance);
			} catch(SplitNodeReplacement e) {
				Node newRoot = new RootNode(data);
				root = newRoot;
				for(int i = 0; i < e.newNodes.length; i++) {
					@SuppressWarnings("unchecked")
					Node newNode = (Node) e.newNodes[i];
					distance = distanceFunction.calculate(root.data, newNode.data);
					root.addChild(newNode, distance);
				}
			}
		}
	}