1
2
3
#r FSharp.Plot.dll

" Could not locate the assembly "FSharp.Plot.dll" "

Does it still exist?

Thanks

By on 8/12/2010 4:45 AM ()

No, not for a long time.

You might check out

[link:blogs.msdn.com]

[link:stackoverflow.com]

[link:code.msdn.microsoft.com]

for various things along these lines.

By on 8/12/2010 6:25 AM ()

Thanks for the quick answer!

By on 8/12/2010 12:18 PM ()

Nikolai,

Since F# inter-operates very will wtih anything written in .NET, you can also take advantage of some of the very good plotting libraries out there for C#/VB/.NET.

I've had a lot of success with ZedGraph. [link:zedgraph.org]

Here's a little class that I wrote to use the ZedGraph control. You can access the GraphPane to do most things.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// zedgraphplot.fs
// 10.5.07 Matt Valerio
//
// 

#light

module Esl.FSharp.Plotting

#I @"..\..\Shared\DLL\" ;; // need to put the path to the ZedGraph.dll here
#r @"ZedGraph.dll" ;;

open System;
open System.Drawing;
open System.Windows.Forms;
open System.Reflection;
open ZedGraph;

type ZedGraphPlot = class
  inherit Form

  // This should be private...
  val mutable _zedGraphControl : ZedGraphControl;

  new(title : string) as x = 
    {
      _zedGraphControl = new ZedGraphControl();
    }
    then
      x.Text <- title;
      x.Size <- new Size(600,400);
      x._zedGraphControl.Dock <- DockStyle.Fill;
      x.Controls.Add(x._zedGraphControl);
       
  member x.ZedGraphControl
    with get() = x._zedGraphControl;
    
  member x.GraphPane
    with get() = x._zedGraphControl.GraphPane;
    
  member x.Title
    with get() = x.GraphPane.Title.Text;
    and set(y) = x.GraphPane.Title.Text <- y;
    
  member x.XLabel
    with get() = x.GraphPane.XAxis.Title.Text;
    and set(y) = x.GraphPane.XAxis.Title.Text <- y;
    
  member x.YLabel
    with get() = x.GraphPane.YAxis.Title.Text;
    and set(y) = x.GraphPane.YAxis.Title.Text <- y;
end

For example, here's how to make a simple plot:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#light
#I @"..\..\Shared\DLL\" ;;
#r @"ZedGraph.dll" ;;
#I @"..\Esl.FSharp.Plotting\bin" ;;
#r @"Esl.FSharp.Plotting.dll" ;;
open System;
open System.Drawing;
open System.Windows.Forms;
open ZedGraph;
open Esl.FSharp.Plotting;

// Create the plot window
let f = new ZedGraphPlot("Test Plot");
f.Title <- "Test Plot";
f.XLabel <- "Frequency (GHz)";
f.YLabel <- "Gain (dB)";

// Calculate some sample data
let x = [1.0 .. 100.0] |> List.to_array;
let y = Array.map (fun a -> (sin (a/10.0) * a) ) x;

// Set up the curve
let curve1 = f.GraphPane.AddCurve("sim1.dat",x ,y, Color.Red);
curve1.Line.Width <- float32 2.0;
curve1.Symbol.Size <- float32 5.0;
curve1.Symbol.Fill.Type <- FillType.Solid;
curve1.Symbol.Fill.Color <- Color.Green;

// Autoscale the axes
f.GraphPane.AxisChange();
f.Show();
f.Focus();
f.Activate();
By on 12/17/2007 3:03 PM ()

Hi,

Make sure you have either Xceed or MS. Office installed. If you want to use with Office you need to download Office Web Components.

Hope this helps.
//Can.

1
2
3
4
5
6
7
8
9
10
11
12
13
#light

#r "FSharp.Plot.dll"
#r "FSharp.Plot.Excel.dll"
open Microsoft.FSharp.Plot.Excel
open Microsoft.FSharp.Plot.Interactive

let ps = [| (1.,"c"); (-2.,"p") |]
plot (Bars(ps))

let xs = [| 1.0 .. 20.0 |]
let ys = [| 2.0 .. 21.0 |]
let pp= plot(Area(xs,ys))
By on 12/11/2007 2:26 AM ()

Not that I'm aware of. I've been meaning to check it out for sometime but not got round to it. I guess reflector might be some help here. I'll post something to my blog as soon as I have tried it, but this may not be for sometime, so feel free to share your insites with the rest of us ... ;)

Cheers,
Rob

By on 12/10/2007 9:22 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper