""" Plottools.py c odenthal 2005/05/30 Some custom plotting routines using the 'rpy' interface to 'R' meant to be useful in cryptanalysis. """ import rpy, string import counts, stringtools def freqPlot(strng): strng = strng.upper() countList = [ strng.count(char) for char in string.ascii_uppercase ] rpy.r.plot(countList, type='h', ylab = "") return def lstPlot(lst): rpy.r.plot(lst, type='h', ylab = "") def englishFreqPlot(): itemList = counts.englishLetterFrequencies.items() itemList.sort() countList = [ f for (k,f) in itemList ] rpy.r.plot(countList, type='h', ylab="") return