Mercurial > repos > devteam > scatterplot
diff scatterplot.py @ 3:1dacc8aeb452 draft
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/scatterplot commit 93df3895fbf2fa44ff279303093fb89b79081687
author | devteam |
---|---|
date | Thu, 15 Sep 2016 05:36:51 -0400 |
parents | 53eb2c412783 |
children | 113045fca1aa |
line wrap: on
line diff
--- a/scatterplot.py Fri Dec 18 19:14:12 2015 -0500 +++ b/scatterplot.py Thu Sep 15 05:36:51 2016 -0400 @@ -4,7 +4,12 @@ import sys from numpy import array -from rpy import r +import rpy2.rpy_classic as rpy +from rpy2.robjects.numpy2ri import numpy2ri + + +rpy.set_default_mode(rpy.NO_CONVERSION) +r = rpy.r def stop_err(msg): @@ -65,8 +70,9 @@ if skipped_lines < i: try: + a = numpy2ri(array( matrix )) r.pdf( out_fname, 8, 8 ) - r.plot( array( matrix ), type="p", main=title, xlab=xlab, ylab=ylab, col="blue", pch=19 ) + r.plot( a, type="p", main=title, xlab=xlab, ylab=ylab, col="blue", pch=19 ) r.dev_off() except Exception, exc: stop_err( "%s" % str( exc ) ) @@ -77,7 +83,5 @@ if skipped_lines > 0: print "Skipped %d lines starting with line #%d, value '%s' in column %d is not numeric." % ( skipped_lines, first_invalid_line, invalid_value, invalid_column ) - r.quit( save="no" ) - if __name__ == "__main__": main()