Support Requests item #1684009, was opened at 2007-03-19 16:01
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=202915&aid=1684009&group_id=29
15

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Priority: 5
Private: No
Submitted By: Andrea Tagliasacchi (tallia1)
Assigned to: Nobody/Anonymous (nobody)
Summary: Multiple plots (+real time plotting)

Initial Comment:
Hi there,

I realized the following function to realize a simple 1-D vector plot (for
temporal series and so on).

########## BEGIN CODE ##########
void plot( float* y_T, int N ) 
{ 
PLFLT *x = new PLFLT[N]; 
PLFLT *y = new PLFLT[N]; 
for (int i = 0; i < N; i++) { 
x[ i ] = i; 
y[ i ] = y_T[ i ]; 
}

// Initialize PLplot. 
plstream *pls = new plstream(); 
plsdev( "gcw" ); /* USE GNOME OUTPUT WINDOW LIBRARY BY DEFAULT */ 
plscolbg (255,255,255); /* SET THE GRAPH BACKGROUND */ 
pls->init(); /* INITIALIZE THE WIDGET */ 
pls->font(2); /* CHOOSE THE FONT */ 
pls->adv(0); /* advance to next page */

pls->vpor( 0.1,0.9,0.1,0.9 ); /* position of graph inside window */ 
pls->wind( 0, N, 0, 400); /* set axis x-range, y-range (matlab axis command)*/

// Draw axis with their style 
plrgb(0,0,0); pls->box("bnstg", 0.0, 0, "bnstvg", 0.0, 0);

// Plot ampl vs freq. 
plcol0(1); c_plpoin( N, x, y, 'o' ); /* plot stem graph */ 
plrgb(1,0,1); pls->line( N, x, y ); /* plot line junction points */

// Put labels on. 
plrgb(0,0,0); pls->mtex("b", 3.2, 0.5, 0.5, "Frequency"); 
plrgb(0,0,0); pls->mtex("l", 5.0, 0.5, 0.5, "Amplitude (dB)");

delete[] x; 
delete[] y; 
delete pls; 
} 
########## END CODE ##########

There are two principal main issues: the first is that if i call this function
multiple times, only 1 X window is opened and anyway the content of the plot is
always the one of the first function call.

A second issue (partially related to this one) is that I can't obtain a real
time plot of a 1D time-varying vector (think for example the Fourier spectrum of
a time varying signal).

Hope that you can help me with this.
Thanks, Andrea



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=202915&aid=1684009&group_id=29
15

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Plplot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to