From: Samuel H. D. Jr. <sd...@sp...> - 2002-11-05 19:45:02
|
Plplot List, I'm running Plplot version 5.1.0 on a Mac under OS 9.2.1 using Absoft Fortran ver. 8.0. I'm trying to have Plplot a series of graphs, three curves per graph with axes numbering, axes labels and titles. The curves are being plotted, but I can't seem to get Plplot to output the axes numbering, labeling and titles. Futher, I'd lime to have the horizontal axis to be twice as long as the vertical axis. The routine that does the plotting is given below. Does anyone have any ideas as to what I'm doing wrong? Thanks in advance. Sam Dupree. subroutine ssi_residual_plot implicit double precision ( a - h, o - z, A - H, O - Z ) include 'state_space.inc' include 'astrodyn_const.inc' include 'diva_support.inc' include 'iounits.inc' include 'lunar_state.inc' include 'phys_const.inc' include 'planet_eph_control.inc' include 'residuals.inc' character * 80 version character * 132 text double precision J2000, 1 x8min, x8max, x8dist, 2 y8min, y8max, y8dist, xminp, xmaxp logical done integer max_pts, nxdiv, nydiv parameter ( max_pts = 400 ) real * 4 xmin, xmax, xdist, ymin, ymax, ydist, 1 delta_max(9), delta_min(9), 2 tjd(max_pts), diff(max_pts,9) data nxdiv/ 4 /, nydiv/ 4 / c ---------------------------------------------------------------------- c set the frame center and reference frame IDs c ---------------------------------------------------------------------- l = frame_center m = ref_frame_id c ---------------------------------------------------------------------- c set the time span for the plots c ---------------------------------------------------------------------- x8min = J2000() + et_start x8max = J2000() + et_stop c ---------------------------------------------------------------------- c call SCALE1() to generate "nice" numbers for the horizontal axis c ---------------------------------------------------------------------- call SCALE1( x8min, x8max, nxdiv, xminp, xmaxp, x8dist ) xmax = xmaxp xmin = xminp xdist = x8dist c ---------------------------------------------------------------------- c call plgver_() to obtain the Plplot version c ---------------------------------------------------------------------- call plgver_( version ) c ---------------------------------------------------------------------- c output the Plplot version to the report c ---------------------------------------------------------------------- write( luncrt, 2000 ) CHAR(12), version write( lunprt, 2000 ) CHAR(12), version c ---------------------------------------------------------------------- c call plscolbg_() to set the background color in terms of red, c green, and blue c ---------------------------------------------------------------------- call plscolbg_( 000, 000, 000 ) c ---------------------------------------------------------------------- c call plinit_() to initialize Plplot c ---------------------------------------------------------------------- call plinit_() c ---------------------------------------------------------------------- c call plssub_() to have one plot per subframe c ---------------------------------------------------------------------- call plssub_( 1, 1 ) c ---------------------------------------------------------------------- c generate plots of the Solar System Barycentric position, velocity c and RIC position residuals for all objects c ---------------------------------------------------------------------- do i = 1, state_space_size if( ss_to_cs_index(i) .ne. libration_index ) then j = state_space_to_eph( i ) lunit = lundif( j ) do k = 1, 9 delta_max(k) = max_resid(k,i) delta_min(k) = min_resid(k,i) end do do k = 1, 9, 3 rewind lunit done = .false. y8max = max( delta_max(k ), delta_max(k+1), 1 delta_max(k+2) ) y8min = min( delta_min(k ), delta_min(k+1), 1 delta_min(k+2) ) call SCALE1( y8min, y8max, nydiv, xminp, xmaxp, y8dist ) ymax = xmaxp ymin = xminp ydist = y8dist call plcol0_( 13 ) call plenv_( xmin, xmax, ymin, ymax, 0, 0 ) call plbox_( 'bcnst', xdist, 0, 'bcnstv', ydist, 0 ) if( k .lt. 4 ) then text = '#frSolar System Barycenter '// 1 TRIM(planet_names(j))// 2 ' Position Residuals (E-C) - DIVA' elseif( k .lt. 7 )then text = '#frSolar System Barycenter '// 1 TRIM(planet_names(j))// 2 ' Velocity Residuals (E-C) - DIVA' else text = '#frSolar System Barycenter '// 1 TRIM(planet_names(j))// 2 ' RIC Position Residuals (E-C) - DIVA' end if call plcol0_( 6 ) call pllab_( 'Julian Day', 'Residuals (km)', text ) do while( .not. done ) npts= 0 do ii = 1, max_pts read( unit = lunit, fmt = *, iostat = iret ) 1 tjd(ii), ( diff(ii,jj), jj = 1, 9 ) if( iret .ne. 0 ) then done = .true. exit else npts = ii end if end do if( npts .ne. 0 ) then call plcol0_( 1 ) call plline_( npts, tjd(1), diff(1, k ) ) call plcol0_( 3 ) call plline_( npts, tjd(1), diff(1, k+1) ) call plcol0_( 9 ) call plline_( npts, tjd(1), diff(1, k+2) ) end if end do call pleop_() end do end if end do if( .not. state_space_sel(18) ) then i = state_space_size + 1 j = 1 lunit = lundif( j ) do k = 1, 9 delta_max(k) = max_resid(k,i) delta_min(k) = min_resid(k,i) end do do k = 1, 9, 3 rewind lunit done = .false. y8max = max( delta_max(k ), delta_max(k+1), 1 delta_max(k+2) ) y8min = min( delta_min(k ), delta_min(k+1), 1 delta_min(k+2) ) call SCALE1( y8min, y8max, nydiv, xminp, xmaxp, y8dist ) ymax = xmaxp ymin = xminp ydist = y8dist call plcol0_( 13 ) call plenv_( xmin, xmax, ymin, ymax, 0, 0 ) call plbox_( 'bcnst', xdist, 0, 'bcnstv', ydist, 0 ) if( k .lt. 4 ) then text = '#frSolar System Barycenter '// 1 TRIM(planet_names(j))// 2 ' Position Residuals (E-C) - DIVA' elseif( k .lt. 7 )then text = '#frSolar System Barycenter '// 1 TRIM(planet_names(j))// 2 ' Velocity Residuals (E-C) - DIVA' else text = '#frSolar System Barycenter '// 1 TRIM(planet_names(j))// 2 ' RIC Position Residuals (E-C) - DIVA' end if call plcol0_( 6 ) call pllab_( 'Julian Day', 'Residuals (km)', text ) do while( .not. done ) npts= 0 do ii = 1, max_pts read( unit = lunit, fmt = *, iostat = iret ) 1 tjd(ii), ( diff(ii,jj), jj = 1, 9 ) if( iret .ne. 0 ) then done = .true. exit else npts = ii end if end do if( npts .ne. 0 ) then call plcol0_( 1 ) call plline_( npts, tjd(1), diff(1, k ) ) call plcol0_( 3 ) call plline_( npts, tjd(1), diff(1, k+1) ) call plcol0_( 9 ) call plline_( npts, tjd(1), diff(1, k+2) ) end if end do call pleop_() end do end if c ---------------------------------------------------------------------- c call plend_() to close Plplot c ---------------------------------------------------------------------- call plend_() c ---------------------------------------------------------------------- c return to the calling routine c ---------------------------------------------------------------------- return c ---------------------------------------------------------------------- c format statements c ---------------------------------------------------------------------- 2000 format( a, //, ' ', t5, 'Plplot version: ', a, // ) end -- ------------------------------------------------------------------------ Samuel H. Dupree, Jr. sd...@sp... 600 West Harvey Street Apartment A-703 http://www.speakeasy.org/~sdupree/ Philadelphia, PA 19144-4345, USA HOME: 215-842-3663 WORK: 610-531-7994 FAX: 610-531-3145 "What does it take to travel in space? The will to do it.." - Dr. Wernher von Braun ------------------------------------------------------------------------ |
From: Samuel H. D. Jr. <sd...@sp...> - 2002-11-05 19:45:55
|
Plplot List, I'm running Plplot version 5.1.0 on a Mac under OS 9.2.1 using Absoft Fortran version. 8.0. I'm trying to have Plplot a series of graphs, three curves per graph with axes numbering, axes labels and titles. The curves are being plotted, but I can't seem to get Plplot to output the axes numbering, labeling and titles. Further, I'd lime to have the horizontal axis to be twice as long as the vertical axis. The routine that does the plotting is given below. Does anyone have any ideas as to what I'm doing wrong? Thanks in advance. Sam Dupree. subroutine ssi_residual_plot implicit double precision ( a - h, o - z, A - H, O - Z ) include 'state_space.inc' include 'astrodyn_const.inc' include 'diva_support.inc' include 'iounits.inc' include 'lunar_state.inc' include 'phys_const.inc' include 'planet_eph_control.inc' include 'residuals.inc' character * 80 version character * 132 text double precision J2000, 1 x8min, x8max, x8dist, 2 y8min, y8max, y8dist, xminp, xmaxp logical done integer max_pts, nxdiv, nydiv parameter ( max_pts = 400 ) real * 4 xmin, xmax, xdist, ymin, ymax, ydist, 1 delta_max(9), delta_min(9), 2 tjd(max_pts), diff(max_pts,9) data nxdiv/ 4 /, nydiv/ 4 / c ---------------------------------------------------------------------- c set the frame center and reference frame IDs c ---------------------------------------------------------------------- l = frame_center m = ref_frame_id c ---------------------------------------------------------------------- c set the time span for the plots c ---------------------------------------------------------------------- x8min = J2000() + et_start x8max = J2000() + et_stop c ---------------------------------------------------------------------- c call SCALE1() to generate "nice" numbers for the horizontal axis c ---------------------------------------------------------------------- call SCALE1( x8min, x8max, nxdiv, xminp, xmaxp, x8dist ) xmax = xmaxp xmin = xminp xdist = x8dist c ---------------------------------------------------------------------- c call plgver_() to obtain the Plplot version c ---------------------------------------------------------------------- call plgver_( version ) c ---------------------------------------------------------------------- c output the Plplot version to the report c ---------------------------------------------------------------------- write( luncrt, 2000 ) CHAR(12), version write( lunprt, 2000 ) CHAR(12), version c ---------------------------------------------------------------------- c call plscolbg_() to set the background color in terms of red, c green, and blue c ---------------------------------------------------------------------- call plscolbg_( 000, 000, 000 ) c ---------------------------------------------------------------------- c call plinit_() to initialize Plplot c ---------------------------------------------------------------------- call plinit_() c ---------------------------------------------------------------------- c call plssub_() to have one plot per subframe c ---------------------------------------------------------------------- call plssub_( 1, 1 ) c ---------------------------------------------------------------------- c generate plots of the Solar System Barycentric position, velocity c and RIC position residuals for all objects c ---------------------------------------------------------------------- do i = 1, state_space_size if( ss_to_cs_index(i) .ne. libration_index ) then j = state_space_to_eph( i ) lunit = lundif( j ) do k = 1, 9 delta_max(k) = max_resid(k,i) delta_min(k) = min_resid(k,i) end do do k = 1, 9, 3 rewind lunit done = .false. y8max = max( delta_max(k ), delta_max(k+1), 1 delta_max(k+2) ) y8min = min( delta_min(k ), delta_min(k+1), 1 delta_min(k+2) ) call SCALE1( y8min, y8max, nydiv, xminp, xmaxp, y8dist ) ymax = xmaxp ymin = xminp ydist = y8dist call plcol0_( 13 ) call plenv_( xmin, xmax, ymin, ymax, 0, 0 ) call plbox_( 'bcnst', xdist, 0, 'bcnstv', ydist, 0 ) if( k .lt. 4 ) then text = '#frSolar System Barycenter '// 1 TRIM(planet_names(j))// 2 ' Position Residuals (E-C) - DIVA' elseif( k .lt. 7 )then text = '#frSolar System Barycenter '// 1 TRIM(planet_names(j))// 2 ' Velocity Residuals (E-C) - DIVA' else text = '#frSolar System Barycenter '// 1 TRIM(planet_names(j))// 2 ' RIC Position Residuals (E-C) - DIVA' end if call plcol0_( 6 ) call pllab_( 'Julian Day', 'Residuals (km)', text ) do while( .not. done ) npts= 0 do ii = 1, max_pts read( unit = lunit, fmt = *, iostat = iret ) 1 tjd(ii), ( diff(ii,jj), jj = 1, 9 ) if( iret .ne. 0 ) then done = .true. exit else npts = ii end if end do if( npts .ne. 0 ) then call plcol0_( 1 ) call plline_( npts, tjd(1), diff(1, k ) ) call plcol0_( 3 ) call plline_( npts, tjd(1), diff(1, k+1) ) call plcol0_( 9 ) call plline_( npts, tjd(1), diff(1, k+2) ) end if end do call pleop_() end do end if end do if( .not. state_space_sel(18) ) then i = state_space_size + 1 j = 1 lunit = lundif( j ) do k = 1, 9 delta_max(k) = max_resid(k,i) delta_min(k) = min_resid(k,i) end do do k = 1, 9, 3 rewind lunit done = .false. y8max = max( delta_max(k ), delta_max(k+1), 1 delta_max(k+2) ) y8min = min( delta_min(k ), delta_min(k+1), 1 delta_min(k+2) ) call SCALE1( y8min, y8max, nydiv, xminp, xmaxp, y8dist ) ymax = xmaxp ymin = xminp ydist = y8dist call plcol0_( 13 ) call plenv_( xmin, xmax, ymin, ymax, 0, 0 ) call plbox_( 'bcnst', xdist, 0, 'bcnstv', ydist, 0 ) if( k .lt. 4 ) then text = '#frSolar System Barycenter '// 1 TRIM(planet_names(j))// 2 ' Position Residuals (E-C) - DIVA' elseif( k .lt. 7 )then text = '#frSolar System Barycenter '// 1 TRIM(planet_names(j))// 2 ' Velocity Residuals (E-C) - DIVA' else text = '#frSolar System Barycenter '// 1 TRIM(planet_names(j))// 2 ' RIC Position Residuals (E-C) - DIVA' end if call plcol0_( 6 ) call pllab_( 'Julian Day', 'Residuals (km)', text ) do while( .not. done ) npts= 0 do ii = 1, max_pts read( unit = lunit, fmt = *, iostat = iret ) 1 tjd(ii), ( diff(ii,jj), jj = 1, 9 ) if( iret .ne. 0 ) then done = .true. exit else npts = ii end if end do if( npts .ne. 0 ) then call plcol0_( 1 ) call plline_( npts, tjd(1), diff(1, k ) ) call plcol0_( 3 ) call plline_( npts, tjd(1), diff(1, k+1) ) call plcol0_( 9 ) call plline_( npts, tjd(1), diff(1, k+2) ) end if end do call pleop_() end do end if c ---------------------------------------------------------------------- c call plend_() to close Plplot c ---------------------------------------------------------------------- call plend_() c ---------------------------------------------------------------------- c return to the calling routine c ---------------------------------------------------------------------- return c ---------------------------------------------------------------------- c format statements c ---------------------------------------------------------------------- 2000 format( a, //, ' ', t5, 'Plplot version: ', a, // ) end -- ------------------------------------------------------------------------ Samuel H. Dupree, Jr. sd...@sp... 600 West Harvey Street Apartment A-703 http://www.speakeasy.org/~sdupree/ Philadelphia, PA 19144-4345, USA HOME: 215-842-3663 WORK: 610-531-7994 FAX: 610-531-3145 "What does it take to travel in space? The will to do it.." - Dr. Wernher von Braun ------------------------------------------------------------------------ |
From: Alan W. I. <ir...@be...> - 2002-11-05 20:08:51
|
Samuel, Please make sure PLplot builds correctly on your system first before we get into any details of your own code. Can you build and run the fortran examples? A demonstration build can be done by make fdemos in the plplot/tmp directory. Another alternative is to build (make) and install (make install) plplot. Then cd to $prefix/lib/plplot5.1.0/examples/f77, and then execute make fdemos. Once the fortran examples are working, then you should be able to quickly learn from them what (if anything) is wrong with your own code, although if you are really stuck, I might be able to give you a further hand. Alan email: ir...@be... phone: 250-727-2902 FAX: 250-721-7715 snail-mail: Dr. Alan W. Irwin Department of Physics and Astronomy, University of Victoria, P.O. Box 3055, Victoria, British Columbia, Canada, V8W 3P6 __________________________ Linux-powered astrophysics __________________________ |