changeset 177:c2c86c37eadd

this now works on Mac
author Jeff Hammel <k0scist@gmail.com>
date Thu, 10 Mar 2016 13:05:24 -0800
parents f9c87cba1df3
children 30d820087ae8
files README.txt numerics/plot.py
diffstat 2 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/README.txt	Thu Mar 10 12:36:26 2016 -0800
+++ b/README.txt	Thu Mar 10 13:05:24 2016 -0800
@@ -10,8 +10,17 @@
 
 === OSX ===
 
+For matplotlib:
+
 http://superuser.com/questions/242190/how-to-install-matplotlib-on-os-x
 
+You may also have to manually refresh the font cache:
+
+    cd ~/.matplotlib/
+    fc-list  # Should take a couple minutes.
+
+(From: http://stackoverflow.com/questions/17490444/import-matplotlib-pyplot-hangs )
+
 == Libraries ==
 
 The following libraries, listed by language, may be worth investigating.
--- a/numerics/plot.py	Thu Mar 10 12:36:26 2016 -0800
+++ b/numerics/plot.py	Thu Mar 10 13:05:24 2016 -0800
@@ -75,6 +75,10 @@
     Accepts CSV and space-delimited files
     """
 
+    if isinstance(f, string):
+        with open(f, 'r') as _f:
+            return read(_f)
+
     retval = None
     for line in f:
         line = line.strip()
@@ -144,5 +148,6 @@
     # display plot, I guess
     plt.show()
 
+
 if __name__ == '__main__':
     main()