File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -70,16 +70,17 @@ where
70
70
import Data.List
71
71
import Data.Aeson
72
72
import Graphics.Matplotlib.Internal
73
+ import Control.Concurrent (forkIO )
73
74
74
75
-- * Running a plot
75
76
76
77
-- | Show a plot, blocks until the figure is closed
77
- onscreen :: Matplotlib -> IO (Either String String )
78
- onscreen m = withMplot m (\ s -> python $ pyIncludes " " ++ s ++ pyDetach ++ pyOnscreen )
78
+ onscreen :: Matplotlib -> IO ()
79
+ onscreen m = (forkIO $ ( withMplot m (\ s -> python $ pyIncludes " " ++ s ++ pyOnscreen) >> return () )) >> return ( )
79
80
80
81
-- | Print the python code that would be executed
81
82
code :: Matplotlib -> IO String
82
- code m = withMplot m (\ s -> return $ unlines $ pyIncludes (pyBackend " agg" ) ++ s ++ pyDetach ++ pyOnscreen)
83
+ code m = withMplot m (\ s -> return $ unlines $ pyIncludes (pyBackend " agg" ) ++ s ++ pyOnscreen)
83
84
84
85
-- | Save to a file
85
86
file :: [Char ] -> Matplotlib -> IO (Either String String )
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ resolvePending m = m { mpCommands =
64
64
65
65
-- | The io action is given a list of python commands to execute (note that
66
66
-- these are commands in the sense of lines of python code; each inidivudal line
67
- -- may not be parseable on its own
67
+ -- may not be parseable on its own)
68
68
withMplot :: Matplotlib -> ([String ] -> IO a ) -> IO a
69
69
withMplot m f = preload cs []
70
70
where
You can’t perform that action at this time.
0 commit comments