1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
|
.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2020 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. module:: wx.lib.plot.utils
.. currentmodule:: wx.lib.plot.utils
.. highlight:: python
.. _wx.lib.plot.utils:
==========================================================================================================================================
|phoenix_title| **wx.lib.plot.utils**
==========================================================================================================================================
utils.py
=========
This is a collection of utilities used by the :mod:`wx.lib.plot` package.
|function_summary| Functions Summary
====================================
================================================================================ ================================================================================
:func:`~wx.lib.plot.utils.pairwise` s -> (s0,s1), (s1,s2), (s2, s3), ...
:func:`~wx.lib.plot.utils.pendingDeprecation` Raise `PendingDeprecationWarning` and display a message.
:func:`~wx.lib.plot.utils.scale_and_shift_point` Creates a scaled and shifted 2x1 numpy array of [x, y] values.
:func:`~wx.lib.plot.utils.set_displayside` Wrapper around :class:`~wx.lib.plot._DisplaySide` that allows for "overloaded" calls.
================================================================================ ================================================================================
|
|class_summary| Classes Summary
===============================
================================================================================ ================================================================================
:ref:`~wx.lib.plot.utils.DisplaySide` Generic class for describing which sides of a box are displayed.
:ref:`~wx.lib.plot.utils.PlotPendingDeprecation` Base class for warnings about deprecated features.
:ref:`~wx.lib.plot.utils.TempStyle` Decorator / Context Manager to revert pen or brush changes.
================================================================================ ================================================================================
|
.. toctree::
:maxdepth: 1
:hidden:
wx.lib.plot.utils.DisplaySide
wx.lib.plot.utils.PlotPendingDeprecation
wx.lib.plot.utils.TempStyle
Functions
------------
.. function:: pairwise(iterable)
s -> (s0,s1), (s1,s2), (s2, s3), ...
.. function:: pendingDeprecation(new_func)
Raise `PendingDeprecationWarning` and display a message.
Uses inspect.stack() to determine the name of the item that this
is called from.
:param new_func: The name of the function that should be used instead.
:type new_func: string.
.. function:: scale_and_shift_point(x, y, scale=1, shift=0)
Creates a scaled and shifted 2x1 numpy array of [x, y] values.
The shift value must be in the scaled units.
:param float `x`: The x value of the unscaled, unshifted point
:param float `y`: The y valye of the unscaled, unshifted point
:param np.array `scale`: The scale factor to use ``[x_sacle, y_scale]``
:param np.array `shift`: The offset to apply ``[x_shift, y_shift]``.
Must be in scaled units
:returns: a numpy array of 2 elements
:rtype: np.array
.. note::
:math:`new = (scale * old) + shift`
.. function:: set_displayside(value)
Wrapper around :class:`~wx.lib.plot._DisplaySide` that allows for "overloaded" calls.
If ``value`` is a boolean: all 4 sides are set to ``value``
If ``value`` is a 2-tuple: the bottom and left sides are set to ``value``
and the other sides are set to False.
If ``value`` is a 4-tuple, then each item is set individually: ``(bottom,
left, top, right)``
:param value: Which sides to display.
:type value: bool, 2-tuple of bool, or 4-tuple of bool
:raises: `TypeError` if setting an invalid value.
:raises: `ValueError` if the tuple has incorrect length.
:rtype: :class:`~wx.lib.plot._DisplaySide`
|