Author: tlinnet Date: Fri Nov 28 14:31:58 2014 New Revision: 26807 URL: http://svn.gna.org/viewcvs/relax?rev=26807&view=rev Log: Added pipe_control function to handle the call to plot of histogram. Task #7873 (https://gna.org/task/index.php?7873): Write wrapper function to nmrglue, to read .ft2 files and process them. Homepage: http://www.nmrglue.com/ Link to nmrglue discussion: https://groups.google.com/forum/#!forum/nmrglue-discuss The code is develop at Github: https://github.com/jjhelmus/nmrglue/ Google code: https://code.google.com/p/nmrglue/ Documentation: http://nmrglue.readthedocs.org/en/latest/index.html Modified: branches/nmrglue/pipe_control/nmrglue.py Modified: branches/nmrglue/pipe_control/nmrglue.py URL: http://svn.gna.org/viewcvs/relax/branches/nmrglue/pipe_control/nmrglue.py?rev=26807&r1=26806&r2=26807&view=diff ============================================================================== --- branches/nmrglue/pipe_control/nmrglue.py (original) +++ branches/nmrglue/pipe_control/nmrglue.py Fri Nov 28 14:31:58 2014 @@ -24,7 +24,7 @@ # relax module imports. from lib.errors import RelaxError -from lib.software.nmrglue import contour_plot, read_spectrum +from lib.software.nmrglue import contour_plot, hist_plot, read_spectrum from pipe_control.pipes import check_pipe from pipe_control.spectrum import add_spectrum_id, check_spectrum_id, delete @@ -99,3 +99,21 @@ # Return the axis instance, for possibility for additional decoration. return ax + +def plot_hist(ndarray=None, show=False): + """Flatten the 2D numpy array, and plot as histogram. + + @keyword ndarray: The numpy array to flatten, and plot as histogram. + @type ndarray: numpy array + @keyword show: A flag which if True will make a call to matplotlib.pyplot.show(). + @type show: bool + @return: The matplotlib.axes.AxesSubplot class, which can be manipulated to add additional text to the axis. + @rtype: matplotlib.axes.AxesSubplot + """ + + # Call the contour plot. + ax = hist_plot(ndarray=ndarray, show=show) + + # Return the axis instance, for possibility for additional decoration. + return ax +