rL idZddlZddlZddlZddlZddlmZddlZddlm Z ddl Z ddl Z ddlmZddl mZmZGddej$ZeZeZdWd Zd Zd ZGd d ZGddeZGddeZGddeZGddeZGddeZGddeZ GddeZ!GddeZ"GddeZ#Gd d!eZ$Gd"d#e$Z%Gd$d%e$Z&Gd&d'eZ'Gd(d)eZ(Gd*d+e(Z)Gd,d-e(Z*Gd.d/e(Z+Gd0d1eZ,Gd2d3eZ-Gd4d5eZ.Gd6d7e.Z/Gd8d9e.Z0Gd:d;eZ1Gd<d=eZ2id>e)d?e*d@e+dAe/dBe0dCe,dDe-dEe!dFe"dGe#dHedIe dJe&dKe%dLeee'dMeee1e2dNZ3dOgdPgdQgdRgdSdDdTgggZ4e3fdUZ5e4fdVZ6y)XaR Abstract base classes define the primitives for Tools. These tools are used by `matplotlib.backend_managers.ToolManager` :class:`ToolBase` Simple stateless tool :class:`ToolToggleBase` Tool that has two states, only one Toggle tool can be active at any given time for the same `matplotlib.backend_managers.ToolManager` N)SimpleNamespace)WeakKeyDictionary)Gcf)_apicbookceZdZdZej Zej Zej Zej Z ej Z ej Z ej Z y)Cursorsz!Backend-independent cursor types.N) __name__ __module__ __qualname____doc__enumautoPOINTERHAND SELECT_REGIONMOVEWAITRESIZE_HORIZONTALRESIZE_VERTICAL^/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/matplotlib/backend_tools.pyr r sa+diikG 499;DDIIKM 499;D 499;D! diikOrr cl|tjt|Stj ||f|S)zBDecorator registering *tool_cls* as a tool class for *canvas_cls*.) functoolspartial_register_tool_class_tool_registryadd) canvas_clstool_clss rrr4s4  !5zBB H-. Orc||jD],}tj|D]}||ftvs|ccS.|S)z:Find a subclass of *tool_cls* registered for *canvas_cls*.)__mro__rrecursive_subclassesr)r r! canvas_parent tool_childs r_find_tool_classr'<sK#++" 33H= "Jz*n<!! "" OrviewposceZdZdZdZ dZ dZ dZeddZ eddZ ed d Z d Z ed d dZ dZddZy)ToolBasez Base tool class. A base tool, only implements `trigger` method or no method at all. The tool is instantiated by `matplotlib.backend_managers.ToolManager`. Nc.||_||_d|_yN)_name _toolmanager_figure)self toolmanagernames r__init__zToolBase.__init__ns ' rc|jSr,)r-r0s rzToolBase.ts TZZrz@The tool id (str, must be unique among tools of a tool manager).)docc|jSr,)r.r5s rr6zToolBase.ws T&&rz+The `.ToolManager` that controls this tool.cJ|j|jjSdSr,)r/canvasr5s rr6zToolBase.zsDLL,DT\\(($rz8The canvas of the figure affected by this tool, or None.c||_yr,r/r0figures r set_figurezToolBase.set_figure}s  rc|jSr,r<r5s rr6zToolBase.s T\\rc$|j|Sr,)r?r=s rr6zToolBase.sT__V4rz*The Figure affected by this tool, or None.c.t|jS)z Return a placeholder object with a single `canvas` attribute. This is useful to reuse the implementations of tools already provided by the classic Toolbars. )r:)rr:r5s r"_make_classic_style_pseudo_toolbarz+ToolBase._make_classic_style_pseudo_toolbarsdkk22rcy)at Called when this tool gets used. This method is called by `.ToolManager.trigger_tool`. Parameters ---------- event : `.Event` The canvas event that caused this tool to be called. sender : object Object that requested the tool to be triggered. data : object Extra data. Nrr0sendereventdatas rtriggerzToolBase.triggers rr,)r r r r default_keymap descriptionimager3propertyr2r1r:r?r>rCrIrrrr*r*IsNK E   N PD& 9;KN FHF! 5 8 :F3 rr*cfeZdZdZdZ dZ dZ fdZd dZd dZ d dZ e dZ fd Z xZS) ToolToggleBaseac Toggleable tool. Every time it is triggered, it switches between enable and disable. Parameters ---------- ``*args`` Variable length argument to be used by the Tool. ``**kwargs`` `toggled` if present and True, sets the initial state of the Tool Arbitrary keyword arguments to be consumed by the Tool NFcf|jd|j|_t||i|y)Ntoggled)popdefault_toggled_toggledsuperr3r0argskwargs __class__s rr3zToolToggleBase.__init__s- 9d.B.BC  $)&)rc|jr|j|n|j||j |_y)z5Calls `enable` or `disable` based on `toggled` value.N)rTdisableenablerEs rrIzToolToggleBase.triggers/ == LL  KK  MM) rcy)zg Enable the toggle tool. `trigger` calls this method when `toggled` is False. Nrr0rGs rr\zToolToggleBase.enable rcy)ay Disable the toggle tool. `trigger` call this method when `toggled` is True. This can happen in different circumstances. * Click on the toolbar tool button. * Call to `matplotlib.backend_managers.ToolManager.trigger_tool`. * Another `ToolToggleBase` derived tool is triggered (from the same `.ToolManager`). Nrr^s rr[zToolToggleBase.disables rc|jS)zState of the toggled tool.)rTr5s rrQzToolToggleBase.toggleds}}rc|j}|r&|jr|j|dnd|_t|||r|r|j|dyd|_yy)NFT)rQr>rIrTrUr?)r0r>rQrYs rr?zToolToggleBase.set_figures\,, {{ T4(!&  6"  T4(!% rr,)r r r r radio_groupcursorrSr3rIr\r[rMrQr? __classcell__rYs@rrOrOsX K F0O#**   %%rrOc>eZdZdZfdZfdZdZdZdZxZ S) ToolSetCursorz Change to the current cursor while inaxes. This tool, keeps track of all `ToolToggleBase` derived tools, and updates the cursor when a tool gets triggered. ct||i|d|_d|_tj |_|j |_|jjd|j|jjjD]<}|jtjjd|j|>y)Ntool_added_event)rUr3_id_drag _current_toolcursorsr_default_cursor _last_cursorr1toolmanager_connect _add_tool_cbktoolsvaluesmplbackend_managers ToolEvent)r0rWrXtoolrYs rr3zToolSetCursor.__init__s $)&) !& 00 ,,-?-1-?-? A$$**113 =D   s33=="D$4$4d < = =rc|jr%|jj|jt|||r,|jj d|j |_yyNmotion_notify_event)rkr:mpl_disconnectrUr? mpl_connect_set_cursor_cbkr0r>rYs rr?zToolSetCursor.set_figure sV == KK & &t}} 5 6"  KK33%t';';=DM rct|jdd>|jjd|jj|j yy)zProcess every newly added tool.rdN tool_trigger_)getattrrwr1rpr2_tool_trigger_cbkr^s rrqzToolSetCursor._add_tool_cbksJ 5::x . :    0 0 0143I3I K ;rc|jjr |jnd|_|j|jyr,)rwrQrlr} canvaseventr^s rrzToolSetCursor._tool_trigger_cbks0+0::+=+=UZZ4 U../rc|r |jsy|jrt|ddr|jj ro|j |jj k7rK|jj|jj |jj |_yy|j |jk7r7|jj|j|j|_yy)Ninaxes) r:rlrr get_navigaterord set_cursorrnr^s rr}zToolSetCursor._set_cursor_cbksDKK    75(D#ALL--/  D$6$6$=$== &&t'9'9'@'@A$($6$6$=$=!>  $"6"6 6 KK " "4#7#7 8 $ 4 4D 7r) r r r r r3r?rqrr}rerfs@rrhrhs" ==K 0 5rrhc2eZdZdZfdZfdZdZxZS)ToolCursorPositionz Send message with the current pointer position. This tool runs in the background reporting the position of the cursor. c2d|_t||i|yr,)rkrUr3rVs rr3zToolCursorPosition.__init__1s  $)&)rc|jr%|jj|jt|||r,|jj d|j |_yyry)rkr:r{rUr?r| send_messager~s rr?zToolCursorPosition.set_figure5sV == KK & &t}} 5 6"  KK33%t'8'8:DM rc|jjjryddlm}|j |}|jj ||y)z=Call `matplotlib.backend_managers.ToolManager.message_event`.Nr)NavigationToolbar2)r1 messagelocklockedmatplotlib.backend_basesr_mouse_event_to_message message_event)r0rGrmessages rrzToolCursorPosition.send_message=sF    ' ' . . 0 ?$<r: widgetlock availabledraw_rubberbandremove_rubberbandrEs rrIzRubberbandBase.triggerIsE{{!!,,66v>    D $ '  " " $rct)zY Draw rubberband. This method must get implemented per backend. )NotImplementedError)r0rHs rrzRubberbandBase.draw_rubberbandRs "!rcy)z] Remove rubberband. This method should get implemented per backend. Nrr5s rrz RubberbandBase.remove_rubberbandZr_rr,)r r r r rIrrrrrrrGs'%" rrc.eZdZdZdZedZddZy)ToolQuit/Tool to call the figure manager destroy method.zQuit the figurec(tjdS)Nz keymap.quitrtrcParamsr5s rr6zToolQuit.g3<< +FrNcBtj|jyr,)r destroy_figr>rEs rrIzToolQuit.triggeris  $rr,r r r r rKrMrJrIrrrrrcs9#KFGN%rrc.eZdZdZdZedZddZy) ToolQuitAllrzQuit all figuresc(tjdS)Nzkeymap.quit_allrr5s rr6zToolQuitAll.qs3<<8I+JrNc,tjyr,)r destroy_allrEs rrIzToolQuitAll.triggerss  rr,rrrrrrms9$KJKNrrc.eZdZdZdZedZddZy)ToolGridz-Tool to toggle the major grids of the figure.zToggle major gridsc(tjdS)N keymap.gridrr5s rr6zToolGrid.{rrNcVttj}tj||5t j d|i5t jj||jjddddddy#1swYxYw#1swYyxYw)Nkeyr struuiduuid4r _setattr_cmrt rc_context backend_baseskey_press_handlerr>r:r0rFrGrHsentinels rrIzToolGrid.trigger}stzz|$84 KnnmX67 K    / /t{{7I7I J K K K K K K#B 5BBB BB(r,rrrrrrws7&KFGNKrrc.eZdZdZdZedZddZy) ToolMinorGridz7Tool to toggle the major and minor grids of the figure.zToggle major and minor gridsc(tjdS)Nkeymap.grid_minorrr5s rr6zToolMinorGrid.3<<8K+LrNcVttj}tj||5t j d|i5t jj||jjddddddy#1swYxYw#1swYyxYw)Nrrrrs rrIzToolMinorGrid.triggerstzz|$84 Knn18<= K    / /t{{7I7I J K K K K K Krr,rrrrrrsA0KLMNKrrc.eZdZdZdZedZddZy)ToolFullScreenzTool to toggle full screen.zToggle fullscreen modec(tjdS)Nzkeymap.fullscreenrr5s rr6zToolFullScreen.rrNc`|jjjjyr,)r>r:managerfull_screen_togglerEs rrIzToolFullScreen.triggers ""557rr,rrrrrrs%*KLMN8rrc4eZdZdZdfd ZddZddZxZS) AxisScaleBasez3Base Tool to toggle between linear and logarithmic.cB|jyt| |||yr,)rrUrI)r0rFrGrHrYs rrIzAxisScaleBase.triggers <<   t,rc|j|jd|jjj y)Nlog set_scalerr>r: draw_idler^s rr\zAxisScaleBase.enables* u||U+ $$&rc|j|jd|jjj y)Nlinearrr^s rr[zAxisScaleBase.disables* u||X. $$&rr,)r r r r rIr\r[rerfs@rrrs=- ''rrc,eZdZdZdZedZdZy) ToolYScalezCTool to toggle between linear and logarithmic scales on the Y axis.zToggle scale Y axisc(tjdS)Nz keymap.yscalerr5s rr6zToolYScale.3<<+Hrc&|j|yr,) set_yscaler0axscales rrzToolYScale.set_scale erNr r r r rKrMrJrrrrrrM'KHINrrc,eZdZdZdZedZdZy) ToolXScalezCTool to toggle between linear and logarithmic scales on the X axis.zToggle scale X axisc(tjdS)Nz keymap.xscalerr5s rr6zToolXScale.rrc&|j|yr,) set_xscalers rrzToolXScale.set_scalerrNrrrrrrrrrc\eZdZdZfdZdZdZdZd dZdZ d dZ d Z d Z d Z xZS) ToolViewsPositionsa% Auxiliary Tool to handle changes in views and positions. Runs in the background and should get used by all the tools that need to access the figure's history of views and positions, e.g. * `ToolZoom` * `ToolPan` * `ToolHome` * `ToolBack` * `ToolForward` c~t|_t|_t|_t ||i|yr,)rviews positions home_viewsrUr3rVs rr3zToolViewsPositions.__init__s3&( *,+- $)&)rc |jvrtjj|<tjj|<t j |<j ||jfdyy)z;Add the current figure to the stack of views and positions.c&j|Sr,)update_home_views)figr0s rr6z/ToolViewsPositions.add_figure..sd.D.DS.IrN)rr_Stackrrr push_currentadd_axobserverr=s` r add_figurezToolViewsPositions.add_figuresl  #!&DJJv %*\\^DNN6 "&7&9DOOF #   f %  ! !"I J $rc||jvrh|j|j|j|j|j|j|j yy)zReset the Axes stack.N)rclearrrrr=s rrzToolViewsPositions.clears^ TZZ  JJv  $ $ & NN6 " ( ( * OOF # ) ) +  " " $ rc&|j|j}|y|j|j}|y|j|j}|jj }|D]"}||vr||}n||}|j |$t |j|r7|D]2}|j||dd|j||dd4|jjjy)a Update the view limits and position for each Axes from the current stack position. If any Axes are present in the figure that aren't in the current stack position, use the home view limits for those Axes and don't update *any* positions. Nroriginalactive) rr>rrget_axes _set_viewsetissubset _set_positionr:r)r0rposrall_axesacur_views r update_viewzToolViewsPositions.update_views( 4;;') = )dnnT[[)+ ; __T[[1 ;;'') "AEz 8%a= KK !  " x= ! !# & 5Aq :6Aq 84 5 $$&rc8|s |j}t}t}|jD])}|j||<|j |||<+|j |j ||j|j |y)zY Push the current view limits and position onto their respective stacks. N)r>rr _get_view _axes_posrpushr)r0r>rrrs rrzToolViewsPositions.push_current s[[F!#!" 'A{{}E!H^^A&CF ' 6& v##C(rc||jdj|jjfS)aY Return the original and modified positions for the specified Axes. Parameters ---------- ax : matplotlib.axes.Axes The `.Axes` to get the positions for. Returns ------- original_position, modified_position A tuple of the original and modified positions. T) get_positionfrozen)r0rs rrzToolViewsPositions._axes_poss6%,,.!((*, ,rc|s |j}|jD]4}||j|vs|j|j||<6y)zm Make sure that ``self.home_views`` has an entry for all Axes present in the figure. N)r>rrr)r0r>rs rrz$ToolViewsPositions.update_home_views+sP [[F" ;A//-.[[]'* ;rc|j|jj|j|jjy)z2Recall the first view and position from the stack.N)rr>homerr5s rrzToolViewsPositions.home74 4;;$$& t{{#((*rc|j|jj|j|jjy)z2Back one step in the stack of views and positions.N)rr>backrr5s rrzToolViewsPositions.back<rrc|j|jj|j|jjy)z5Forward one step in the stack of views and positions.N)rr>forwardrr5s rrzToolViewsPositions.forwardAs4 4;;'') t{{#++-rr,)r r r r r3rrrrrrrrrrerfs@rrrs; * K%'> ),$ ;+ + .rrceZdZdZdZddZy)ViewsPositionsBasez8Base class for `ToolHome`, `ToolBack` and `ToolForward`.Nc>|jjtj|jt |jjt|j |jjtjyr,)r1get_tool_views_positionsrr>r _on_triggerrrEs rrIzViewsPositionsBase.triggerLsr !!"23>>t{{K "  ))*:;   " $ !!"23??Arr,)r r r r rrIrrrrrGsBKBrrc.eZdZdZdZdZedZdZy)ToolHomez!Restore the original view limits.zReset original viewzmpl-data/images/homec(tjdS)Nz keymap.homerr5s rr6zToolHome.XrrrN r r r r rKrLrMrJrrrrrrSs+'K "EFGNKrrc.eZdZdZdZdZedZdZy)ToolBackz#Move back up the view limits stack.zBack to previous viewzmpl-data/images/backc(tjdS)Nz keymap.backrr5s rr6zToolBack.arrrNrrrrr r \s-)K "EFGNKrr c.eZdZdZdZdZedZdZy) ToolForwardz#Move forward in the view lim stack.zForward to next viewzmpl-data/images/forwardc(tjdS)Nzkeymap.forwardrr5s rr6zToolForward.js3<<8H+IrrNrrrrr#r#es-(K %EIJNKrr#ceZdZdZdZdZy)ConfigureSubplotsBasez,Base tool for the configuration of subplots.zConfigure subplotszmpl-data/images/subplotsN)r r r r rKrLrrrr&r&ns6&K &Err&c*eZdZdZdZdZedZy)SaveFigureBasezBase tool for figure saving.zSave the figurezmpl-data/images/filesavec(tjdS)Nz keymap.saverr5s rr6zSaveFigureBase.zrrN)r r r r rKrLrMrJrrrr(r(us&#K &EFGNrr(cDeZdZdZfdZddZddZdfd ZdZxZ S) ZoomPanBasez(Base class for `ToolZoom` and `ToolPan`.ct||d|_d|_d|_d|_d|_d|_d|_tj|jz |_ y)Ng@g?) rUr3_button_pressed_xypress_idPress _idRelease _idScroll base_scale scrollthreshtime lastscrollr0rWrYs rr3zZoomPanBase.__init__s[ $#  ))+d&7&77rc|jjj||jjjd|j|_|jjjd|j |_|jjjd|j|_ y)z1Connect press/release events and lock the canvas.button_press_eventbutton_release_event scroll_eventN) r>r:rr|_pressr/_releaser0 scroll_zoomr1r^s rr\zZoomPanBase.enables %%d+ **66 $++/ ++,,88 "DMM3++77 D,,.rc|j|jjjj ||jjj |j |jjj |j|jjj |jy)z7Release the canvas and disconnect press/release events.N) _cancel_actionr>r:rreleaser{r/r0r1r^s rr[zZoomPanBase.disables  %%--d3 ))$--8 ))$//: ))$..9rc@|jjtj|jt |||||jr|jjnd}|jjD]}|j|yr,) r1rrrr>rUrIrQr2upperaxesset_navigate_mode)r0rFrGrHnew_navigate_moderrYs rrIzZoomPanBase.triggersx !!"23>>t{{K t,15DIIOO-4++"" 4B  !2 3 4rc|jy|jdk(r |j}n!|jdk(rd|jz }nd}|j}|j|j|j |gt j |jz |jkr-|jjtj|jjjt j |_|jjtj!y)Nupdownr)rbuttonr2_set_view_from_bboxxyr4r5r3r1rrrr>r:rr)r0rGsclrs rr=zZoomPanBase.scroll_zooms <<   <<4 //C \\V #DOO#CC \\ #67 IIK '4+<+< <    % %&6 7 < < > $$&))+ !!"23@@Brr,) r r r r r3r\r[rIr=rerfs@rr+r+}s 2 8.:4Crr+c|eZdZdZdZdZedZejZ dZ fdZ dZ dZd Zd Zd Zd ZxZS) ToolZoomz.A Tool for zooming using a rectangle selector.zZoom to rectanglezmpl-data/images/zoom_to_rectc(tjdS)Nz keymap.zoomrr5s rr6zToolZoom.rrdefaultc,t||g|_yr,)rUr3 _ids_zoomr6s rr3zToolZoom.__init__s $rc|jD]'}|jjj|)|jj d||jjj d|_d|_g|_y)N rubberband) rSr>r:r{r1 trigger_toolrr.r-)r0zoom_ids rr?zToolZoom._cancel_actionsr~~ 7G KK   - -g 6 7 %%lD9 $$& #rc t|jr|j|jdk(rd|_n(|jdk(rd|_n|jy|j|j }}g|_t|jjD]m\}}| | |j|s|js/|js@|j j|||||jfo|jjj!d|j"}|jjj!d|j$}|jjj!d|j&}|||f|_|j(|_y)zrin_axesrcan_zoomappendrr:r| _mouse_move_switch_on_zoom_mode_switch_off_zoom_moder _zoom_mode) r0rGrKrLirid1id2id3s rr;zToolZoom._presssa >>    ! <<1 #$D \\Q #$D    ! ww1 dkk2245 BDAq !-AIIe4DNN$ $$aAq!++-%@A B kk  ,, !4#3#35kk  ,, t88:kk  ,, !;!;=c3))rcH|j|_|j|yr,)rrcr`r^s rrazToolZoom._switch_on_zoom_modes)) rc4d|_|j|yr,)rcr`r^s rrbzToolZoom._switch_off_zoom_modes rc|jr|j|j}}|jd\}}}}}tj||g||gg|j j |j j\\} } \} } |jdk(r|j j\} } n(|jdk(r|j j\} } |jjd|| | | | fyy)z3Callback for mouse moves in zoom-to-rectangle mode.rrKrLrU)rHN) r.rKrLnpclipbboxminmaxrc intervaly intervalxr1rV) r0rGrKrLlastxlastyrindviewx1y1x2y2s rr`zToolZoom._mouse_moves ==77EGGqA)-q)9 &E5!S$!#!Q(!&&**affjj"B HRhr2#%))BC'))B    ) )d"b"b)9 * ; rc|jD]'}|jjj|)g|_|js|j yg}|jD]}|j |j}}|\}}} } t||z dkst||z dkr|j ytfd|D} tfd|D} |j|jdk(rd} n|jdk(rd} nj||||f| |j| | d|_ |jjt j#|j y) z=Callback for mouse button releases in zoom-to-rectangle mode.Nc3^K|]$}jj|&ywr,)get_shared_x_axesjoined.0a1rs r z$ToolZoom._release..&'N++-44Q;N*-c3^K|]$}jj|&ywr,)get_shared_y_axesr~rs rrz$ToolZoom._release..'rrrinrYout)rSr>r:r{r.r?rKrLabsanyr_r-rJrcr1rrr)r0rGrWdone_ax cur_xypressrKrLrrrs_indrutwinxtwiny directionrs @rr<zToolZoom._releasesg~~ 7G KK   - -g 6 7}}    ! == AK77EGGqA*5 'E5!T41u9~!SU^a%7##%NgNNENgNNE NN1 ##q( %%*!  ! !5%A"6 "&//5% A) A. !!"23@@B r)r r r r rKrLrMrJrmrrdrcr3r?r;rarbr`r<rerfs@rrOrOsO8%K *EFGN  " "FK $D   ;&rrOcpeZdZdZedZdZdZejZ dZ fdZ dZ dZd Zd ZxZS) ToolPanz*Pan Axes with left mouse, zoom with right.c(tjdS)Nz keymap.panrr5s rr6zToolPan.<s3<< +Erz)Pan axes with left mouse, zoom with rightzmpl-data/images/moverQc,t||d|_yr,)rUr3rkr6s rr3zToolPan.__init__Bs $ rcd|_g|_|jjj |j |j jj||jjjyr,) r-r.r>r:r{rkr1rr@rr5s rr?zToolPan._cancel_actionFs]#  ))$--8 $$,,T2 $$&rc|jdk(rd|_n(|jdk(rd|_n|jy|j|j}}g|_t |jjD]\}}| | |j|s|js/|js@|j|||j|j j||f|jj||jj j#d|j$|_y)NrrYrz)rIr-r?rKrLr.r\r>rr]rcan_pan start_panr_r1rr:r|r`rk)r0rGrKrLrdrs rr;zToolPan._pressMs <<1 #$D \\Q #$D    ! ww1 dkk2245 =DAq !-AIIe4DNN$ Aq%,,/ $$aV,  ,,T2 $ 2 2 > >)4+;+;!=  =rc|j|jy|jjj |j |j jj||jD]\}}|j|js|jy|j jtj|jyr,)r-r?r>r:r{rkr1rr@r.end_panrrrr0rGrrs rr<zToolPan._releasebs    '    !  ))$--8 $$,,T2}} GAt IIK }}    !  !!"23@@B rc|jD]A\}}|j|j|j|j|j C|j jjyr,) r.drag_panr-rrKrLr1r:rrs rr`zToolPan._mouse_movess[}} JGAt JJt++UYY I J ))+r)r r r r rMrJrKrLrmrrdrcr3r?r;r<r`rerfs@rrr9sB4EFN=K "E \\FK'=*",rrcNeZdZdZedZdZedZdZ dZ dZ dZ y ) ToolHelpBasez*Print tool list, shortcuts and descriptionc(tjdS)Nz keymap.helprr5s rr6zToolHelpBase.}rrzmpl-data/images/helpclt|dk(r|Stjdd|jS)z Convert a shortcut string from the notation used in rc config to the standard notation for displaying shortcuts, e.g. 'ctrl+a' -> 'Ctrl+A'. rz\+[A-Z]z +Shift\g<0>)lenresubtitle) key_sequences rformat_shortcutzToolHelpBase.format_shortcuts8 !$L 1Q 6  Jz><@FFH Jrcnjj|}djfd|DS)Nz, c3@K|]}j|ywr,)r)rkeymapr0s rrz3ToolHelpBase._format_tool_keymap..sL&--f5Ls)r1get_tool_keymapjoin)r0r2keymapss` r_format_tool_keymapz ToolHelpBase._format_tool_keymaps.""2248yyLGLLLrct|jjjDcgc]/\}}|jr||j ||jf1c}}Scc}}wr,)sortedr1rritemsrKr)r0r2rws r_get_help_entrieszToolHelpBase._get_help_entriessa"()9)9)?)?)E)E)G"H%D$##t//5t7G7GH% %%s4A)c|j}|Dcgc]}dj|}}dj|Scc}w)Nz {}: {} {} )rformatr)r0entriesentrys r_get_help_textzToolHelpBase._get_help_textsF((*>EFU(>((%0FFyy!!Gs>cd}|jdddg}||jDcgc]}|j|c}z }d|dzdj|ddzd zScc}w) Nz*{}{}{}z ActionzShortcutszDescriptionz2rzrz
)rrr)r0fmtrowsrows r_get_help_htmlzToolHelpBase._get_help_htmls: /1EGH T-C-C-EFcS!FF!#'7+.$tABx.)+=> ?GsA%N) r r r rKrMrJrL staticmethodrrrrrrrrrr{s@>KFGN "EJJM% " ?rrc,eZdZdZdZedZdZy)ToolCopyToClipboardBasez)Tool to copy the figure to the clipboard.z#Copy the canvas figure to clipboardc(tjdS)Nz keymap.copyrr5s rr6z ToolCopyToClipboardBase.rrc@d}|jj||y)NzCopy tool is not available)r1r)r0rWrXrs rrIzToolCopyToClipboardBase.triggers. &&w5rNrrrrrrs37KFGN6rrrrrzoompansubplotssavegrid grid_minor fullscreenquitquit_allxscaleyscalepositionrd)rUhelpcopy navigation)rrrzoompan)rrriorcX|jD]\}}|j||y)aM Add multiple tools to a `.ToolManager`. Parameters ---------- toolmanager : `.backend_managers.ToolManager` Manager to which the tools are added. tools : {str: class_like}, optional The tools to add in a {name: tool} dict, see `.backend_managers.ToolManager.add_tool` for more info. N)radd_tool)r1rrr2rws radd_tools_to_managerrs-kkm) dT4()rcd|D]+\}}t|D]\}}|j|||-y)a Add multiple tools to the container. Parameters ---------- container : Container `.backend_bases.ToolContainerBase` object that will get the tools added. tools : list, optional List in the form ``[[group1, [tool1, tool2 ...]], [group2, [...]]]`` where the tools ``[tool1, tool2, ...]`` will display in group1. See `.backend_bases.ToolContainerBase.add_tool` for details. N)r\r) containerrrgroup grouptoolsrrws radd_tools_to_containerrsB#6z' 3 6NHd   tUH 5 66rr,)7r rrrr4typesrrweakrefrnumpyrk matplotlibrtmatplotlib._pylab_helpersrrrIntEnumr rmrrrr'rr*rOrhrrrrrrrrrrrrrr r#r&r(r+rOrrr default_toolsdefault_toolbar_toolsrrrrrrs   ! %)""dll" V V rT%XT%n/5H/5d668 X 8%x%( Kx K KH K8X8'N'"@.@.F B B!!$'H'HXH@C.@CFv{vr?,k?,D#?8#?L6h668Y #('2  }  ~ [::/"#5= .%0! &'(CD#%@A 013 -:)"-B6r