Important: The plotGate methods are now defunct and gates should instead be plotted using the autoplot method from the ggcyto package. The plotGate documentation has been left here to ease the transition.

When applied to a GatingHierarchy,arrange is set as TRUE, then all the gates associated with it are plotted as different panel on the same page. If arrange is FALSE, then it plots one gate at a time. By default ,merge is set as TRUE, plot multiple gates on the same plot when they share common parent population and axis. When applied to a GatingSet, if lattice is TRUE,it plots one gate (multiple samples) per page , otherwise, one sample (with multiple gates) per page.

plotGate(x, y, ...)



GatingSet or GatingHierarchyobject


character the node name or full(/partial) gating path or numeric representing the node index in the GatingHierarchy. or missing which will plot all gates and one gate per page. It is useful for generating plots in a multi-page pdf. Nodes can be accessed with gs_get_pop_paths.

  • bool logical specifying whether to plot boolean gates.

  • arrange.main character The title of the main page of the plot. Default is the sample name. Only valid when x is GatingHierarchy

  • arrange logical indicating whether to arrange different populations/nodes on the same page via arrangeGrob call.

  • merge logical indicating whether to draw multiple gates on the same plot if these gates share the same parent population and same x,y dimensions/parameters;

  • projections list of character vectors used to customize x,y axis. By default, the x,y axis are determined by the respective gate parameters. The elements of the list are named by the population name or path (see y). Each element is a pair of named character specifying the channel name(or marker name) for x, y axis. Short form of channel or marker names (e.g. "APC" or "CD3") can be used as long as they can be uniquely matched to the dimentions of flow data. For example, projections = list("lymph" = c(x = "SSC-A", y = "FSC-A"), "CD3" = c(x = "CD3", y = "SSC-A"))

  • par.settings list of graphical parameters passed to lattice;

  • gpar list of grid parameters passed to grid.layout;

  • lattice logical deprecated;

  • formula formula a formula passed to xyplot function of flowViz, by default it is NULL, which means the formula is generated according to the x,y parameters associated with gate.

  • cond character the conditioning variable to be passed to lattice plot.

  • overlayNode names. These populations are plotted on top of the existing gates(defined by y argument) as the overlaid dots.

  • overlay.symbolA named (lattice graphic parameter) list that defines the symbol color and size for each overlaid population. If not given, we automatically assign the colors.

  • keyLattice legend paraemter for overlay symbols.

  • default.y character specifiying y channel for xyplot when plotting a 1d gate. Default is "SSC-A" and session-wise setting can be stored by 'flowWorkspace.par.set("plotGate", list(default.y = "FSC-A"))'

  • type character either "xyplot" or "densityplot". Default is "xyplot" and session-wise setting can be stored by 'flowWorkspace.par.set("plotGate", list(type = "xyplot"))'

  • fitGate used to disable behavior of plotting the gate region in 1d densityplot. Default is FALSE and session-wise setting can be stored by 'flowWorkspace.par.set("plotGate", list(fitGate = FALSE))'

  • strip ligcal specifies whether to show pop name in strip box,only valid when x is GatingHierarchy

  • strip.texteither "parent" (the parent population name) or "gate "(the gate name).

  • raw.scale logical whether to show the axis in raw(untransformed) scale. Default is TRUE and can be stored as session-wise setting by 'flowWorkspace.par.set("plotGate", list(raw.scale = TRUE))'

  • xlim, ylim character can be either "instrument" or "data" which determines the x, y axis scale either by instrument measurement range or the actual data range. or numeric which specifies customized range. They can be stored as session-wise setting by 'flowWorkspace.par.set("plotGate", list(xlim = "instrument"))'

  • ... path A character or numeric scalar passed to gs_get_pop_paths method (used to control how the gating/node path is displayed) ... The other additional arguments to be passed to xyplot.


a trellis object if arrange is FALSE,



if (FALSE) { #G is a GatingHierarchy plotGate(G,gs_get_pop_paths(G)[5]);#plot the gate for the fifth node }