FSharpChart for Valentines Day

FSharpChart for Valentines Day

Rate This
  • Comments 1

As I have not posted anything about FSharpChart for a while I thought I would do a quick post, one that befits Valentines Day:

image

Plotting the heart was surprisingly easy to do:

[ for x in -1.1 .. 0.001 .. 1.0 do
    let y1 = abs(x)+sqrt(1.0-x**2.0)
    let y2 = abs(x)-sqrt(1.0-x**2.0)
    yield (x, y1)
    yield (x, y2)]
|> FSharpChart.Line
|> FSharpChart.WithSeries.Style(Color = Color.Red, BorderWidth = 2)
|> FSharpChart.WithTitle("Happy Valentines Day", TextStyle = TextStyle.Frame, Font = new Font("Arial", 28.0f))
|> FSharpChart.WithMargin(0.0f, 15.0f, 3.0f, 1.0f)
|> FSharpChart.WithArea.AxisX(MajorGrid = Grid(LineColor = Color.White))
|> FSharpChart.WithArea.AxisY(MajorGrid = Grid(LineColor = Color.White))

Happy Valentines Day!

Leave a Comment
  • Please add 6 and 4 and type the answer here:
  • Post
Page 1 of 1 (1 items)