|
From: Ian R. G. <ge...@kd...> - 2004-10-21 00:39:50
|
Greetings, I have been working on a KDE interface to Octave, when I found that there was no nice KDE wrapper around gnuplot. So I started one. I am mostly looking for people who are interested in helping me that are familiar with gnuplot. I only really know how to do pretty simple things with it, but I did most of the dirty work already, so anyone with minor C++ knowledge, and a good gnuplot background would work. The following C++ code generates the graphic at http://www.geiseri.com/kdevelop/gnuplot.png KGNUPlotWidget *wid =3D new KGNUPlotWidget(); LineStyle line(2); line.setLineType( 4 ); line.setLineWidth( 1 ); line.setPointType( 6 ); line.setPointSize( 3 ); LineStyle border( 3 ); border.setLineType( 9 ); border.setLineWidth( 2 ); FillStyle fill; fill.setType( FillStyle::pattern ); fill.setFillPattern( 2 ); fill.setBorderStyle( &border ); FunctionPlot *plot =3D new FunctionPlot( "sin(x)" ); plot->setTitle( "Test Plot of sin(x)" ); plot->setStartRange( -1 ); plot->setEndRange( 2 ); plot->setPlotStyle( PlotBase::linespoints ); plot->setLineStyle( &line ); wid->addLineStyle( &border ); wid->addLineStyle( &line ); wid->addFillStyle( &fill ); wid->show(); wid->resize(400,300); wid->setXLabel("Test X Label"); wid->setYLabel("Test Y Label"); wid->setFormats(KGNUPlotWidget::X, "%g"); wid->setFormats(KGNUPlotWidget::Y, "%.2f"); wid->plot(plot); Currently line styles, arrows, and arrow styles are supported. Fill is sort of supported, and plot for data or functions will work with most simple cases. I think the big issues that remain are the ones I am not aware of ;) Currently there is a small dependency on KDE, but I have plans to remove it, and the remainder works on Win32 or Unix. So who wants to play? I'm not on the list so please CC me. -ian reinhart geiser --=20 KDE - Unix is ready for the desktop http://www.kde.org |
|
From: Daniel J S. <dan...@ie...> - 2004-10-22 19:09:50
|
Ian Reinhart Geiser wrote: >Greetings, >I have been working on a KDE interface to Octave, when I found that there >was no nice KDE wrapper around gnuplot. So I started one. > Hi Ian, There is a lot of functionality in gnuplot, making a wrapper for a full implementation quite big. Octave doesn't use all features, naturally, but one nice thing about Octave is the "graw" function that allows one to access "non-Octave" graphics and other terminals. If you want a good idea of things you are not aware of, I suggest downloading the latest CVS version of gnuplot, compiling, then running 'all.dem' in the 'demo' subdirectory. Dan Sebald >I am mostly looking for people who are interested in helping me that are >familiar with gnuplot. I only really know how to do pretty simple things >with it, but I did most of the dirty work already, so anyone with minor >C++ knowledge, and a good gnuplot background would work. > >The following C++ code generates the graphic at >http://www.geiseri.com/kdevelop/gnuplot.png > > KGNUPlotWidget *wid = new KGNUPlotWidget(); > LineStyle line(2); > line.setLineType( 4 ); > line.setLineWidth( 1 ); > line.setPointType( 6 ); > line.setPointSize( 3 ); > > LineStyle border( 3 ); > border.setLineType( 9 ); > border.setLineWidth( 2 ); > > FillStyle fill; > fill.setType( FillStyle::pattern ); > fill.setFillPattern( 2 ); > fill.setBorderStyle( &border ); > > FunctionPlot *plot = new FunctionPlot( "sin(x)" ); > plot->setTitle( "Test Plot of sin(x)" ); > plot->setStartRange( -1 ); > plot->setEndRange( 2 ); > plot->setPlotStyle( PlotBase::linespoints ); > plot->setLineStyle( &line ); > > wid->addLineStyle( &border ); > wid->addLineStyle( &line ); > wid->addFillStyle( &fill ); > > wid->show(); > wid->resize(400,300); > wid->setXLabel("Test X Label"); > wid->setYLabel("Test Y Label"); > wid->setFormats(KGNUPlotWidget::X, "%g"); > wid->setFormats(KGNUPlotWidget::Y, "%.2f"); > wid->plot(plot); > >Currently line styles, arrows, and arrow styles are supported. Fill is >sort of supported, and plot for data or functions will work with most >simple cases. I think the big issues that remain are the ones I am not >aware of ;) > >Currently there is a small dependency on KDE, but I have plans to remove >it, and the remainder works on Win32 or Unix. > >So who wants to play? I'm not on the list so please CC me. > >-ian reinhart geiser > > -- Dan Sebald email: daniel DOT sebald AT ieee DOT org URL: http://acer-access DOT com/~dsebald AT acer-access DOT com/ |
|
From: Petr M. <mi...@ph...> - 2004-10-25 10:05:42
|
> I have been working on a KDE interface to Octave, when I found that there > was no nice KDE wrapper around gnuplot. So I started one. > > I am mostly looking for people who are interested in helping me that are > familiar with gnuplot. I only really know how to do pretty simple things > with it, but I did most of the dirty work already, so anyone with minor > C++ knowledge, and a good gnuplot background would work. Look to gnuplot web page. There are some front-ends / wrappers lists. It would be useful to use an already existing API rather than developing your own. BTW, you could not use one of the existings, and add a possibity to draw into a KDE widget? Or even a "KE Widget" terminal for gnuplot? > The following C++ code generates the graphic at > http://www.geiseri.com/kdevelop/gnuplot.png > > KGNUPlotWidget *wid = new KGNUPlotWidget(); not GNUPlot, see FAQ --> rather KGnuplot > LineStyle line(2); rather prefixed: kgnuplotLineStyle > wid->setXLabel("Test X Label"); > wid->setYLabel("Test Y Label"); > wid->setFormats(KGNUPlotWidget::X, "%g"); > wid->setFormats(KGNUPlotWidget::Y, "%.2f"); That looks like reimplementation of gnuplot structure into you KDE. What about just the similar thing as Octave does: wid->raw("set mxtics 5"); raw would do printf()+fflush() --- PM |
|
From: Ian R. G. <ge...@kd...> - 2004-10-27 14:12:11
|
Petr Mikulik said: >> I have been working on a KDE interface to Octave, when I found that >> there >> was no nice KDE wrapper around gnuplot. So I started one. >> >> I am mostly looking for people who are interested in helping me that a= re >> familiar with gnuplot. I only really know how to do pretty simple >> things >> with it, but I did most of the dirty work already, so anyone with mino= r >> C++ knowledge, and a good gnuplot background would work. > > Look to gnuplot web page. There are some front-ends / wrappers lists. I= t > would be useful to use an already existing API rather than developing y= our > own. > Mainly because they where either not complete, C based, python based or just plain not OO. > BTW, you could not use one of the existings, and add a possibity to dra= w > into a KDE widget? Or even a "KE Widget" terminal for gnuplot? > > Thats more or less what I did. I used the Qt process control object to communicate with gnuplot and output to a temp file which is then rendered= . >> The following C++ code generates the graphic at >> http://www.geiseri.com/kdevelop/gnuplot.png >> >> KGNUPlotWidget *wid =3D new KGNUPlotWidget(); > Yeah over the weekend I changed it to KGNUPlot::Widget() but i can make i= t KGnuplot::Widget() just as easy. > not GNUPlot, see FAQ --> rather KGnuplot > > >> LineStyle line(2); > > rather prefixed: kgnuplotLineStyle > No C++ not C api please. > >> wid->setXLabel("Test X Label"); >> wid->setYLabel("Test Y Label"); >> wid->setFormats(KGNUPlotWidget::X, "%g"); >> wid->setFormats(KGNUPlotWidget::Y, "%.2f"); > > That looks like reimplementation of gnuplot structure into you KDE. Wha= t > about just the similar thing as Octave does: > wid->raw("set mxtics 5"); > > raw would do printf()+fflush() It is. The only difference is I want a OO api, not subjecting the user to more shell madness. Cheers -ian reinhart geiser --=20 KDE - Unix is ready for the desktop http://www.kde.org |
|
From: Ian R. G. <ge...@kd...> - 2004-10-27 14:22:25
|
Ethan Merritt said:
> On Wednesday 20 October 2004 05:38 pm, Ian Reinhart Geiser wrote:
>> Greetings,
>> I have been working on a KDE interface to Octave, when I found that
>> there
>> was no nice KDE wrapper around gnuplot. So I started one.
>
> Great!
> I tried to drum up support for a Qt interface a year or so back, but no
> one
> on the development team (including me) has any experience there.
>
To be honest my wife put me up to this ;)
>> I am mostly looking for people who are interested in helping me that a=
re
>> familiar with gnuplot. I only really know how to do pretty simple
>> things
>> with it, but I did most of the dirty work already, so anyone with mino=
r
>> C++ knowledge, and a good gnuplot background would work.
>
> I am not clear on exactly what level interface you are working on.
> Is the idea to generate plots through a Qt-based GUI, or is it to provi=
de
> a gnuplot module or driver that pipes output into a set of Qt/KDE
> widgets and windows rather than directly to X? The latter is what I
> originally had in mind. That way you could run gnuplot on top of Qt
> even in non-X environments.
>
The big problem I have currently is that I have a KDE application that I
want to have that will display gnuplot graphs, and manipulate them. The
problem with the X11 interface is that it offers no ability to get the
WinID, so embedding is impossible, and there is no sane way to swallow
multiple plots. So I dropped back and just dump to a temp png file, and
render that on the widget.
>> Currently line styles, arrows, and arrow styles are supported. Fill i=
s
>> sort of supported, and plot for data or functions will work with most
>> simple cases. I think the big issues that remain are the ones I am no=
t
>> aware of ;)
>
> Probably mousing feedback is the biggest issue. Everything else is
> "more of the same" - more plot styles, more font and color control, etc=
.
> I guess there is also an obvious need to hook up a Print button that
> will trigger a replot in PostScript mode and pipe it to Kprinter. But
> that is probaly trivial.
>
Oh yeah mouse ;)
I _think_ I can do about 99% of it in the QWidget. I would have to
manually implement some of the nicer line following things, and selection
boxes though. Hard, but not impossible from what I can tell.
Adding more styles and palettes are trivial. Each object in the API
basicly has a method call QString commands() const; This method takes all
of the objects properties and outputs the gnuplot commands. So adding ne=
w
options will be trivial. Also for things that use the enumerated styles,
the offsets are stored in the object, so you can reference them from more
complex objects.
>> Currently there is a small dependency on KDE, but I have plans to remo=
ve
>> it, and the remainder works on Win32 or Unix.
>
> OK. Scratch Kprinter then. But still we would want a Print button
> that generates PostScript output. The pieces are already there inside
> gnuplot; they would just have to be hooked up to a widget.
>
Well, personally I would like the KDE API, since it makes things like
printing, copy/paste, IPC, and the general UI very trivial. I only went
the pure Qt route, so I didn't scare off any anti-KDE folks.
If there is enough interest I can go both, but if there is more interest
for KDE, I wont complain. KPrinter is QPrinter + Awesome config GUI.
I suppose next step is to get public CVS of this bugger up.
Cheers
-ian reinhart geiser
--
KDE - Unix is ready for the desktop
http://www.kde.org
|
|
From: Ian R. G. <ge...@kd...> - 2004-10-27 14:31:12
|
Lutz Maibaum said: > > Hello Ian, > > I'm a frequent user of both gnuplot and KDE, and I was happy to read yo= u > email > to the gnuplot development list. I have little programming experience > though, > and I'm not sure if I can offer any valuable help. I can always give it= a > shot, though. > > At first sight, I didn't quite understand what you mean by a "KDE > wrapper". > From your example, it seems like you are not thinking about a gnuplot G= UI > frontend (if you do, you probably want to take a look at Xgfe and qgfe, > which > both use Qt), but some sort of plotting widget that uses gnuplot as its > drawing engine (maybe something like Qwt?). > This is more like Xgfe/qgfe than Qwt, since I am using gnuplot via a chil= d process. The difference over *gfe is that I am using bidirectional IO, s= o I can get feedback from gnuplot. I am a big fan of the power of gnuplot, but the API (or lack there of ;) ) is not so hot. > If this is so, then maybe you could explain in a little more detail how > you > would like to accomplish this. How does the communication between the > widget > class and gnuplot work (maybe pipes)? How do you display gnuplot's outp= ut > in > the calling application? I vaguely remember a discussion on the > gnuplot-beta > list about the feasibility of a Qt terminal type. Do you want to use > gnuplot > in it's interactive mode (zooming, data point labeling, etc.)? I'm sure > the > people on the gnuplot-beta list would be interested to know, and can > probably > give a lot of helpful tips. Currently the X11 child window is quite impossible to work with, so I am just dumping a png to a temp file and then drawing it on the widget. I will probably have to implement the zooming, data point labeling and such manually. > > Other points I can think of right now: > > - gnuplot has a somewhat unusual license, make sure that it is compatib= le > with > whatever it is you're trying to do. I'm using it via a child process, but this widget is LGPL at this point.=20 I think that should be okay. > > - gnuplot allows execution of arbitrary shell commands within gnuplot > scripts, > which might cause security risks. > I am hiding this part, so this should not be an issue. Cheers -ian reinhart geiser -- KDE - Unix is ready for the desktop http://www.kde.org |
|
From: Petr M. <mi...@ph...> - 2004-10-29 07:06:51
|
> > If this is so, then maybe you could explain in a little more detail how > > you would like to accomplish this. How does the communication between > > the widget class and gnuplot work (maybe pipes)? How do you display > > gnuplot's output in the calling application? I vaguely remember a > > discussion on the gnuplot-beta list about the feasibility of a Qt > > terminal type. Do you want to use gnuplot in it's interactive mode > > (zooming, data point labeling, etc.)? I'm sure the people on the > > gnuplot-beta list would be interested to know, and can probably give a > > lot of helpful tips. > Currently the X11 child window is quite impossible to work with, so I am > just dumping a png to a temp file and then drawing it on the widget. I > will probably have to implement the zooming, data point labeling and such > manually. Would not it be easier to implement a new Qt/GTK/FLTK/wx -terminal, that would allow to be encapsulated in a particular widget? What would help many other projects as well. That could actually be made more easier than the current X11; and connected to gnuplot either with a binary bidirectional piping (like OS/2) or compiled together with gnuplot inside one executable without piping (like MSW). Then it will be faster for plotting than X11. --- PM |