Changeset 4006 for trunk/GSASIIplot.py
- Timestamp:
- May 30, 2019 8:20:35 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIplot.py
r4005 r4006 277 277 squeeze=True, subplot_kw=None, gridspec_kw=None): 278 278 """ 279 Copy of Figure.figure.subplots from matplotlib.figure.py 279 Add a set of subplots to this figure. 280 281 This is a copy of Figure.figure.subplots from matplotlib.figure.py. 280 282 Included here because this appears only in later versions of 281 matplotlib. When v2.2 is standard, this can be removed from GSAS-II 282 283 Add a set of subplots to this figure. 284 285 :param nrows, ncols : int, default: 1 283 matplotlib. When v2.2 is standard, this should be removed from GSAS-II. 284 285 :param int nrows, ncols: default: 1 286 286 Number of rows/cols of the subplot grid. 287 :param sharex, sharey : bool or {'none', 'all', 'row', 'col'}, default: False 287 :param bool/str sharex, sharey: True/False or {'none', 'all', 'row', 'col'}, default: False 288 288 289 Controls sharing of properties among x (`sharex`) or y (`sharey`) 289 290 axes: … … 300 301 subplots have a shared y-axis along a row, only the y tick labels 301 302 of the first column subplot are visible. 302 :param squeeze : bool, default: True 303 :param bool squeeze: default: True 304 303 305 - If True, extra dimensions are squeezed out from the returned 304 306 axis object: … … 316 318 up being 1x1. 317 319 318 :param subplot_kw : dict,default: {}320 :param dict subplot_kw: default: {} 319 321 Dict with keywords passed to the 320 :meth:` ~matplotlib.figure.Figure.add_subplot` call used to create322 :meth:`matplotlib.figure.Figure.add_subplot` call used to create 321 323 each subplots. 322 :param gridspec_kw : dict,default: {}324 :param dict gridspec_kw: default: {} 323 325 Dict with keywords passed to the 324 :class:` ~matplotlib.gridspec.GridSpec` constructor used to create326 :class:`matplotlib.gridspec.GridSpec` constructor used to create 325 327 the grid the subplots are placed on. 326 328 327 :return : ax : single Axes object or array of Axes objects328 The added axes. The dimensions of the resulting array can be329 :returns: A single Axes object or array of Axes objects with 330 the added axes. The dimensions of the resulting array can be 329 331 controlled with the squeeze keyword, see above. 330 332 331 See Also pyplot.subplots: pyplot API; docstring includes examples.333 See also: pyplot.subplots: pyplot API; docstring includes examples. 332 334 333 335 """ … … 6384 6386 def Draw(): 6385 6387 global Title,xLabel,yLabel 6386 G2frame.G2plotNB.status.SetStatusText( \6388 G2frame.G2plotNB.status.SetStatusText( 6387 6389 'press L to toggle lines, S to select X axis, T to change titles (reselect column to show?)',1) 6388 6390 Plot.clear() … … 6391 6393 if G2frame.seqXaxis is not None: 6392 6394 xName,X,Xsig = Page.seqTableGet(G2frame.seqXaxis) 6395 if G2frame.seqReverse and not G2frame.seqXaxis: 6396 X = X[::-1] 6393 6397 else: 6394 6398 X = np.arange(0,G2frame.SeqTable.GetNumberRows(),1) … … 6397 6401 Ncol = colors[ic%6] 6398 6402 name,Y,sig = Page.seqTableGet(col) 6399 # deal with missing (None) values 6403 if G2frame.seqReverse and not G2frame.seqXaxis: 6404 Y = Y[::-1] 6405 sig = sig[::-1] 6406 # deal with missing (None) values in arrays 6400 6407 Xnew = [] 6401 6408 Ynew = [] 6402 6409 Ysnew = [] 6410 gotsig = False 6403 6411 for i in range(len(X)): 6404 6412 if not uselist[i]: 6405 6413 continue 6406 6414 if X[i] is None or Y[i] is None: 6407 if Ysnew:6408 if G2frame.seqReverse and not G2frame.seqXaxis:6409 Ynew = Ynew[::-1]6410 Ysnew = Ysnew[::-1]6411 if G2frame.seqLines:6412 Plot.errorbar(Xnew,Ynew,yerr=Ysnew,color=Ncol)6413 else:6414 Plot.errorbar(Xnew,Ynew,yerr=Ysnew,linestyle='None',color=Ncol,marker='x')6415 else:6416 if G2frame.seqReverse and not G2frame.seqXaxis:6417 Ynew = Ynew[::-1]6418 Plot.plot(Xnew,Ynew,color=Ncol)6419 Plot.plot(Xnew,Ynew,'o',color=Ncol)6420 Xnew = []6421 Ynew = []6422 Ysnew = []6423 6415 continue 6424 6416 Xnew.append(X[i]) 6425 6417 Ynew.append(Y[i]) 6426 if sig: Ysnew.append(sig[i]) 6427 if Ysnew: 6428 if G2frame.seqReverse and not G2frame.seqXaxis: 6429 Ynew = Ynew[::-1] 6430 Ysnew = Ysnew[::-1] 6418 if sig[i]: 6419 gotsig = True 6420 Ysnew.append(sig[i]) 6421 else: 6422 Ysnew.append(0.0) 6423 if gotsig: 6431 6424 if G2frame.seqLines: 6432 6425 Plot.errorbar(Xnew,Ynew,yerr=Ysnew,color=Ncol,label=name) … … 6434 6427 Plot.errorbar(Xnew,Ynew,yerr=Ysnew,label=name,linestyle='None',color=Ncol,marker='x') 6435 6428 else: 6436 if G2frame.seqReverse and not G2frame.seqXaxis:6437 Ynew = Ynew[::-1]6438 6429 Plot.plot(Xnew,Ynew,color=Ncol) 6439 6430 Plot.plot(Xnew,Ynew,'o',color=Ncol,label=name)
Note: See TracChangeset
for help on using the changeset viewer.