abarbu / matplotlib-haskell

Haskell bindings for Python's Matplotlib
Other
85 stars 12 forks source link

subplots generate empty figures #10

Open CDSoft opened 4 years ago

CDSoft commented 4 years ago

Hello,

I'm new to both matplotlib and matplotlib-haskell. When I use subplots to generate several plots in a single figure, I get two figures in two different windows. The first one is empty, the second one contains all the plots I expect. Did I miss something or is it a known issue?

Regards, Christophe.

e.g.:

#!/usr/bin/env stack
-- stack --resolver lts-16.7 script

{-# LANGUAGE ExtendedDefaultRules #-}

import Graphics.Matplotlib

main :: IO ()
main = do
    onscreen $
        subplots @@ [o2 "nrows" 2, o2 "ncols" 2]
        % setSubplot 0 % plotMapLinear (**0) (-2) 2 100
        % setSubplot 1 % plotMapLinear (**1) (-2) 2 100
        % setSubplot 2 % plotMapLinear (**2) (-2) 2 100
        % setSubplot 3 % plotMapLinear (**3) (-2) 2 100

image