File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ library
2525 exposed-modules : Graphics.Matplotlib.Internal
2626 , Graphics.Matplotlib
2727 build-depends : base >=  4.7  &&  <  5 
28+  , deepseq
2829 , process
2930 , bytestring
3031 , aeson
Original file line number Diff line number Diff line change @@ -444,7 +444,7 @@ zlabel label = mp # "ax.set_zlabel(" # raw label ## ")"
444444
445445setSizeInches w h =  mp #  " fig.set_size_inches(" #  w #  " ," #  h #  " , forward=True)" 
446446
447- tightLayout =  mp #  " fig.tight_layout()" 
447+ tightLayout =  mp #  " fig.tight_layout("   ##   " )" 
448448
449449xkcd =  mp #  " plot.xkcd()" 
450450
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import System.IO.Temp
88import  System.Process 
99import  Data.Aeson 
1010import  Control.Monad 
11+ import  Control.DeepSeq 
1112import  System.IO 
1213import  qualified  Data.ByteString.Lazy  as  B 
1314import  Data.List 
@@ -36,6 +37,9 @@ instance Monoid Matplotlib where
3637 mempty  =  mp
3738 mappend  =  (%) 
3839
40+ instance  NFData  Matplotlib  where 
41+  rnf (Matplotlib  cs po re) =  rnf cs `seq`  rnf po `seq`  rnf re
42+ 
3943--  |  A maplotlib command, right now we have a very shallow embedding essentially 
4044--  dealing in strings containing python code as well as the ability to load 
4145--  data. The loaded data should be a json object. 
@@ -44,6 +48,11 @@ data MplotCommand =
4448 | forall  x .  MplotImage  x  =>  LoadImage  x 
4549 | Exec  {  es  ::  String } 
4650
51+ instance  NFData  MplotCommand  where 
52+  rnf (LoadData  b) =  rnf b
53+  rnf (Exec  es) =  rnf es
54+  --  don't care too much about the LoadImage
55+ 
4756--  |  Throughout the API we need to accept options in order to expose 
4857--  matplotlib's many configuration options. 
4958data  Option  = 
                         You can’t perform that action at this time. 
           
                  
0 commit comments