Changeset 4366 for trunk/GSASIIplot.py


Ignore:
Timestamp:
Mar 13, 2020 5:44:04 AM (23 months ago)
Author:
vondreele
Message:

Add plotting of bond distance & bond angle distributions found in potential energy restraint in RMCProfile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r4356 r4366  
    53805380################################################################################
    53815381           
    5382 def PlotBarGraph(G2frame,Xarray,Xname='',Title='',PlotName=None):
     5382def PlotBarGraph(G2frame,Xarray,Xname='',Yname='Number',Title='',PlotName=None,ifBinned=False):
    53835383    'Needs a description'
    53845384   
     
    54055405        Page.canvas.mpl_connect('motion_notify_event', OnMotion)
    54065406    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]
    54105416    Plot.set_title(Title)
    54115417    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')
    54145420    Page.canvas.draw()
    54155421
Note: See TracChangeset for help on using the changeset viewer.