I can not draw at will on subwindows

Help
2001-12-04
2001-12-17
  • Matthew Emerson

    Matthew Emerson - 2001-12-04

    I am running the C-version of plplot on a UNIX system.

    What I would like to do is set-up a group of subwindows (with axes and labels and maybe even an initial data curve).   Then, I want to move from sub-window to sub-window and update the data curves in each window.  However, I am finding that I can ONLY draw in the last subwindow initialized.  Is it the case that once you "move on" from a subwindow that you can no longer go back?

    Thanks in advance for any help you can provide.

    (not quite) Pseudocode follows:

    /* Set-up the environment */
    plsdev( "tk" );
    plssub(1,2); /* 2 vertically stacked plots */
    plinit();

    plenv(1,100,1,100,1,2); /* set-up the first subwindow */
    plenv(1,1000,1,100,1,2); /* set-up the 2nd subwindow */

    pladv(1); /* go back to the first window */
    plcol0(3); /* set the color */
    plwid(1); /* set the pen width */
    pllsty(1); /* set the line style */
    plline(num_points,x,y); /* draw some points in the first window */

    pladv(2); /* advance to the second window */
    plcol0(3); /* set the color */
    plwid(1); /* set the pen width */
    pllsty(1); /* set the line style */
    plline(num_points,x,y); /* draw some points in the second window; These points ARE NOT being displayed */

    plflush();
    plend();

     
    • Matthew Emerson

      Matthew Emerson - 2001-12-04

      Sorry, I made a mistake in my pseudo-code.  It is the first set of points (the ones being displayed in the first subwindow) which are not being displayed.  The second set of points (in the last subwindow to be initialized) ARE being displayed.

      Sorry for the mix-up.

       
    • Maurice LeBrun

      Maurice LeBrun - 2001-12-17

      The problem is, plot settings such as world coordinate bounds and viewport bounds are not saved on a per-subwindow basis.  So your second plenv() call is simply overriding the settings of the first.  These settings are the ones being used when you go back to the first subwindow, and probably the points you are trying to plot are simply "off the page".

      To get the effect you are looking for, you will need to bypass plenv and manage your plot using
      lower level calls such as plwind() and plvpor().
      Each time you switch subwindows you will have to call these anew.

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks