rerouting plot commands

Librairie C++ de calcul formel/ C++ symbolic computation library

Modérateur : xcasadmin

lukamar
Messages : 331
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

rerouting plot commands

Message par lukamar » mar. oct. 31, 2017 4:19 pm

Hi Bernard,
I want to include Giac to another c++ project. A command can be parsed to gen via stringstream from a string. Now, evaluating a plot command produces a FLTK window showing the output (if Giac is compiled with FLTK). As I understand, a graphic object is in fact a vector containing all relevant data for the figure. I would like to obtain only that information in order to pass it further for drawing, without a window popping up. Is that possible?

parisse
Messages : 5731
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: rerouting plot commands

Message par parisse » mer. nov. 01, 2017 8:05 am

I'm not sure I understand your question.
Inside xcas or icas, add any non graphical command after the plot command, for example plot(sin(x));0
This will return a vector, the first one being the plot, and the second 0. Xcas and icas will not display it graphically (the choice is made by looking at the type of the last object).
Inside a C++ program, you have nothing special to do, the plotting command will return a gen that contains the data to be plotted. Intermediate plots may be displayed in the DispG window, you can disable this with io_graph(false,contextptr);

lukamar
Messages : 331
Inscription : ven. juin 30, 2017 9:55 am
Localisation : Zagreb, Croatia

Re: rerouting plot commands

Message par lukamar » mer. nov. 01, 2017 8:25 am

Thank you, that's exactly what I wanted to know. I forgot that it's an interface to Giac which actually displays the plot...

Répondre