Changeset 4366 for trunk/GSASIIplot.py
- Timestamp:
- Mar 13, 2020 5:44:04 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIplot.py
r4356 r4366 5380 5380 ################################################################################ 5381 5381 5382 def PlotBarGraph(G2frame,Xarray,Xname='', Title='',PlotName=None):5382 def PlotBarGraph(G2frame,Xarray,Xname='',Yname='Number',Title='',PlotName=None,ifBinned=False): 5383 5383 'Needs a description' 5384 5384 … … 5405 5405 Page.canvas.mpl_connect('motion_notify_event', OnMotion) 5406 5406 Page.Choice = None 5407 nBins= max(10,len(Xarray)//10) 5408 Bins,Dbins = np.histogram(Xarray,nBins) 5409 wid = Dbins[1]-Dbins[0] 5407 if ifBinned: 5408 Dbins,Bins = Xarray 5409 nBins = len(Dbins) 5410 wid = Dbins[1]-Dbins[0] 5411 else: 5412 nBins= max(10,len(Xarray)//10) 5413 Bins,Dbins = np.histogram(Xarray,nBins) 5414 wid = Dbins[1]-Dbins[0] 5415 Dbins = Dbins[:-1] 5410 5416 Plot.set_title(Title) 5411 5417 Plot.set_xlabel(Xname,fontsize=14) 5412 Plot.set_ylabel( r'$Number$',fontsize=14)5413 Plot.bar(Dbins [:-1],Bins,width=wid,align='edge',facecolor='red',edgecolor='black')5418 Plot.set_ylabel(Yname,fontsize=14) 5419 Plot.bar(Dbins,Bins,width=wid,align='edge',facecolor='red',edgecolor='black') 5414 5420 Page.canvas.draw() 5415 5421
Note: See TracChangeset
for help on using the changeset viewer.