qcodes/dataset/plotting.py
def plot_2d_scatterplot(x: np.ndarray, y: np.ndarray, z: np.ndarray,
                        ax: matplotlib.axes.Axes,
                        colorbar: matplotlib.colorbar.Colorbar = None,
                        **kwargs: Any) -> AxesTuple:
    """
    Make a 2D scatterplot of the data. ``**kwargs`` are passed to matplotlib's
    scatter used for the plotting. By default the data will be rasterized
    in any vector plot if more than 5000 points are supplied. This can be
    overridden by supplying the `rasterized` kwarg.

    Args:
        x: The x values
        y: The y values
        z: The z values
        ax: The axis to plot onto
        colorbar: The colorbar to plot into

    Returns:
        The matplotlib axis handles for plot and colorbar
    """
    if 'rasterized' in kwargs.keys():
        rasterized = kwargs.pop('rasterized')
    else:
        rasterized = len(z) > qc.config.plotting.rasterize_threshold

    z_is_stringy = isinstance(z[0], str)

    if z_is_stringy:
        z_strings = np.unique(z)
        z = _strings_as_ints(z)

    cmap = kwargs.pop('cmap') if 'cmap' in kwargs else None

    if z_is_stringy:
        name = cmap.name if hasattr(cmap, 'name') else 'viridis'
        cmap = matplotlib.cm.get_cmap(name, len(z_strings))

    mappable = ax.scatter(x=x, y=y, c=z,
                          rasterized=rasterized, cmap=cmap, **kwargs)

    if colorbar is not None:
        colorbar = ax.figure.colorbar(mappable, ax=ax, cax=colorbar.ax)
    else:
        colorbar = ax.figure.colorbar(mappable, ax=ax)

    if z_is_stringy:
        N = len(z_strings)
        f = (N-1)/N
        colorbar.set_ticks([(n+0.5)*f for n in range(N)])
        colorbar.set_ticklabels(z_strings)

    return ax, colorbar

    Make a 2D scatterplot of the data. ``**kwargs`` are passed to matplotlib's
    scatter used for the plotting. By default the data will be rasterized
    in any vector plot if more than 5000 points are supplied. This can be
    overridden by supplying the `rasterized` kwarg.

    Args:
        x: The x values
        y: The y values
        z: The z values
        ax: The axis to plot onto
        colorbar: The colorbar to plot into

    Returns:
        The matplotlib axis handles for plot and colorbar
    
Make a 2D scatterplot of the data. ``**kwargs`` are passed to matplotlib's
scatter used for the plotting. By default the data will be rasterized
in any vector plot if more than 5000 points are supplied. This can be
overridden by supplying the `rasterized` kwarg.
Make a 2D scatterplot of the data . ` ` ** kwargs ` ` are passed to matplotlib ' s scatter used for the plotting . By default the data will be rasterized in any vector plot if more than 5000 points are supplied . This can be overridden by supplying the ` rasterized ` kwarg .
def plot_2d_scatterplot(x: np.ndarray, y: np.ndarray, z: np.ndarray,
                        ax: matplotlib.axes.Axes,
                        colorbar: matplotlib.colorbar.Colorbar = None,
                        **kwargs: Any) -> AxesTuple:
    if 'rasterized' in kwargs.keys():
        rasterized = kwargs.pop('rasterized')
    else:
        rasterized = len(z) > qc.config.plotting.rasterize_threshold
    z_is_stringy = isinstance(z[0], str)
    if z_is_stringy:
        z_strings = np.unique(z)
        z = _strings_as_ints(z)
    cmap = kwargs.pop('cmap') if 'cmap' in kwargs else None
    if z_is_stringy:
        name = cmap.name if hasattr(cmap, 'name') else 'viridis'
        cmap = matplotlib.cm.get_cmap(name, len(z_strings))
    mappable = ax.scatter(x=x, y=y, c=z,
                          rasterized=rasterized, cmap=cmap, **kwargs)
    if colorbar is not None:
        colorbar = ax.figure.colorbar(mappable, ax=ax, cax=colorbar.ax)
    else:
        colorbar = ax.figure.colorbar(mappable, ax=ax)
    if z_is_stringy:
        N = len(z_strings)
        f = (N-1)/N
        colorbar.set_ticks([(n+0.5)*f for n in range(N)])
        colorbar.set_ticklabels(z_strings)
    return ax, colorbar
def plot_2d_scatterplot ( x : np . ndarray , y : np . ndarray , z : np . ndarray , ax : matplotlib . axes . Axes , colorbar : matplotlib . colorbar . Colorbar = None , ** kwargs : Any ) -> AxesTuple : if 'rasterized' in kwargs . keys ( ) : rasterized = kwargs . pop ( 'rasterized' ) else : rasterized = len ( z ) > qc . config . plotting . rasterize_threshold z_is_stringy = isinstance ( z [ 0 ] , str ) if z_is_stringy : z_strings = np . unique ( z ) z = _strings_as_ints ( z ) cmap = kwargs . pop ( 'cmap' ) if 'cmap' in kwargs else None if z_is_stringy : name = cmap . name if hasattr ( cmap , 'name' ) else 'viridis' cmap = matplotlib . cm . get_cmap ( name , len ( z_strings ) ) mappable = ax . scatter ( x = x , y = y , c = z , rasterized = rasterized , cmap = cmap , ** kwargs ) if colorbar is not None : colorbar = ax . figure . colorbar ( mappable , ax = ax , cax = colorbar . ax ) else : colorbar = ax . figure . colorbar ( mappable , ax = ax ) if z_is_stringy : N = len ( z_strings ) f = ( N - 1 ) / N colorbar . set_ticks ( [ ( n + 0.5 ) * f for n in range ( N ) ] ) colorbar . set_ticklabels ( z_strings ) return ax , colorbar
Make a 2D scatterplot of the data.
Make a 2D scatterplot of the data .
"""
    Make a 2D scatterplot of the data. ``**kwargs`` are passed to matplotlib's
    scatter used for the plotting. By default the data will be rasterized
    in any vector plot if more than 5000 points are supplied. This can be
    overridden by supplying the `rasterized` kwarg.

    Args:
        x: The x values
        y: The y values
        z: The z values
        ax: The axis to plot onto
        colorbar: The colorbar to plot into

    Returns:
        The matplotlib axis handles for plot and colorbar
    """
The matplotlib axis handles for plot and colorbar
The matplotlib axis handles for plot and colorbar
x
np.ndarray
The x values
The x values
y
np.ndarray
The y values
The y values
z
np.ndarray
The z values
The z values
ax
matplotlib.axes.Axes
The axis to plot onto
The axis to plot onto
colorbar
matplotlib.colorbar.Colorbar
The colorbar to plot into
The colorbar to plot into
kwargs
Any