-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
In the line plot example: if I just add one point at the y-axis of 0 (mydata3 point 2), no data point goes below 0 yet the y-axis extends beyond 0 and looks unpleasant. I would expect this plot's axis to begin at 0 for both the x- and y-axis. However, I do not recommend cutting it at the lowest or highest datapoint automatically at all, I think it should be a special case for 0 in the x- and y-axis.
{-# LANGUAGE FlexibleContexts #-}
import Plots
import Diagrams.Prelude
import Plots.Axis.Line
import Data.Typeable
mydata1 = [(1,3), (2,5.5), (3.2, 6), (3.5, 6.1)]
mydata2 = mydata1 & each . _1 *~ 0.5
mydata3 = [V2 1.2 2.7, V2 1.7 0, V2 2 5.1, V2 3.2 2.6, V2 3.5 5]
myaxis :: Axis B V2 Double
myaxis = r2Axis &~ do
linePlot' mydata1
linePlot mydata2 $ do
key "data 2"
plotColor .= black
linePlot mydata3 $ key "data 3"
hideGridLines
xAxis . axisLineType .= MiddleAxisLine
yAxis . axisLineType .= LeftAxisLine
lineStyle . _lineCap .= LineCapSquare
lineStyle . _lineJoin .= LineJoinBevel
dia = renderAxis myaxis
Metadata
Metadata
Assignees
Labels
No labels