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
25
25
exposed-modules : Graphics.Matplotlib.Internal
26
26
, Graphics.Matplotlib
27
27
build-depends : base >= 4.7 && < 5
28
+ , deepseq
28
29
, process
29
30
, bytestring
30
31
, aeson
Original file line number Diff line number Diff line change @@ -444,7 +444,7 @@ zlabel label = mp # "ax.set_zlabel(" # raw label ## ")"
444
444
445
445
setSizeInches w h = mp # " fig.set_size_inches(" # w # " ," # h # " , forward=True)"
446
446
447
- tightLayout = mp # " fig.tight_layout()"
447
+ tightLayout = mp # " fig.tight_layout(" ## " )"
448
448
449
449
xkcd = mp # " plot.xkcd()"
450
450
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import System.IO.Temp
8
8
import System.Process
9
9
import Data.Aeson
10
10
import Control.Monad
11
+ import Control.DeepSeq
11
12
import System.IO
12
13
import qualified Data.ByteString.Lazy as B
13
14
import Data.List
@@ -36,6 +37,9 @@ instance Monoid Matplotlib where
36
37
mempty = mp
37
38
mappend = (%)
38
39
40
+ instance NFData Matplotlib where
41
+ rnf (Matplotlib cs po re) = rnf cs `seq` rnf po `seq` rnf re
42
+
39
43
-- | A maplotlib command, right now we have a very shallow embedding essentially
40
44
-- dealing in strings containing python code as well as the ability to load
41
45
-- data. The loaded data should be a json object.
@@ -44,6 +48,11 @@ data MplotCommand =
44
48
| forall x . MplotImage x => LoadImage x
45
49
| Exec { es :: String }
46
50
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
+
47
56
-- | Throughout the API we need to accept options in order to expose
48
57
-- matplotlib's many configuration options.
49
58
data Option =
You can’t perform that action at this time.
0 commit comments