Redraw the Vispy canvas
770625
def redraw(self):
        
        if self._multiscat is not None:
            self._multiscat._update()
        self.vispy_widget.canvas.update()
1139819
def replace_canvas!(new_width, new_height, new_pixels)
      unless new_pixels.length == new_width * new_height
        raise ArgumentError, "The provided pixel array should have #{new_width * new_height} items"
      end
      @width, @height, @pixels = new_width, new_height, new_pixels
      self
    end
739649
def render_image(self, rgbobj, dst_x, dst_y):
        
        self.logger.debug("redraw surface=%s" % (self.surface))
        if self.surface is None:
            return
        self.logger.debug("drawing to surface")

        # Prepare array for rendering
        # TODO: what are options for high bit depth under Qt?
        data = rgbobj.get_array(self.rgb_order, dtype=np.uint8)
        (height, width) = data.shape[:2]

        daht, dawd, depth = data.shape
        self.logger.debug("data shape is %dx%dx%d" % (dawd, daht, depth))

        # Get qimage for copying pixel data
        qimage = self._get_qimage(data)
        drawable = self.surface

        painter = QPainter(drawable)
        #painter.setWorldMatrixEnabled(True)

        # fill surface with background color
        #imgwin_wd, imgwin_ht = self.viewer.get_window_size()
        size = drawable.size()
        sf_wd, sf_ht = size.width(), size.height()
        bg = self.viewer.img_bg
        bgclr = self._get_color(*bg)
        painter.fillRect(QtCore.QRect(0, 0, sf_wd, sf_ht), bgclr)

        # draw image data from buffer to offscreen pixmap
        painter.drawImage(QtCore.QRect(dst_x, dst_y, width, height),
                          qimage,
                          QtCore.QRect(0, 0, width, height))
190935
function (bounds, position, redraw) {
        if (redraw == null) {
            redraw = true;
        }

        this.setBounds(bounds);
        this.position = position.clone();
        if (redraw) {
            this.draw();
        }
    }
374404
function reshape(gl, width, height)
{
   var h = height / width;
   gl.Viewport(0, 0, width, height);
   gl.MatrixMode(gl.PROJECTION);
   gl.LoadIdentity();
   gl.Frustum(-1.0, 1.0, -h, h, 5.0, 60.0);
   gl.MatrixMode(gl.MODELVIEW);
   gl.LoadIdentity();
   gl.Translatef(0.0, 0.0, -40.0);
   gl.Scalef(0.1, 0.1, 0.1);
   gl.render();
}
890443
function recolorImageWithCanvasContext(context, img, colorFunc) {
  if (!defined(context)) {
    throw new DeveloperError("No context for image recoloring.");
  }

  // Copy the image contents to the canvas
  context.clearRect(0, 0, context.canvas.width, context.canvas.height);
  context.drawImage(img, 0, 0);
  var image = context.getImageData(
    0,
    0,
    context.canvas.width,
    context.canvas.height
  );
  image = ImageryProviderHooks.recolorImage(image, colorFunc);
  return image;
}
450754
function resize() {
    var w = $(window).width(), h = $(window).height();
    canvas.attr({ width: w, height: h });
    scene.getCamera().setAspect(w / h);
    renderer.clearViewport();
  }
864358
function (data, redraw) {
		var series = this,
			oldData = series.data,
			initialColor = series.initialColor,
			chart = series.chart,
			i = (oldData && oldData.length) || 0;

		series.xIncrement = null; // reset for new data
		if (defined(initialColor)) { // reset colors for pie
			chart.counters.color = initialColor;
		}

		data = map(splat(data || []), function (pointOptions) {
			return (new series.pointClass()).init(series, pointOptions);
		});

		// destroy old points
		while (i--) {
			oldData[i].destroy();
		}

		// set the data
		series.data = data;

		series.cleanData();
		series.getSegments();


		// cache attributes for shapes
		series.getAttribs();

		// redraw
		series.isDirty = true;
		chart.isDirtyBox = true;
		if (pick(redraw, true)) {
			chart.redraw(false);
		}
	}
788175
def redraw_map(self):
        ''''''
        state = self.state

        view_same = (self.last_view and self.map_img and self.last_view == self.current_view())

        if view_same and not state.need_redraw:
            return

        # get the new map
        self.map_img = state.mt.area_to_image(state.lat, state.lon,
                                              state.width, state.height, state.ground_width)
        if state.brightness != 1.0:
            cv.ConvertScale(self.map_img, self.map_img, scale=state.brightness)


        # find display bounding box
        (lat2,lon2) = self.coordinates(state.width-1, state.height-1)
        bounds = (lat2, state.lon, state.lat-lat2, lon2-state.lon)

        # get the image
        img = cv.CloneImage(self.map_img)

        # possibly draw a grid
        if state.grid:
            SlipGrid('grid', layer=3, linewidth=1, colour=(255,255,0)).draw(img, self.pixmapper, bounds)

        # draw layer objects
        keys = state.layers.keys()
        keys.sort()
        for k in keys:
            self.draw_objects(state.layers[k], bounds, img)

        # draw information objects
        for key in state.info:
            state.info[key].draw(state.panel, state.panel.information)

        # display the image
        self.img = wx.EmptyImage(state.width,state.height)
        self.img.SetData(img.tostring())
        self.imagePanel.set_image(self.img)

        self.update_position()

        self.mainSizer.Fit(self)
        self.Refresh()
        self.last_view = self.current_view()
        self.SetFocus()
        state.need_redraw = False
615349
def redraw_data(self, whence=0):
        
        if not self._imgwin_set:
            # window has not been realized yet
            return

        if not self._self_scaling:
            rgbobj = self.get_rgb_object(whence=whence)
            self.renderer.render_image(rgbobj, self._dst_x, self._dst_y)

        self.private_canvas.draw(self)

        self.make_callback('redraw', whence)

        if whence < 2:
            self.check_cursor_location()
1312683
function postDraw(renderer) {
         if (typeof this.mask !== "undefined") {
           renderer.clearMask();
         }

         if (typeof this.tint !== "undefined") {
           renderer.clearTint();
         } // restore the context


         renderer.restore();
       }
868531
private void paintRestoreHover(Graphics2D g, JComponent c, int width, int height) {
        restorePainter.paintHover(g, c, width, height);
    }
370577
function redraw(animation) {
		var redrawLegend = chart.isDirtyLegend,
			hasStackedSeries,
			isDirtyBox = chart.isDirtyBox, // todo: check if it has actually changed?
			seriesLength = series.length,
			i = seriesLength,
			clipRect = chart.clipRect,
			serie;

		setAnimation(animation, chart);

		// link stacked series
		while (i--) {
			serie = series[i];
			if (serie.isDirty && serie.options.stacking) {
				hasStackedSeries = true;
				break;
			}
		}
		if (hasStackedSeries) { // mark others as dirty
			i = seriesLength;
			while (i--) {
				serie = series[i];
				if (serie.options.stacking) {
					serie.isDirty = true;
				}
			}
		}

		// handle updated data in the series
		each(series, function (serie) {
			if (serie.isDirty) { // prepare the data so axis can read it
				serie.cleanData();
				serie.getSegments();

				if (serie.options.legendType === 'point') {
					redrawLegend = true;
				}
			}
		});

		// handle added or removed series
		if (redrawLegend && legend.renderLegend) { // series or pie points are added or removed
			// draw legend graphics
			legend.renderLegend();

			chart.isDirtyLegend = false;
		}

		if (hasCartesianSeries) {
			if (!isResizing) {

				// reset maxTicks
				maxTicks = null;

				// set axes scales
				each(axes, function (axis) {
					axis.setScale();
				});
			}
			adjustTickAmounts();
			getMargins();

			// redraw axes
			each(axes, function (axis) {
				if (axis.isDirty || isDirtyBox) {
					axis.redraw();
					isDirtyBox = true; // always redraw box to reflect changes in the axis labels
				}
			});


		}

		// the plot areas size has changed
		if (isDirtyBox) {
			drawChartBox();
			placeTrackerGroup();

			// move clip rect
			if (clipRect) {
				stop(clipRect);
				clipRect.animate({ // for chart resize
					width: chart.plotSizeX,
					height: chart.plotSizeY
				});
			}

		}


		// redraw affected series
		each(series, function (serie) {
			if (serie.isDirty && serie.visible &&
					(!serie.isCartesian || serie.xAxis)) { // issue #153
				serie.redraw();
			}
		});


		// hide tooltip and hover states
		if (tracker && tracker.resetTracker) {
			tracker.resetTracker();
		}

		// fire the event
		fireEvent(chart, 'redraw');
	}
553638
def redraw_tiles(self, surface):
        
        # TODO/BUG: Redraw animated tiles correctly.  They are getting reset here
        logger.warning('pyscroll buffer redraw')
        self._clear_surface(self._buffer)
        self._tile_queue = self.data.get_tile_images_by_rect(self._tile_view)
        self._flush_tile_queue(surface)
782643
def _repaint(self, drawing_context: DrawingContext.DrawingContext):
        """"""

        # canvas size
        canvas_width = self.canvas_size.width
        canvas_height = self.canvas_size.height

        with drawing_context.saver():
            if self.__color_map_data is not None:
                rgba_image = numpy.empty((4,) + self.__color_map_data.shape[:-1], dtype=numpy.uint32)
                Image.get_rgb_view(rgba_image)[:] = self.__color_map_data[numpy.newaxis, :, :]  # scalar data assigned to each component of rgb view
                Image.get_alpha_view(rgba_image)[:] = 255
                drawing_context.draw_image(rgba_image, 0, 0, canvas_width, canvas_height)
358729
def delayed_redraw(self):
        """"""

        # This is the optimized redraw method
        with self._defer_lock:
            # pick up the lowest necessary level of redrawing
            whence = self._defer_whence
            self._defer_whence = self._defer_whence_reset
            flag = self._defer_flag
            self._defer_flag = False

        if flag:
            # If a redraw was scheduled, do it now
            self.redraw_now(whence=whence)
651251
def draw_patch(data, obj):
    
    # Gather the draw options.
    data, draw_options = mypath.get_draw_options(
        data,
        obj,
        obj.get_edgecolor(),
        obj.get_facecolor(),
        obj.get_linestyle(),
        obj.get_linewidth(),
    )

    if isinstance(obj, mpl.patches.Rectangle):
        # rectangle specialization
        return _draw_rectangle(data, obj, draw_options)
    elif isinstance(obj, mpl.patches.Ellipse):
        # ellipse specialization
        return _draw_ellipse(data, obj, draw_options)

    # regular patch
    data, path_command, _, _ = mypath.draw_path(
        data, obj.get_path(), draw_options=draw_options
    )
    return data, path_command