Skip to content

Remove redundant constraint #220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions chart/Graphics/Rendering/Chart/Easy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
-- License : BSD-style (see chart/COPYRIGHT)
--
-- A high level API for generating a plot quickly.
--
--
-- Importing the Easy module brings into scope all core functions and types required
-- for working with the chart library. This includes key external dependencies such as
-- Control.Lens and Data.Colour. The module also provides several helper functions for
Expand All @@ -17,10 +17,10 @@
--
-- > import Graphics.Rendering.Chart.Easy
-- > import Graphics.Rendering.Chart.Backend.Cairo
-- >
-- >
-- > signal :: [Double] -> [(Double,Double)]
-- > signal xs = [ (x,(sin (x*3.14159/45) + 1) / 2 * (sin (x*3.14159/5))) | x <- xs ]
-- >
-- >
-- > main = toFile def "example.png" $ do
-- > layout_title .= "Amplitude Modulation"
-- > plot (line "am" [signal [0,(0.5)..400]])
Expand Down Expand Up @@ -83,7 +83,7 @@ points title values = liftEC $ do
plot_points_style . point_color .= color
plot_points_style . point_shape .= shape
plot_points_style . point_radius .= 2

-- Show borders for unfilled shapes
when (not (isFilled shape)) $ do
plot_points_style . point_border_color .= color
Expand All @@ -93,10 +93,10 @@ isFilled :: PointShape -> Bool
isFilled PointShapeCircle = True
isFilled PointShapePolygon{} = True
isFilled _ = False

-- | Construct a bar chart with the given titles and data, using the
-- next available colors
bars :: (PlotValue x, BarsPlotValue y) => [String] -> [(x,[y])] -> EC l (PlotBars x y)
-- next available colors
bars :: (BarsPlotValue y) => [String] -> [(x, [y])] -> EC l (PlotBars x y)
bars titles vals = liftEC $ do
styles <- sequence [fmap mkStyle takeColor | _ <- titles]
plot_bars_titles .= titles
Expand Down