How to use the probscale.validate.axes_object function in probscale

To help you get started, we’ve selected a few probscale examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github matplotlib / mpl-probscale / probscale / viz.py View on Github external
.. plot::
        :context: close-figs

        >>> fig = probplot(data, plottype='qq', probax='x',
        ...          problabel='Theoretical Quantiles',
        ...          datalabel='Observed values', bestfit=True,
        ...          line_kws=dict(linestyle='-', linewidth=2),
        ...          scatter_kws=dict(marker='s', alpha=0.5))

    """

    if dist is None:
        dist = _minimal_norm

    # check input values
    fig, ax = validate.axes_object(ax)
    probax = validate.axis_name(probax, 'probability axis')
    problabel = validate.axis_label(problabel)
    datalabel = validate.axis_label(datalabel)

    # default values for symbology options
    scatter_kws = validate.other_options(scatter_kws)
    line_kws = validate.other_options(line_kws)
    pp_kws = validate.other_options(pp_kws)

    # check plottype
    plottype = validate.axis_type(plottype)

    # !-- kwarg that only seaborn should use --!
    _color = fgkwargs.get('color', None)
    if _color is not None:
        scatter_kws['color'] = _color
github matplotlib / mpl-probscale / probscale / viz.py View on Github external
----------
    ax : matplotlib Axes
        The Axes object that will be modified.
    N : int
        Maximum number of points for the series plotted on the Axes.
    which : string
        The axis whose ticklabels will be rotated. Valid values are 'x',
        'y', or 'both'.

    Returns
    -------
    None

    """

    fig, ax = validate.axes_object(ax)
    which = validate.axis_name(probax, 'probability axis')

    if N <= 5:
        minval = 10
    elif N <= 10:
        minval = 5
    else:
        minval = 10 ** (-1 * numpy.ceil(numpy.log10(N) - 2))

    if which in ['x', 'both']:
        ax.set_xlim(left=minval, right=100 - minval)
    elif which in ['y', 'both']:
        ax.set_ylim(bottom=minval, top=100 - minval)