Hi
I have the following program
----------------------------------------------------------------------------------------------------------------------------------------
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}
import Diagrams.Prelude
import Diagrams.Backend.Rasterific.CmdLine
type Dia = Diagram B
-- Horizontal line
xaxis :: Double -> Double -> Dia
xaxis xmin xmax = fromVertices lims # strokeLine # lc white
where
vert = [(xmin -1, 0), (xmax + 1, 0)]
lims = map p2 vert
-- vertical line
yaxis :: Double -> Double -> Dia
yaxis ymin ymax = fromVertices lims # strokeLine # lc white
where
vert = [(0, ymin -1), (0, ymax + 1)]
lims = map p2 vert
-- reference frame
refFrame :: Double -> Double -> Double -> Double -> Dia
refFrame xmin xmax ymin ymax = atop (xaxis xmin xmax) (yaxis ymin ymax)
ss = mkSizeSpec2D (Just 800) (Just 800)
--------------------------------------------------------------------------------------------------------------------------------------
If I put
main :: IO ()
main = renderRasterific "tt2.jpg" ss (xaxis (-1) 1)
I get a horizontal line as i want.
if i put
main :: IO ()
main = renderRasterific "tt2.jpg" ss (xaxis (-1) 1)
I get a vertical line. The problem is that if i put
main :: IO ()
main = renderRasterific "tt2.jpg" ss (refFrame (-1) 1 (-1) 1)
I only get a black square.
I am doing something wrong?
Any help is welcomed
Jorge