s-news
[Top] [All Lists]

[S] The woes of colors in S-Plus

To: "'s-news@wubios.wustl.edu'" <s-news@wubios.wustl.edu>
Subject: [S] The woes of colors in S-Plus
From: "Wright, Kevin" <WRIGHTKEVI@phibred.com>
Date: Tue, 14 Dec 1999 11:07:11 -0600
Sender: owner-s-news@wubios.wustl.edu
I'm using S+2000, Release 2.  I'm feeling kind of blue because of the way
colors are handled in S+.  I'm most interested in knowing if there are
15,16,17 or 18 colors in S+ and exactly how colors are recycled.  I've
reason to think each of those numbers is 'correct'.  It may be that I'm
trying to do things that I shouldn't be doing, but good software shouldn't
succumb to my ignorance.  Maybe this is something that has beeen fixed in a
service pack?

Kevin Wright


The Programmer's Guide, page 258, says there are 15 colors (plus the color
zero, which is the background color.  It further says that the colors can be
viewed with 
  pie(rep(1,15,col=1:15)

In a graph where I "recycle" colors, I've found that I can actually view 17
colors (plus the background):
pie(rep(1,18),col=0:17)

The programmer's guide says that colors are used cyclically, "If you specify
col=9 and your color map has only 8 colors, S-Plus prints color 1".  If I
ask for just ONE color number greater than the total number of colors, I've
found this to be true.  However,  while
  pie(rep(1,50),col=1:17)
properly recycles colors,
  pie(rep(1,50),col=1:50)
does NOT recycle colors, but forces pie slice numbers 17-50 to be all the
same color.

Oh, now this is cute...arrange the commands window and graph window to be
side by side, then give these commands:
  x_1:20
  y_x
  plot(x,y,type='n')
  abline(v=x,col=x)
It appears to properly recycle colors, but when I slide the commands window
over the graph window, then slide the commands window away from the graph
window, the recycled colors have changed to be all the same color.

If I then overlay the color number,
  text.default(x,y,labels=x,col=x)
the colors for the labels ARE properly recycled.  (And don't change colors
when temporarily covered by the commands window.)  However, the labels are
printed in 16 different colors, while the lines are drawn in 17 different
colors.  (Neither count includes the background color.)


While I'm discussing color, I'll claim a Donald Norman (The Design of
Everyday Things) viewpoint and say that the difference between "User Colors"
and "Image Colors" in the Color Schemes dialog is not very clear. (The cheap
joke is to imagine users in different colors.) Plus, it is confusing that
there is NO indication in the "Color Schemes" dialog box which color scheme
is currently being used.  Further, one has to wonder at the logic of setting
the current color scheme in a dialog called "Graph Styles" instead of the
"Color schemes" dialog box.

I'm generally impressed with the quality of graphics output from S-Plus, but
feel that Mathsoft has really struck out when it comes to color.

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>
  • [S] The woes of colors in S-Plus, Wright, Kevin <=