Dan,
Don, I experienced a similar problem with a C++ program, wxWidgets, and PLplot 5.9.5. It occurred when init() was called before I called scolbg(). You are doing the same with the corresponding functions plinit() and plscolbg(). The PRM says: "There are a number of options for changing the default red on black colors. The user may set the index 0 background color using the command-line bg parameter or by calling plscolbg (or plscol0 with a 0 index) before plinit. During the course of the plot, the user can change the foreground color as often as desired using plcol0 to select the index of the desired color." (Chapter 3, Setting Color.) So the PRM seems to require that the colour map should be set up before calling plinit(). However, this did not work for me. After some hacking, I called scolbg() or scol0() AFTER indirectly calling init() (via the wxPLplotstream constructor), and then called clear(). This seemed to work and I assumed that the strangeness was just a result of my lack of familiarity with PLplot. Hope this helps. Jack Dodds > -----Original Message----- > From: Don Spong [mailto:[email protected]] > Sent: Monday, February 08, 2010 5:52 PM > To: [email protected] > Subject: [Plplot-general] Absence of Map0 colors after calling plscolbg > > Hello, > > I am running plplot version 5.9.5 on MacOS Snow Leopard with a code that > makes several line plots. If I use the default black background, then I > can call plcol0 before each call to plline to set different colors for > each line as expected. However, if I call plscolbg(255,255,255) (before > plinit) to get a white background, then all of the lines that should have > different colors now only come out in black. It seems that calling > plscolbg has the unintended consequence of wiping out all of the colors in > Map0 so that now color 0 is white and the others (colors 1 - 15) are now > black. Any suggestions as to how to get curves with different colors when > using a white background? A test code is given below. > > -Thanks, Don > > > implicit none > integer :: ns, mpol, ntor, mnmax, ljmn, js, mn, ipsi, nstep > 1 , nstart, j, i, k, nfp, ierr, ns1, mnmax_nyq, itst, ii, err > real*8, dimension(200) :: rmaj_ar1, zz_ar1, > 1 rmaj_ar2, zz_ar2, rmaj_ar3, zz_ar3 > real*8, dimension(200) :: rmaj1, rmaj2, rmaj3, rmaj4 > real*8, dimension(200) :: zmaj1, zmaj2, zmaj3, zmaj4 > real*8, dimension(200) :: rplot, zplot > real*8 :: two_pi, thet, zeta, rmaj, zz, arg > real*8 :: rmin1, rmax1, zmin1, zmax1 > > integer nargs, numargs, numchars, iarg > C----------------------------------------------- > two_pi = 8.d0*atan(1.d0) > ns1 = 10; nfp = 1; j = 1 > do iarg = 1,3 > zeta = (two_pi/4.d0)*dble(j-1)/dble(nfp) > do i=1,200 > thet = (i - 1)*two_pi/199. > rmaj = 6.d0; zz = 0.d0 > arg = thet > if(iarg .eq. 1) then > rmaj = rmaj + 2.*cos(arg) > zz = zz + 2.*sin(arg) > else if(iarg .eq. 2) then > rmaj = rmaj + cos(arg) > zz = zz + 2.*sin(arg) > else if(iarg .eq. 3) then > rmaj = rmaj + 2.*cos(arg) > zz = zz + sin(arg) > end if > if(iarg .eq. 1) then > rmaj_ar1(i) = rmaj; zz_ar1(i) = zz > else if(iarg .eq. 2) then > rmaj_ar2(i) = rmaj; zz_ar2(i) = zz > else if(iarg .eq. 3) then > rmaj_ar3(i) = rmaj; zz_ar3(i) = zz > end if > end do !i=1,200 > > rmin1 = 3.; rmax1 = 9.; zmin1 = -3.; zmax1 = 3. > > end do !iarg = 1,3 > > call plscolbg(255,255,255) > call plinit() > call plenv(rmin1,rmax1,zmin1,zmax1,1,1) > do i = 1,200 > rplot(i) = rmaj_ar1(i); zplot(i) = zz_ar1(i) > end do > call plcol0(1) > call plline(200,rplot,zplot,0) > do i = 1,200 > rplot(i) = rmaj_ar2(i); zplot(i) = zz_ar2(i) > end do > call plcol0(3) > call plline(200,rplot,zplot,0) > do i = 1,200 > rplot(i) = rmaj_ar3(i); zplot(i) = zz_ar3(i) > end do > call plcol0(10) > call plline(200,rplot,zplot,0) > call plend > stop > end > > > > > -------------------------------------------------------------------------- > ---- > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the > business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > Plplot-general mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/plplot-general ------------------------------------------------------------------------------ SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev _______________________________________________ Plplot-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/plplot-general
