Hi,
   I notice that there are IupMglPlot(MathGL) and IupPlot(PPlot) for plotting 
in IUP.
   The IupMglPlot demos in iuptest.exe are running slowly. How?

   How about getting PLplot(http://plplot.sourceforge.net/) into IUP? 
   I'm trying to integrate them, but have no idea of this. 
   Can you give me some hints? Thanks!

   Here are codes for demo:

#include <stdlib.h>
#include <stdio.h>
#include "iup.h"

#include <math.h>
#include <string.h>
#include <ctype.h>

#include "plConfig.h"
#include "plplot.h"

#define NSIZE    101

#pragma comment(lib, "iup.lib")
#pragma comment(lib, "plplot.lib")


void FrameTest(void)
{
    Ihandle *dlg, *frame1, *frame2;

    frame1 = IupFrame
        (
        IupVbox
        (
        IupLabel("Label1"),
        IupSetAttributes(IupLabel("Label2"), "SIZE=70x"),
        IupLabel("Label3"),
        NULL
        )
        );

    frame2 = IupFrame
        (
        IupVbox
        (
        IupSetAttributes(IupLabel("Label4"), "EXPAND=HORIZONTAL"),
        IupLabel("Label5"),
        IupLabel("Label6"),
        NULL
        )
        );

    IupSetAttribute(frame1, "TITLE", "Title Text");
    IupSetAttribute(frame1, "MARGIN", "0x0");

    IupSetAttribute(frame2, "MARGIN", "0x0");
    dlg = IupDialog(IupHbox(frame1, frame2, NULL));

    IupSetAttribute(dlg, "TITLE", "IupFrame Test");
    IupSetAttribute(dlg, "MARGIN", "10x10");
    IupSetAttribute(dlg, "GAP", "5");
    IupSetAttribute(dlg, "FONTSIZE", "14");

    IupShow(dlg);
}

int main(int argc, char* argv[])
{
    PLFLT x[NSIZE], y[NSIZE];
    PLFLT xmin = 0., xmax = 1., ymin = 0., ymax = 100.;
    int   i;

    // Prepare data to be plotted.
    for (i = 0; i < NSIZE; i++)
    {
        x[i] = (PLFLT)(i) / (PLFLT)(NSIZE - 1);
        y[i] = ymax * x[i] * x[i];
    }
    
    plsdev("");  // ???

    // Initialize plplot
    plinit();
    // Create a labelled box to hold the plot.
    plenv(xmin, xmax, ymin, ymax, 0, 0);
    pllab("x", "y=100 x#u2#d", "Simple PLplot demo of a 2D line plot");
    // Plot the data that was prepared above.
    plline(NSIZE, x, y);
    // Close PLplot library
    plend();

    IupOpen(&argc, &argv);
    FrameTest();
    IupMainLoop();
    IupClose();
    return EXIT_SUCCESS;
}
------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to