@@ -123,15 +123,19 @@ def ReplotPattern(G2frame,newPlot,plotType,PatternName=None,PickName=None):
123123def plotVline (Page ,Plot ,Lines ,Parms ,pos ,color ,pick ,style = 'dotted' ):
124124 '''shortcut to plot vertical lines for limits & Laue satellites.
125125 Was used for extrapeaks'''
126+ if pick :
127+ pickradius = 2.
128+ else :
129+ pickradius = False
126130 if Page .plotStyle ['qPlot' ]:
127131 Lines .append (Plot .axvline (2. * np .pi / G2lat .Pos2dsp (Parms ,pos ),color = color ,
128- picker = pick , pickradius = 2. ,linestyle = style ))
132+ picker = pickradius ,linestyle = style ))
129133 elif Page .plotStyle ['dPlot' ]:
130134 Lines .append (Plot .axvline (G2lat .Pos2dsp (Parms ,pos ),color = color ,
131- picker = pick , pickradius = 2. ,linestyle = style ))
135+ picker = pickradius ,linestyle = style ))
132136 else :
133137 Lines .append (Plot .axvline (pos ,color = color ,
134- picker = pick , pickradius = 2. ,linestyle = style ))
138+ picker = pickradius ,linestyle = style ))
135139
136140def PlotPatterns (G2frame ,newPlot = False ,plotType = 'PWDR' ,data = None ,
137141 extraKeys = [],refineMode = False ,indexFrom = '' ,fromTree = False ):
@@ -1188,7 +1192,7 @@ def OnRelease(event):
11881192 axis = Page .figure .axes [1 ]
11891193 else :
11901194 axis = Page .figure .gca ()
1191- axis .plot (event .xdata ,event .ydata ,'rD' ,clip_on = Clip_on ,picker = True , pickradius = 3. )
1195+ axis .plot (event .xdata ,event .ydata ,'rD' ,clip_on = Clip_on ,picker = 3. )
11921196 Page .canvas .draw ()
11931197 return
11941198 elif G2frame .itemPicked is not None : # end of drag in move
@@ -2207,7 +2211,7 @@ def onPartialConfig(event):
22072211 continue
22082212 # magnification region marker
22092213 magMarkers .append (Plot .axvline (x ,color = '0.5' ,dashes = (1 ,1 ),
2210- picker = True , pickradius = 2. ,label = '_magline' ))
2214+ picker = 2. ,label = '_magline' ))
22112215 lbl = Plot .annotate ("x{}" .format (ml ), xy = (x , tpos ), xycoords = ("data" , "axes fraction" ),
22122216 verticalalignment = 'bottom' ,horizontalalignment = halign ,label = '_maglbl' )
22132217 Plot .magLbls .append (lbl )
@@ -2254,13 +2258,13 @@ def onPartialConfig(event):
22542258 lims = G2lat .Pos2dsp (Parms ,lims )
22552259 if GSASIIpath .GetConfigValue ('debug' ): print ('PlotPatterns 9.64b' ,lims )
22562260 # limit lines
2257- Lines .append (Plot .axvline (lims [0 ][0 ],color = 'g' ,dashes = (5 ,5 ),picker = True , pickradius = 3. ))
2258- Lines .append (Plot .axvline (lims [0 ][1 ],color = 'r' ,dashes = (5 ,5 ),picker = True , pickradius = 3. ))
2261+ Lines .append (Plot .axvline (lims [0 ][0 ],color = 'g' ,dashes = (5 ,5 ),picker = 3. ))
2262+ Lines .append (Plot .axvline (lims [0 ][1 ],color = 'r' ,dashes = (5 ,5 ),picker = 3. ))
22592263 if GSASIIpath .GetConfigValue ('debug' ): print ('PlotPatterns 9.64c' )
22602264 # excluded region lines
22612265 for i ,item in enumerate (lims [1 :]):
2262- Lines .append (Plot .axvline (item [0 ],color = 'm' ,dashes = (5 ,5 ),picker = True , pickradius = 3. ))
2263- Lines .append (Plot .axvline (item [1 ],color = 'm' ,dashes = (5 ,5 ),picker = True , pickradius = 3. ))
2266+ Lines .append (Plot .axvline (item [0 ],color = 'm' ,dashes = (5 ,5 ),picker = 3. ))
2267+ Lines .append (Plot .axvline (item [1 ],color = 'm' ,dashes = (5 ,5 ),picker = 3. ))
22642268 exclLines += [2 * i + 2 ,2 * i + 3 ]
22652269 if GSASIIpath .GetConfigValue ('debug' ): print ('PlotPatterns 9.65' ,N )
22662270 if G2frame .Contour :
@@ -2393,7 +2397,7 @@ def onPartialConfig(event):
23932397 DZ = (xye [1 ]- xye [3 ])* np .sqrt (wtFactor * xye [2 ])
23942398 if 'PWDR' in plottype and len (limits [2 :]):
23952399 DZ = ma .array (DZ ,mask = Emask ) # weighted difference is always masked
2396- DifLine = Plot1 .plot (X ,DZ ,pwdrCol ['Diff_color' ],picker = True , pickradius = 1. ,label = incCptn ('diff' )) #(Io-Ic)/sig(Io)
2400+ DifLine = Plot1 .plot (X ,DZ ,pwdrCol ['Diff_color' ],picker = 1. ,label = incCptn ('diff' )) #(Io-Ic)/sig(Io)
23972401 Plot1 .tick_params (labelsize = 14 )
23982402 Plot1 .axhline (0. ,color = 'k' )
23992403
@@ -2403,7 +2407,7 @@ def onPartialConfig(event):
24032407 Plot .set_yscale ("log" ,nonpositive = 'mask' ) # >=3.3
24042408 except :
24052409 Plot .set_yscale ("log" ,nonpositive = 'mask' )
2406- Plot .plot (X ,Y ,marker = pP ,color = pwdrCol ['Obs_color' ],linewidth = lW ,picker = True , pickradius = 3. ,
2410+ Plot .plot (X ,Y ,marker = pP ,color = pwdrCol ['Obs_color' ],linewidth = lW ,picker = 3. ,
24072411 clip_on = Clip_on ,label = incCptn ('obs' ))
24082412 if G2frame .SinglePlot or G2frame .plusPlot == 1 or G2frame .plusPlot == 2 :
24092413 Plot .plot (X ,Z ,pwdrCol ['Calc_color' ],picker = False ,label = incCptn ('calc' ),linewidth = 1.5 )
@@ -2420,14 +2424,14 @@ def onPartialConfig(event):
24202424 if Page .plotStyle ['sqPlot' ]:
24212425 Plot .errorbar (X ,YB ,yerr = X ** 4 * Sample ['Scale' ][0 ]* np .sqrt (1. / (Pattern [0 ]['wtFactor' ]* xye [2 ])),
24222426 ecolor = pwdrCol ['Obs_color' ],
2423- picker = True , pickradius = 3. ,clip_on = Clip_on )
2427+ picker = 3. ,clip_on = Clip_on )
24242428 else :
24252429 Plot .errorbar (X ,YB ,yerr = Sample ['Scale' ][0 ]* np .sqrt (1. / (Pattern [0 ]['wtFactor' ]* xye [2 ])),
24262430 ecolor = pwdrCol ['Obs_color' ],
2427- picker = True , pickradius = 3. ,clip_on = Clip_on ,label = incCptn ('obs' ))
2431+ picker = 3. ,clip_on = Clip_on ,label = incCptn ('obs' ))
24282432 else :
24292433 Plot .plot (X ,YB ,marker = pP ,color = pwdrCol ['Obs_color' ],linewidth = lW ,
2430- picker = True , pickradius = 3. ,clip_on = Clip_on ,label = incCptn ('obs' ))
2434+ picker = 3. ,clip_on = Clip_on ,label = incCptn ('obs' ))
24312435 Plot .plot (X ,W ,pwdrCol ['Calc_color' ],picker = False ,label = incCptn ('bkg' ),linewidth = 1.5 ) #const. background
24322436 Plot .plot (X ,ZB ,pwdrCol ['Bkg_color' ],picker = False ,label = incCptn ('calc' ),linewidth = 1.5 )
24332437 else : # not logPlot
@@ -2444,13 +2448,13 @@ def onPartialConfig(event):
24442448 label = incCptn ('calc-bkg' ),linewidth = 1.5 ) #Ic-Ib
24452449 else :
24462450 Plot .plot (X ,YB ,color = pwdrCol ['Obs_color' ],marker = pP ,linewidth = lW ,
2447- picker = True , pickradius = 3. ,clip_on = Clip_on ,label = incCptn ('obs' ))
2451+ picker = 3. ,clip_on = Clip_on ,label = incCptn ('obs' ))
24482452 Plot .plot (X ,ZB ,pwdrCol ['Bkg_color' ],picker = False ,label = incCptn ('calc' ),linewidth = 1.5 )
24492453 else :
24502454 if 'PWDR' in plottype :
24512455 if G2frame .plusPlot != 3 :
24522456 ObsLine = Plot .plot (Xum ,Y / ymax ,color = pwdrCol ['Obs_color' ],marker = pP ,linewidth = lW ,
2453- picker = True , pickradius = 3. ,clip_on = Clip_on ,label = incCptn ('obs' )) #Io
2457+ picker = 3. ,clip_on = Clip_on ,label = incCptn ('obs' )) #Io
24542458 CalcLine = Plot .plot (X ,Z / ymax ,pwdrCol ['Calc_color' ],
24552459 picker = False ,label = incCptn ('calc' ),linewidth = 1.5 ) #Ic
24562460 else : # waterfall mode=3: plot 1st pattern like others, name in legend?
@@ -2460,13 +2464,13 @@ def onPartialConfig(event):
24602464 picker = False ,clip_on = Clip_on ,label = incCptn (name )) #Io
24612465 else :
24622466 Plot .plot (X ,YB ,color = pwdrCol ['Obs_color' ],marker = pP ,linewidth = lW ,
2463- picker = True , pickradius = 3. ,clip_on = Clip_on ,label = incCptn ('obs' ))
2467+ picker = 3. ,clip_on = Clip_on ,label = incCptn ('obs' ))
24642468 Plot .plot (X ,ZB ,pwdrCol ['Bkg_color' ],picker = False ,label = incCptn ('calc' ),linewidth = 1.5 )
24652469 if 'PWDR' in plottype and (G2frame .SinglePlot and G2frame .plusPlot ):
24662470 BackLine = Plot .plot (X ,W / ymax ,pwdrCol ['Bkg_color' ],picker = False ,label = incCptn ('bkg' ),linewidth = 1.5 ) #Ib
24672471 if not G2frame .Weight and np .any (Z ):
24682472 DifLine = Plot .plot (X ,D / ymax ,pwdrCol ['Diff_color' ],linewidth = 1.5 ,
2469- picker = True , pickradius = 1. ,label = incCptn ('diff' )) #Io-Ic
2473+ picker = 1. ,label = incCptn ('diff' )) #Io-Ic
24702474 Plot .axhline (0. ,color = 'k' ,label = '_zero' )
24712475
24722476 Plot .tick_params (labelsize = 14 )
@@ -2731,7 +2735,7 @@ def onPartialConfig(event):
27312735 xtick = peak .T [1 ]
27322736 if Page .plotStyle .get ('flTicks' ,0 ) == 0 : # short tick-marks
27332737 Page .tickDict [phase ],_ = Plot .plot (
2734- xtick ,pos ,'|' ,mew = w ,ms = l ,picker = True , pickradius = 3. ,
2738+ xtick ,pos ,'|' ,mew = w ,ms = l ,picker = 3. ,
27352739 label = phase ,color = plcolor )
27362740 # N.B. above creates two Line2D objects, 2nd is ignored.
27372741 # Not sure what each does.
@@ -2742,7 +2746,7 @@ def onPartialConfig(event):
27422746 label = phase ,color = plcolor )[0 ]
27432747 for xt in xtick : # a separate line for each reflection position
27442748 Plot .axvline (xt ,color = plcolor ,
2745- picker = True , pickradius = 3. ,
2749+ picker = 3. ,
27462750 label = '_FLT_' + phase ,lw = 0.5 )
27472751 handles ,legends = Plot .get_legend_handles_labels ()
27482752 if handles :
@@ -2842,7 +2846,7 @@ def onPartialConfig(event):
28422846 x = G2lat .Dsp2pos (Parms ,x )
28432847 else :
28442848 break
2845- Plot .plot (x ,y * mult ,'rD' ,clip_on = Clip_on ,picker = True , pickradius = 10. )
2849+ Plot .plot (x ,y * mult ,'rD' ,clip_on = Clip_on ,picker = 10. )
28462850
28472851 # plot the partials
28482852 plotOpt ['lineList' ] = ['obs' ,'calc' ,'bkg' ,'zero' ,'diff' ]
0 commit comments