;iddlZddlZddlZddlZddlmZddlmZddlm Z ddl m Z ddl m Z dd l m Z dd lmZd gZGd d eZGdd e ZdZdZdS)N)debug) functions)getConfigOption)QtCore)GraphicsObject) PlotCurveItem)ScatterPlotItem PlotDataItemcReZdZdZd fd ZedZdZdZdZ dZ xZ S) PlotDataseta :orphan: .. warning:: This class is intended for internal use. The interface may change without warning. Holds collected information for a plotable dataset. Numpy arrays containing x and y coordinates are available as ``dataset.x`` and ``dataset.y``. After a search has been performed, typically during a call to :func:`dataRect() `, ``dataset.containsNonfinite`` is `True` if any coordinate values are nonfinite (e.g. NaN or inf) or `False` if all values are finite. If no search has been performed yet, ``dataset.containsNonfinite`` is `None`. For internal use in :class:`PlotDataItem `, this class should not be instantiated when no data is available. NcRt||_||_||_||_d|_t|tj r|j j dvrd|_t|tj r|j j dvr d|_dSdSdS)z Parameters ---------- x: array x coordinates of data points. y: array y coordinates of data points. NiuT) super__init__xy xAllFinite yAllFinite _dataRect isinstancenpndarraydtypekind)selfrrrr __class__s XC:\PYTHON\MyICR_Workspace\venv\Lib\site-packages\pyqtgraph/graphicsItems/PlotDataItem.pyrzPlotDataset.__init__s $$ a $ $ #)=)="DO a $ $ #)=)="DOOO # #)=)=c@|j|jdS|jo|j SN)rrrs rcontainsNonfinitezPlotDataset.containsNonfinite4s( ? "do&=4O788r cJ|j|jdS||j|j\}}|_||j|j\}}|_t jt j||t j|||_dS)z Finds bounds of plotable data and stores them as ``dataset._dataRect``, stores information about the presence of nonfinite data points. N) rr_getArrayBoundsrrrQRectFQPointFr)rxminxmaxyminymaxs r_updateDataRectzPlotDataset._updateDataRect;s 6>TV^4&*&:&:464?&S&S#dDO&*&:&:464?&S&S#dDOtD(A(A6>RVW[C\C\^^r c|s2tj|}|}|s||} tj|}tj|}n(#t $rtj}tj}YnwxYw|||fSr")risfiniteallminmax ValueErrornan)rarr all_finite selectionaminamaxs rr&zPlotDataset._getArrayBoundsFs % C((I"J %)n 63==D63==DD   6D6DDD T:%%s(A"BBcF|j||jS)a4 Returns a bounding rectangle (as :class:`QtCore.QRectF`) for the finite subset of data. If there is an active mapping function, such as logarithmic scaling, then bounds represent the mapped data. Will return `None` if there is no data or if all values (`x` or `y`) are NaN. )rr-r#s rdataRectzPlotDataset.dataRectWs& > !  " " "~r c|drtj5tjdtt j|j|_dddn #1swxYwYt j|j}|rtj |j|<d}nd}||_ |drtj5tjdtt j|j |_ dddn #1swxYwYt j|j }|rtj |j |<d}nd}||_ dSdS)a Applies a logarithmic mapping transformation (base 10) if requested for the respective axis. This replaces the internal data. Values of ``-inf`` resulting from zeros in the original dataset are replaced by ``np.nan``. Parameters ---------- logmode: tuple or list of two bool A `True` value requests log-scale mapping for the x and y axis (in this order). rignoreNFTr) warningscatch_warnings simplefilterRuntimeWarningrlog10rr/anyr4rrr)rlogMode nonfinites all_x_finite all_y_finites rapplyLogMappingzPlotDataset.applyLogMappingas 1: +(** * *%h???$&)) * * * * * * * * * * * * * * *+tv///J~~ $%'Vz"$ # *DO 1: +(** * *%h???$&)) * * * * * * * * * * * * * * *+tv///J~~ $%'Vz"$ # *DOOO + +s#9A!!A%(A%9DD!DNN) __name__ __module__ __qualname____doc__rpropertyr$r-r&r;rH __classcell__)rs@rrrs  ######*99X9 _ _ _&&&"!+!+!+!+!+!+!+r rceZdZdZejeZejeeZejeeeZ ejeeeZ dZ e dZ e dZd1dZdZd1dZd Zd Zd Zd Zd ZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"d2dZ#dZ$d3dZ%dZ&d Z'd4d"Z(d#Z)d$Z*d%Z+d&Z,d5d(Z-d)Z.d*Z/d+Z0d,Z1d-Z2d.Z3d2d/Z4d0Z5dS)6r a **Bases:** :class:`GraphicsObject ` :class:`PlotDataItem` provides a unified interface for displaying plot curves, scatter plots, or both. It also contains methods to transform or decimate the original data before it is displayed. As pyqtgraph's standard plotting object, ``plot()`` methods such as :func:`pyqtgraph.plot` and :func:`PlotItem.plot() ` create instances of :class:`PlotDataItem`. While it is possible to use :class:`PlotCurveItem ` or :class:`ScatterPlotItem ` individually, this is recommended only where performance is critical and the limited functionality of these classes is sufficient. ================================== ============================================== **Signals:** sigPlotChanged(self) Emitted when the data in this item is updated. sigClicked(self, ev) Emitted when the item is clicked. sigPointsClicked(self, points, ev) Emitted when a plot point is clicked Sends the list of points under the mouse. sigPointsHovered(self, points, ev) Emitted when a plot point is hovered over. Sends the list of points under the mouse. ================================== ============================================== ctj|||jjd|_d|_d|_t|_ t|_ |j ||j ||j j |j|j j |j|j j|j|dd|dd|ddd|_idd d dd dd ddgd dddddddddddddddddddddddddddt+dddddd d!dd"d#dd$ |_||d%d|j|i|dS)&a& There are many different ways to create a PlotDataItem. **Data initialization arguments:** (x,y data only) ========================== ========================================= PlotDataItem(x, y) x, y: array_like coordinate values PlotDataItem(y) y values only -- x will be automatically set to ``range(len(y))`` PlotDataItem(x=x, y=y) x and y given by keyword arguments PlotDataItem(ndarray(N,2)) single numpy array with shape (N, 2), where ``x=data[:,0]`` and ``y=data[:,1]`` ========================== ========================================= **Data initialization arguments:** (x,y data AND may include spot style) ============================ =============================================== PlotDataItem(recarray) numpy record array with ``dtype=[('x', float), ('y', float), ...]`` PlotDataItem(list-of-dicts) ``[{'x': x, 'y': y, ...}, ...]`` PlotDataItem(dict-of-lists) ``{'x': [...], 'y': [...], ...}`` ============================ =============================================== **Line style keyword arguments:** ============ ============================================================================== connect Specifies how / whether vertexes should be connected. See below for details. pen Pen to use for drawing the lines between points. Default is solid grey, 1px width. Use None to disable line drawing. May be a ``QPen`` or any single argument accepted by :func:`mkPen() ` shadowPen Pen for secondary line to draw behind the primary line. Disabled by default. May be a ``QPen`` or any single argument accepted by :func:`mkPen() ` fillLevel If specified, the area between the curve and fillLevel is filled. fillOutline (bool) If True, an outline surrounding the *fillLevel* area is drawn. fillBrush Fill to use in the *fillLevel* area. May be any single argument accepted by :func:`mkBrush() ` stepMode (str or None) If specified and not None, a stepped curve is drawn. For 'left' the specified points each describe the left edge of a step. For 'right', they describe the right edge. For 'center', the x coordinates specify the location of the step boundaries. This mode is commonly used for histograms. Note that it requires an additional x value, such that len(x) = len(y) + 1 . ============ ============================================================================== ``connect`` supports the following arguments: - 'all' connects all points. - 'pairs' generates lines between every other point. - 'finite' creates a break when a nonfinite points is encountered. - If an ndarray is passed, it should contain `N` int32 values of 0 or 1. Values of 1 indicate that the respective point will be connected to the next. - In the default 'auto' mode, PlotDataItem will normally use 'all', but if any nonfinite data points are detected, it will automatically switch to 'finite'. See :func:`arrayToQPath() ` for more details. **Point style keyword arguments:** (see :func:`ScatterPlotItem.setData() ` for more information) ============ ====================================================== symbol Symbol to use for drawing points, or a list of symbols for each. The default is no symbol. symbolPen Outline pen for drawing points, or a list of pens, one per point. May be any single argument accepted by :func:`mkPen() `. symbolBrush Brush for filling points, or a list of brushes, one per point. May be any single argument accepted by :func:`mkBrush() `. symbolSize Diameter of symbols, or list of diameters. pxMode (bool) If True, then symbolSize is specified in pixels. If False, then symbolSize is specified in data coordinates. ============ ====================================================== Any symbol recognized by :class:`ScatterPlotItem ` can be specified, including 'o' (circle), 's' (square), 't', 't1', 't2', 't3' (triangles of different orientation), 'd' (diamond), '+' (plus sign), 'x' (x mark), 'p' (pentagon), 'h' (hexagon) and 'star'. Symbols can also be directly given in the form of a :class:`QtGui.QPainterPath` instance. **Optimization keyword arguments:** ================= ======================================================================= useCache (bool) By default, generated point graphics items are cached to improve performance. Setting this to False can improve image quality in certain situations. antialias (bool) By default, antialiasing is disabled to improve performance. Note that in some cases (in particular, when ``pxMode=True``), points will be rendered antialiased even if this is set to `False`. downsample (int) Reduce the number of samples displayed by the given factor. downsampleMethod 'subsample': Downsample by taking the first of N samples. This method is fastest and least accurate. 'mean': Downsample by taking the mean of N samples. 'peak': Downsample by drawing a saw wave that follows the min and max of the original data. This method produces the best visual representation of the data but is slower. autoDownsample (bool) If `True`, resample the data before plotting to avoid plotting multiple line segments per pixel. This can improve performance when viewing very high-density data, but increases the initial overhead and memory usage. clipToView (bool) If `True`, only data visible within the X range of the containing :class:`ViewBox` is plotted. This can improve performance when plotting very large data sets where only a fraction of the data is visible at any time. dynamicRangeLimit (float or `None`) Limit off-screen y positions of data points. `None` disables the limiting. This can increase performance but may cause plots to disappear at high levels of magnification. The default of 1e6 limits data to approximately 1,000,000 times the :class:`ViewBox` height. dynamicRangeHyst (float) Permits changes in vertical zoom up to the given hysteresis factor (the default is 3.0) before the limit calculation is repeated. skipFiniteCheck (bool, default `False`) Optimization flag that can speed up plotting by not checking and compensating for NaN values. If set to `True`, and NaN values exist, unpredictable behavior will occur. The data may not be displayed or the plot may take a significant performance hit. In the default 'auto' connect mode, `PlotDataItem` will automatically override this setting. ================= ======================================================================= **Meta-info keyword arguments:** ========== ================================================ name (string) Name of item for use in the plot legend ========== ================================================ **Notes on performance:** Plotting lines with the default single-pixel width is the fastest available option. For such lines, translucent colors (`alpha` < 1) do not result in a significant slowdown. Wider lines increase the complexity due to the overlap of individual line segments. Translucent colors require merging the entire plot into a single entity before the alpha value can be applied. For plots with more than a few hundred points, this can result in excessive slowdown. Since version 0.12.4, this slowdown is automatically avoided by an algorithm that draws line segments separately for fully opaque lines. Setting `alpha` < 1 reverts to the previous, slower drawing method. For lines with a width of more than 4 pixels, :func:`pyqtgraph.mkPen() ` will automatically create a ``QPen`` with `Qt.PenCapStyle.RoundCap` to ensure a smooth connection of line segments. This incurs a small performance penalty. NxViewRangeWasChangedFyViewRangeWasChangedstyleWasChangedT)rUconnectautoskipFiniteCheckfftModerDderivativeMode phasemapMode alphaHint? alphaModepen)r`r` shadowPen fillLevel fillOutline fillBrushstepModesymbol symbolSize symbolPen)2rj antialiasrpeakg@.A@) symbolBrushpxModerl pointModeuseCache downsampleautoDownsampledownsampleMethodautoDownsampleFactor clipToViewdynamicRangeLimitdynamicRangeHystdata clickable)r rsetFlagGraphicsItemFlagItemHasNoContents_dataset_datasetMapped_datasetDisplayr curver scatter setParentItem sigClickedrV curveClickedscatterClicked sigHoveredscatterHovered setProperty _drlLastCliproptssetCurveClickablegetsetDatarargskargss rrzPlotDataItem.__init__sd %%% T*<=== $ ##"__ &((    &&& ""4((( %%d&7888 ''(;<<< ''(;<<< /777 /777 *D111&# v# u#  u#  u~ # e # E #  #  #  =#  #  #  5#  #  # " d## $ "%# & '# ()(55# &$&!$ #E# # #  H uyye<<=== d$e$$$$$r c,|jdS|jjSr")rrr#s rxDatazPlotDataItem.xDataz = }r c,|jdS|jjSr")rrr#s ryDatazPlotDataItem.yDatarr Ncdg}||S||vS)NplotData)r interfaceintss r implementszPlotDataItem.implementss|  KD  r c8|jddS)z; Returns the name that represents this item in the legend. nameN)rrr#s rrzPlotDataItem.namesy}}VT***r c<|j||dS)z` ``state=True`` sets the curve to be clickable, with a tolerance margin represented by `width`. N)r setClickable)rstatewidths rrzPlotDataItem.setCurveClickables  u-----r c|jjS)z5 Returns `True` if the curve is set to be clickable. )rr|r#s rcurveClickablezPlotDataItem.curveClickables z##r c(tjSr")rr'r#s r boundingRectzPlotDataItem.boundingRects}r ctj|||||dSr")r setPosviewTransformChangedviewRangeChanged)rrrs rrzPlotDataItem.setPossAdAq))) !!### r c|jd|kr|jd|krdS||jd<||jd<||dS)Nr\r^)r setOpacity)ralpharWs rsetAlphazPlotDataItem.setAlphasZ 9[ !U * *ty/E/M/M F!& +!% + r c|jd|krdS||jd<d|_d|_|d|dS)z ``state = True`` enables mapping the data by a fast Fourier transform. If the `x` values are not equidistant, the data set is resampled at equal intervals. rYNF styleUpdate)rrr updateItemsinformViewBoundsChangedrrs r setFftModezPlotDataItem.setFftModesf 9Y 5 ( ( F$ )## U+++ $$&&&&&r c|jd||gkrdS||g|jd<d|_d|_d|_|d|dS)a When log mode is enabled for the respective axis by setting ``xState`` or ``yState`` to `True`, a mapping according to ``mapped = np.log10( value )`` is applied to the data. For negative or zero values, this results in a `NaN` value. rDNrFrrrr _adsLastValuerr)rxStateyStates r setLogModezPlotDataItem.setLogModesx 9Y FF#3 3 3 F &/ )##  U+++ $$&&&&&r c|jd|krdS||jd<d|_d|_d|_|d|dS)z ``state = True`` enables derivative mode, where a mapping according to ``y_mapped = dy / dx`` is applied, with `dx` and `dy` representing the differences between adjacent `x` and `y` values. rZNrFrrrs rsetDerivativeModezPlotDataItem.setDerivativeModesp 9% &% / / F&+ "###  U+++ $$&&&&&r c|jd|krdS||jd<d|_d|_d|_|d|dS)z ``state = True`` enables phase map mode, where a mapping according to ``x_mappped = y`` and ``y_mapped = dy / dx`` is applied, plotting the numerical derivative of the data over the original `y` values. r[NrFrrrs rsetPhasemapModezPlotDataItem.setPhasemapModesn 9^ $ - - F$) .!##  U+++ $$&&&&&r chtj|i|}||jd<|ddS)z Sets the pen used to draw lines between points. The argument can be a :class:`QtGui.QPen` or any combination of arguments accepted by :func:`pyqtgraph.mkPen() `. r_TrNfnmkPenrrrrrr_s rsetPenzPlotDataItem.setPensC h&&& % T*****r c|r |dd}ntj|i|}||jd<|ddS)a Sets the shadow pen used to draw lines between points (this is for enhancing contrast or emphasizing data). This line is drawn behind the primary pen and should generally be assigned greater width than the primary pen. The argument can be a :class:`QtGui.QPen` or any combination of arguments accepted by :func:`pyqtgraph.mkPen() `. rNraTrrrs r setShadowPenzPlotDataItem.setShadowPensZ  +DGOCC(D*E**C!$ + T*****r c|r |dd}ntj|i|}|jd|krdS||jd<|ddS)z Sets the :class:`QtGui.QBrush` used to fill the area under the curve. See :func:`mkBrush() `) for arguments. rNrdTrrmkBrushrrrrrbrushs r setFillBrushzPlotDataItem.setFillBrushso  /DGOEEJ...E 9[ !U * * F!& + T*****r c|j|i|S)zB See :func:`~pyqtgraph.PlotDataItem.setFillBrush` )rrs rsetBrushzPlotDataItem.setBrushs!t $0%000r cl|jd|krdS||jd<|ddS)z Enables filling the area under the curve towards the value specified by `level`. `None` disables the filling. rbNTrrr)rlevels r setFillLevelzPlotDataItem.setFillLevelsD 9[ !U * * F!& + T*****r cl|jd|krdS||jd<|ddS)z `symbol` can be any string recognized by :class:`ScatterPlotItem ` or a list that specifies a symbol for each point. rfNTrr)rrfs r setSymbolzPlotDataItem.setSymbol#sD 9X & ( ( F$ ( T*****r ctj|i|}|jd|krdS||jd<|ddS)z Sets the :class:`QtGui.QPen` used to draw symbol outlines. See :func:`mkPen() `) for arguments. riNTrrrs r setSymbolPenzPlotDataItem.setSymbolPen.sX h&&& 9[ !S ( ( F!$ + T*****r ctj|i|}|jd|krdS||jd<|ddS)z Sets the :class:`QtGui.QBrush` used to fill symbols. See :func:`mkBrush() `) for arguments. rpNTrrrs rsetSymbolBrushzPlotDataItem.setSymbolBrush:sX  D*E** 9] #u , , F#( -  T*****r cl|jd|krdS||jd<|ddS)z' Sets the symbol size. rgNTrr)rsizes r setSymbolSizezPlotDataItem.setSymbolSizeFsD 9\ "d * * F"& , T*****r c"d}||jd|kr d}||jd<||jd|kr ||jd<d}||jd|kr d}||jd<|r-d|_d|_d|_|ddSdS) a Sets the downsampling mode of this item. Downsampling reduces the number of samples drawn to increase performance. ============== ================================================================= **Arguments:** ds (int) Reduce visible plot samples by this factor. To disable, set ds=1. auto (bool) If True, automatically pick *ds* based on visible range mode 'subsample': Downsample by taking the first of N samples. This method is fastest and least accurate. 'mean': Downsample by taking the mean of N samples. 'peak': Downsample by drawing a saw wave that follows the min and max of the original data. This method produces the best visual representation of the data but is slower. ============== ================================================================= FNrtTrurvrr)rrrrr)rdsrWmethodchangeds rsetDownsamplingzPlotDataItem.setDownsamplingPs$ >y&",,*, ,'   *: ;t C C*.DI& 'G  y+,6606 ,-  0#'D #'D #$D      / / / / /  0 0r cz|jd|krdS||jd<d|_|ddS)zm ``state=True`` enables clipping the displayed data set to the visible x-axis range. rxNFrrrrrs r setClipToViewzPlotDataItem.setClipToViewwsL 9\ "e + + F"' ,# U+++++r rnroc|dkrd}||jd<||jdkrdS||jd<d|_|ddS)uB Limit the off-screen positions of data points at large magnification This avoids errors with plots not displaying because their visibility is incorrectly determined. The default setting repositions far-off points to be within ±10^6 times the viewport height. =============== ================================================================ **Arguments:** limit (float or None) Any data outside the range of limit * hysteresis will be constrained to the limit value limit. All values are relative to the viewport height. 'None' disables the check for a minimal increase in performance. Default is 1E+06. hysteresis (float) Hysteresis factor that controls how much change in zoom level (vertical height) is allowed before recalculating Default is 3.0 =============== ================================================================ r]rzryNFrr)rlimit hysteresiss rsetDynamicRangeLimitz!PlotDataItem.setDynamicRangeLimitsk&   J)3 $% DI12 2 2 F). %&# U+++++r c4t||jd<dS)a When it is known that the plot data passed to ``PlotDataItem`` contains only finite numerical values, the ``skipFiniteCheck`` property can help speed up plotting. If this flag is set and the data contains any non-finite values (such as `NaN` or `Inf`), unpredictable behavior will occur. The data might not be plotted, or there migth be significant performance impact. In the default 'auto' connect mode, ``PlotDataItem`` will apply this setting automatically. rXN)boolr)rrXs rsetSkipFiniteCheckzPlotDataItem.setSkipFiniteChecks)-_(=(= #$$$r c 8 |dddurtjdtdd|vrtjdtd d |vrtjd td t j}d}d}t|d kr|d }t|}|dkrn(|dkrtj |}n |dkr|ddd f}|ddd f}n|dks|dkr>d|vrtj |d}d|vrtj |d}n|dkrld|d vrtj d|D}d|d vrtj d|D}dD] |vr fd|D| <n0|dkrS| tj }| d  tj }ntdt|zt|d krd}t|d t|d f} | d |vs | d |vrVtdt!t|d dt!t|d dt#|d tj sB| d dkr|d }n@tj |d }n%|d  tj }t#|d tj sB| d dkr|d }n@tj |d }n%|d  tj }d|vr/|d}t|dkr|}d|vr/|d}t|dkr|}|d d!|vr&|d!|jd!<|d"dd#|vr&|d#|jd#<|d"dd$|vr|d$|jd$<d%|vrd&|vsd'|vsd(|vr|jd%d)|d%<d*|vr |d*|d+<t+|jD], |vr&| |j <|d"d-|t|d krd} npt#|tj stj |}| tj } |!tjt|}|t|d krd} nMt#|tj stj |}| tj } | | d|_nt1| | |_d|_d|_d |_|d,||d"-|d"d.|d/||j ||d0dS)1z Clear any data displayed by this item and display new data. See :func:`__init__() ` for details; it accepts the same arguments. reNTzjstepMode=True is deprecated and will result in an error after October 2022. Use stepMode="center" instead.) stackleveldecimatezvThe decimate keyword has been deprecated. It has no effect and may result in an error in releases after October 2022. r identicalzsThe identical keyword has been deprecated. It has no effect may result in an error in releases after October 2022. rrempty listOfValuesNx2arrayrecarray dictOfListsrr listOfDictsc:g|]}|ddS)rNr.0ds r z(PlotDataItem.setData..$!@!@!@a!%%D//!@!@!@r c:g|]}|ddS)rNrrs rrz(PlotDataItem.setData..rr )r{rgrirp symbolShapec<g|]}|dSr"r)rrks rrz(PlotDataItem.setData..s%#A#A#AqAEE!TNN#A#A#Ar MetaArrayzInvalid data type %s)rrrzQWhen passing two unnamed arguments, both must be a list or array of values. (got z, )zinterpret datarrTrVrXrfrirprgorrdzset datarFz update itemsemit)!rr>warnDeprecationWarningkeysrProfilerlendataTyperarrayviewrxvals TypeErrortypestrrasarrayrrlistarangerrrrrrrNrsigPlotChangedr) rrrprofilerrrr{dtseqdtyprrrs @rrzPlotDataItem.setDatas 99Z & &$ . . M|"q      % % MI"q     %**,, & & MF"q    >##   t99>>7D$BW}}~%%HTNNz!!1I1Iz!!R=%8%8$;;c++A$;;c++A}$$$q'>>!@!@4!@!@!@AAA$q'>>!@!@4!@!@!@AAAZBBADyy#A#A#A#AD#A#A#AaB{""IIbj))JJqMM&&rz22 6d CDDD YY!^^8CDG$$htAw&7&77DAwc!!T!WC%7%7iBCGHLMNHOCPCPQQQQSVW[\`ab\cWdWdSeSeSeSe!fgggd1grz22 -7k))Q))AAa))AAGLL,,d1grz22 -7k))Q))AAa))AAGLL,, %<<c A{{k))IIKK %<<c A{{k))IIKK!""" U?? %f DIf    . 5 5 5   #(#3DIi   . 5 5 5  % %+01B+CDI' ( 5 kU&:&:mu>T>TXdhmXmXmy"*"%h e  !&wE+ dinn&&'' : :AEzz$Qx !   !2D999 9A! EEa,, HQKKFF2:&&EyIc!ff%% 9A EEa,, HQKKFF2:&&E =EM DMM'77DM##   6G(H(HJJJ *E222    $$&&&   &&&r Tcd}i}i}|rBdD]\}}||jvr|j|||<dD]\}}||jvr|j|||<|}|4|j|jdS|j}|j}|jd|jd|jdtt|dtr*|ddkr|j d ur d |d<d|d <n d |d<d |d <|jj d||d ||j n|j|jde|j dd dvrd|dd|ddzz}|jj d||d ||j dS|jdS)NT) )r_r_)rara)rbrb)rcrc)rdrrlrl)rVrV)rere)rXrX))rir_)rpr)rfrf)rgr)r{r{)rqrqr)rsrsr_rdrbrVrWFr0rXfinite)rrrfre)centerTg?rr) r_getDisplayDatasetrhiderrrrrr$rshowr) rr curveArgs scatterArgsrvdatasetrrs rrzPlotDataItem.updateItemsJsB    2  0 01 >>#'9Q>%)Yq\KN))++ ? JOO    L      F I I Ie  ( +&2ty7M7Y)I.44 999MQW9W9W,55+0Ii(37I/00 ,4Ii(38I/0 DJ  5a 5 59 5 5 5 JOO     JOO    9X  *y}}Z//3CCC1SbS6AabbE>* DL 91 9 9[ 9 9 9 L        L       r c4|j}|dS|j|jfS)z^ Returns the original, unmapped data as the tuple (`xData`, `yData`). NrI)rrrrr's rgetOriginalDatasetzPlotDataItem.getOriginalDatasets$mG#|9gi' 'r c x|jdS|jm|dr |jdsK|dr |jds)|dr |jd|jS|j|jj}|jj}|jtkr| tj }|jtkr| tj }|jdr@| ||\}}|jdd r|d d}|d d}|jd rGtj |jjtj |jjz }|dd }|jd rQ|jjdd }tj |jjtj |jjz }t|||jj|jj}d|jdvr ||jd||_|jj}|jj}|jj}|jj}|}|d}n|}||}|jd}t)|t*sd }|jdr'|r|} n|tj|} |t/| d krt1| d | d z t/| d z z } | dkr|} | dkrft5dt7|| z | |jdzz } t9j| rt+| }t9j||jdr|j}||_|jdr||d rn|t/|d krtAj!||"|z } tGj$| d t/|} tAj!||%|z}tGj$|| t/|}|| |}|| |}|d kr|jddkr|dd|}|dd|}nr|jddkr_t/||z}|dz}|||||zz|}|d||z&||'d }n|jddkrt/||z}tj(|df}|dz}|||||zz|tj)f|dd<|&|dz}tj(|df}|d||z&||f}|d |ddd f<|*d |ddd f<|&|dz}|jd||j+}||,}|jd}|jd}|d kr^|-|.ks3|.|-ks|,d|z|z|zkrd}|j|j/d |-z |z }|j/d |.z |z }|||z kr5|||zkr,|||z kr#|||zkr|jj}|jj}d}|sS|-||zz }|.||zz}tGj0|||}||f|_/t|||||_|1dd|1dd|jS)z Returns a :class:`~.PlotDataset` object that contains data suitable for display (after mapping and data reduction) as ``dataset.x`` and ``dataset.y``. Intended for internal use. NrRrxrurSryrYrDrrrZr r[TrtrUr]rwg{Gz?)rel_tolrv subsamplemeanr)axisrmrzF)2rrrNrrrrrrastyperuint8_fourierTransformdiffrrrrH getViewBoxviewRectrintr/r floatrr2absmathiscloserautoRangeEnabledbisect bisect_leftleftr clip_scalarrightreshaper.rnewaxisr1r;heightbottomtopr clip_arrayr)rrrr'rrr view_rangerfinite_xdxrds_floatx0x1nstxy1y2 data_range view_heightrhyst cache_is_goodtop_excbot_excmin_valmax_vals rr!zPlotDataItem._getDisplayDatasets{ = 4  ,566 -;?9\;R -566 -;?9EU;V -566 -<@9EX;Y;e' '   & A Aw$HHRX&&w$HHRX&&y# ,,Q22!9Y'*eAeAy)* GDMO,,RWT]_-E-EEcrcFy( FMOCRC(GDMO,,RWT]_-E-EE!!Q (@$-BZ[[Gty+++''9)=???")D    !   !(3 (3    <JJJ  J Y| $"c"" B 9% & $ -R[^^,%#h--!*;*;8B< 344H aH99 OO--3355E||#&sC 0@0@0B0BR0G5SWS\]sStKt0u,v,v#w#w=22/!$XB |B 2DAAA ('!#D  9\ " !|t4466q9|)c!ffqjj +Az/@/@AABFBAs1vv66B +Az/?/?/A/ABBRGBBA77B"R%A"R%A 66y+, ;;dddGdddG-.&88FFbL!ec#ad(2o&eqteH$$Qr**//Q/77-.&88FFbLXqe__!e#c!B$hr/"*45111JJqsOOXqe__u"uX%%q"g..&&a&..111Q3&&a&..111Q3JJqsOO 9( ) 5%!099;; )","3"3"5"5K I&9:E I&89D$a * 1 1 3 3jnn6F6F F F * 0 0:3D3D3F3F F F&--//!d(U2B[2PPP(- /;'+'8';J>Bq)1BqEMasSUVWSXZ_`aZbOcOcq)1BqEMasSUVWSXZ_`aZbOcOcE r c d}|jr(t||j}n@|jr't||j}|S)z Returns the size in pixels that this item may draw beyond the values returned by dataBounds(). This method is called by :class:`ViewBox` when auto-scaling. r)rr]r2 pixelPaddingr)rpads rrezPlotDataItem.pixelPadding~sv  :   ! ! 8c4:224455CC \ # # % % 8c4<446677C r cd|_d|_d|_|j|jdSr")rrrrclearrr#s rrhzPlotDataItem.clearsG# ##  r cdSr"rrs r appendDatazPlotDataItem.appendDatas r c<|j||dSr")rr)rrevs rrzPlotDataItem.curveClickeds  T2&&&&&r ct|j|||j|||dSr")rrsigPointsClickedrpltpointsrls rrzPlotDataItem.scatterClickeds; T2&&& ""444444r c>|j|||dSr")sigPointsHoveredrros rrzPlotDataItem.scatterHovereds# ""444444r c"d}||dr9|dd|jds |jdr d|_d}||dr%|dd|jd d}|r|d dSdS) NFrrRTrxrurrSryr)rrrr)rvbrangesr update_neededs rrzPlotDataItem.viewRangeChangeds ?gaj?   3T : : : ,' %9-. %(,$ $ ?gaj?   3T : : :y,-9 $  0     / / / / / 0 0r cttj|}tjtj||dz t|ddz k }|sGtj|d|dt |}tj|||}|}|j}tj ||z }t|d|dz t |dz z }tj ||}tj|}||fS)Nrg@@r r) rr3rCr8linspacer interprfftrfftr7rfftfreq) rrrrIuniformx2rMfrs rr2zPlotDataItem._fourierTransformsWQZZfRVBr!uH--RUe1CDEEE QqT1R5#a&&11B "a##AA F FKKNNQ  !B%!*  Q * FOOAq ! ! F1II!t r r")NNN)rnro)T)r]N)6rJrKrLrMrSignalobjectrrrnrsrrNrrrrrrrrrrrrrrrrrrrrrrrrrrrrr*r!rZr;r^rerhrjrrrrr2rr rr r s30#V]6**Nvv..J$v}VVV<<$v}VVV<<S%S%S%lXX!!!! +++....$$$    ' ' '''' ' ' '''' + + ++++$ + + +111 +++ + + + + + + + + ++++%0%0%0%0N , , ,,,,,< > > >]]]~K K K K Z(((k$k$k$Z$$$(((<      '''5555550000,r c2t|drt|dkrdSt|trdSt |r|d}t|dr|drdSt|t jri|jdkr|j j dSd S|jd kr|j j |j dd krd Std t|j zt|trd SdSdS)N__len__rrrrrrrrrrz1array shape must be (N,) or (N,2); got %s insteadr)hasattrr rdict isSequencerrrndimrnamesshaper3r)objfirsts rr r s"sI3s88q==w#t"} C"A C & & "3>>++F+F "; RZ ( ( "x1}}9?*)>%:Q39?#:sy|q?P?P!z !TWZ[^[dWeWe!efff t $ $ " =!>%""r ct|dp>t|tjp$t|do|dS)N__iter__rr)rrrrr)rs rrrsa 3 # # Cz#rz'B'B CwsT`GaGaHBfiftftvAgBgBCr )r9r>r<numpyrrrrrQtrr r r __all__rrr r rrr rrsE  ******((((((,,,,,,  q+q+q+q+q+&q+q+q+fEEEEE>EEEP""""4CCCCCr