NPlot + Gtk#

Miguel wrote a fantastic Gtk# control for NPlot. The problem is that this tarball is using Gtk#1. To use Gtk# 2 you must to change lib/Makefile and replace gtk-sharp with gtk-sharp-2.0. You can download the fixed tarball here. This is another code example to draw a histogram:

#define GTK

#if GTK

using Gtk;
using NPlot.Gtk;

using NPlot;
using System.Drawing;
using System.IO;
using System.Drawing.Imaging;
class X {
static public void PlotBars (IPlotSurface2D plot){
    HistogramPlot histogram=
new HistogramPlot();
float f=0.35f;
float[] a=new float[10];
    System.Random random=
new System.Random();
for (int i=0; i<a.Length; i++) {
static void Main (){
#if GTK
    Window w=
new Window("Test");
delegate {
    NPlot.Gtk.PlotSurface2D plot=
new NPlot.Gtk.PlotSurface2D();
NPlot.PlotSurface2D s=new NPlot.PlotSurface2D();
    Bitmap b=
new Bitmap(10001000);
    Graphics g=Graphics.FromImage(b);
    Rectangle bounds=
new Rectangle(0010001000);
    s.Draw(g, bounds);
"file.png", ImageFormat.Png);

Enjoyed reading this post?
Subscribe to the RSS feed and have all new posts delivered straight to you.
  • Man Yeager

    hi, your website looks broken on my iphone 4G, please fix it if you can do it.