[Scipy-tickets] [SciPy] #605: pylab issuing a "reset" to IPython (or Idle) when trying to print a histogram title with the char ">" in it

SciPy scipy-tickets@scipy....
Fri Feb 15 18:47:15 CST 2008


#605: pylab issuing a "reset" to IPython (or Idle) when trying to print a
histogram title with the char ">" in it
---------------------+------------------------------------------------------
 Reporter:  kmckiou  |       Owner:  somebody
     Type:  defect   |      Status:  new     
 Priority:  normal   |   Milestone:  0.7     
Component:  Other    |     Version:          
 Severity:  normal   |    Keywords:          
---------------------+------------------------------------------------------
 Code:
 def plothist(n, bins=10, mlabel='myplot', normed=False, mdir=None):
     """
     This is a wrapper for the pylab.hist()  function in which we do some
     customization of the plot.
     n = the data to be binned.
     bins= integer indicating the number of equal spaced bins.
     mlable = a label to put on the plot
     showit=True if a plot is to be displayed
     mdir= directory for saving the plot.  if it is None, no plot will be
 saved
     """
     itype=type(10)
     if type(bins)!=itype:
         raise ValueError('bins must be an integer indicating the number of
 bins')

     bins=_gethistbins(n,bins) #convert bins to an array

     #make label is a string
     mlabel=str(mlabel)

     #create a figure
     f1=pylab.figure(num=1,figsize=(12,6), dpi=80, facecolor='white',
     edgecolor='black',frameon=True)

     #create the axes in the figure matplotlib.axes
     ax=f1.add_subplot(111)  #there is only one subplot

     #Turn grid on
     ax.grid(b=True)

     #Set the title
     ax.set_title(mlabel)

     #plot the histogram

     ax.hist(n, bins=bins, normed=normed)

     show()

     if mdir != None:
         pylab.savefig(mdir+'\\'+ mlabel+'.png')

     return #plot object

 -----
 mlabel = 'PS IRAT HO Success Rate (UMTS -> GSM)'

 Causes IPython to Exit and Idle to Reset.  If I remove the '>' character,
 all is well again.

 I attached a file of data that I am histogramming associated with this
 title.

-- 
Ticket URL: <http://scipy.org/scipy/scipy/ticket/605>
SciPy <http://www.scipy.org/>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list