Hi,
Actually we have 2 plot controls. The IupMglPlot and IupPlot.
IupMglPlot is much richer in terms of 2D and 3D plots, because all the
work is done by MathGL. It is a great library, but have some constrains.
And it is quite complex internally. Plot sometimes is slow and lower
quality.
In IupPlot we implemented our own plot system based in the code of PPlot
that was completely rewritten. It does not have fancy 3D graphics, just the
basic 2D plots. Slowly we are adding new plot modes each version. In
contrast text rendering quality is much better, and it is pretty fast even
when not using OpenGL, but an OpenGL mode is also available.
For both the application uses the IUP interface of attributes and
callbacks. There is no need to know how to use MathGL, for instance.
In 2010, we tried using PLPlot. But it was very complicated to do it in
these terms and we give up. Mainly because PLPlot was designed to be used
as the main library and the interface is a driver in a secondary context.
If you check the wxWidgets and Qt interfaces provided for PLPlot you will
see this structure.
So It will be difficult for you to use it in IUP. If you do, please let
me know.
If you are not going to use 3D plots, then I recommend using IupPlot.
Because it is something that we are always improving, and have much more
control. Right now PieChart is on the way...
Best Regards,
Antonio Scuri
On Tue, Oct 25, 2016 at 11:05 PM, . <bitwo...@qq.com> wrote:
> 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
>
>
------------------------------------------------------------------------------
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