FlowCytometryTools.FCPlate.plot

FCPlate.plot(channel_names, kind='histogram', gates=None, gate_colors=None, ids=None, row_labels=None, col_labels=None, xlim='auto', ylim='auto', autolabel=True, **kwargs)[source]

Produces a grid plot with each subplot corresponding to the data at the given position.

Parameters:
  • gates ([None | Gate | iterable of Gate]) – Gate should be in [ThresholdGate | IntervalGate | QuadGate | PolyGate | CompositeGate]
  • . – When supplied, the gates are drawn on the plot. The gates are applied by default.
  • channel_names ([str | iterable of str]) – The name (or names) of the channels to plot. When one channel is specified, then a 1d histogram is plotted.
  • kind ([‘scatter’ | ‘histogram’]) – Specifies the kind of plot to use for plotting the data (only applies to 2D plots).
  • autolabel ([False | True]) – If True the x and y axes are labeled automatically.
  • colorbar ([False | True]) – Adds a colorbar. Only relevant when plotting a 2d histogram.
  • xlabel_kwargs (dict) – kwargs to be passed to the xlabel() command
  • ylabel_kwargs (dict) – kwargs to be passed to the ylabel() command
  • bins (int | ndarray | [ndarray]) –

    specifies how to bin histograms.

    • int : number of bins (autopilot!)
    • ndarray : for 1d histograms, e.g., linspace(-1000, 10000, 100)
    • [ndarray] : for 2d histograms, e.g., [linspace(-1000, 10000, 100), linspace(-1000, 10000, 100)]

    CAUTION when bins=int, the bin locations are determined automatically based on the data. This means that the bins can have different widths, depending on the range of the data. When plotting using FCCollection (FCPlate), the bin locations are set according to minimum and maximum values of data from across all the FCMeasurements. If this is confusing for you, just specify the bin locations explicitely.

  • xlim (None | 2-tuple) – If None automatic, otherwise specifies the xmin and xmax for the plot
  • ylim (None | 2-tuple) – If None automatic, otherwise specifies the ymin and ymax for the plot
  • row_label_xoffset (float) – Additional offset for the row labels in the x direction.
  • col_label_yoffset (float) – Additional offset for the col labels in the y direction.
  • hide_tick_labels (True | False) – Hides the tick mark labels.
  • hide_tick_lines (True | False) – Hides the tick marks.
  • hspace (float) – Horizontal space between subplots.
  • wspace (float) – Vertical space between subplots.
  • row_labels_kwargs (dict) – This dict is unpacked into the pylab.text function that draws the row labels.
  • col_labels_kwargs (dict) – This dict is unpacked into the pylab.text function that draws the column labels.
Returns:

ax_main : reference to the main axes ax_subplots : matrix of references to the subplots (e.g., ax_subplots[0, 3] references the subplot in row 0 and column 3.)

Return type:

(ax_main, ax_subplots)

Examples

Below, plate is an instance of FCOrderedCollection

>>> plate.plot(['SSC-A', 'FSC-A'], kind='histogram', autolabel=True)
>>> plate.plot(['SSC-A', 'FSC-A'], xlim=(0, 10000))
>>> plate.plot(['B1-A', 'Y2-A'], kind='scatter', color='red', s=1, alpha=0.3)
>>> plate.plot(['B1-A', 'Y2-A'], bins=100, alpha=0.3)
>>> plate.plot(['B1-A', 'Y2-A'], bins=[linspace(-1000, 10000, 100), linspace(-1000, 10000, 100)], alpha=0.3)

Note

For more details see documentation for FCMeasurement.plot **kwargs passes arguments to both grid_plot and to FCMeasurement.plot.