[overture] PlotIt Difficulty

  • From: Robert Read <robert.read@xxxxxxxxxx>
  • To: overture@xxxxxxxxxxxxx
  • Date: Mon, 28 Jun 2010 16:07:18 +0200

Hello everyone,

I have a question regarding setting the graphics parameters when using PlotIt, and was wondering whether someone might be able to offer some help. I am having difficulties controlling one of the graphics parameters when using the PlotIt plot function to produce a 1-D line graph. I have included some of my code to try and illustrate my problem. Firstly, I initialise a graphics interface with graphics parameters as follows:

GenericGraphicsInterface * psPointer = Overture::getGraphicsInterface ("plot",TRUE); // create a pointer to the graphics interface
GenericGraphicsInterface & gene_grap_inte = *psPointer;
GraphicsParameters grap_para; // create an object to pass graphics parameters

I am interested in defining the axis bounds associated with my 1-D plot so I define these secondly as follows:

doubleArray bounds(2,3);
bounds(0,0) = 0;
bounds(1,0) = width;
bounds(0,1) = -depth;
bounds(1,1) = waveAmplitude/2;
bounds(0,2) = bounds(1,2) = 0;

where the variables width, depth, and waveAmplitude are of type double. I then make several definitions before plotting, as follows:

const aString title = nullString;
const aString tname = nullString;
const aString *xname = NULL;

grap_para.set(GI_PLOT_BOUNDS,bounds);
grap_para.set(GI_USE_PLOT_BOUNDS,TRUE);
PlotIt::plot(gene_grap_inte,x,y,title,tname,xname,grap_para);

The result is that my x-y plot is successfully generated, but my bounds seem to be ignored. In other words, the bounds of the plot are set to those of the data. Maybe I am doing something silly, but perhaps someone can explain what I must do in order to set the bounds correctly. Incidentally, I have noticed that the bounds are set correctly when I use the PlotIt contour function as follows:

grap_para.set(GI_PLOT_BOUNDS,bounds);
grap_para.set(GI_USE_PLOT_BOUNDS,TRUE);
PlotIt::contour(gene_grap_inte,someFunction,grap_para);

Any help would be very much appreciated.

Best regards,

Robert


Robert Read
Department of Mechanical Engineering
Technical University of Denmark
Nils Koppels Allé
Building 403 Room 020
DK-2800 Kgs. Lyngby
Denmark

tel: 0045 4525 1378
e-mail: robert.read@xxxxxxxxxx

Other related posts: