Hi. Does anybody know why [on both 84+ CSE and 84+CE-T] the command

Code:
Plot1(Histogram,ʟ1,ʟ2,RED

will work (given that both lists are already defined, and compatible), but any of

Code:
Plot1(Histogram,ʟ1,ʟ2,11


Code:
11→X:Plot1(Histogram,ʟ1,ʟ2,X


Code:
RED→X:Plot1(Histogram,ʟ1,ʟ2,X

generates a Syntax error?
I have successfully used the numerical equivalents of Colors in several ways in previous programs, and wanted to have this plot come up in a color generated within the program, so use a variable to represent the color. Furthermore, the Catalog Help for Plot commands specifies color# as the final argument, clearly implying that a number will work.
The same snag applies to other Plot Types; it isn't specific to Histogram. Short of having a succession of lines of code of the following type

Code:
If X=11:Plot1(Histogram,ʟ1,ʟ2,RED

for each of the colors, I can't see a way round this. Yet I really feel it ought to work in any of the versions above anyway.
I think this just comes from poor implementation of the color arguments. Remember these commands were available on the monochrome calcs where there was no use for the color argument. I think there is a similar issue with the linestyle argument in other commands where you can sometimes use numbers and sometimes you can't. Unfortunately I don't think there is a way around it since you can't use the Histogram token in a sequential variable (u,v,w) and you can't perform operations on them and have them still work (because something like Drakgray/2=12, which is black, but this doesn't work in stat plots). You might be able to work something out with an asm subprogram or hybrid libs to store a string to another program and then run that program, but I haven't tried this or seen someone doing this for that purpose, so for now, your best bet is to use the large tedious method you mentioned above. If I can remember to do so, I will try the subprogram thing when I get home and edit this post with my results.
I fear you may be right, although the TI_84Plus_C_Guidebook pdf does state categorically on p362:

Plot#(type,Xlist, [,freqlist,color#])
Defines Plot# (1, 2, or 3) of type Histogram or Boxplot for Xlist with frequency freqlist and color #: 10-24.
Note: Xlist represents the Xlist name.

This ought to work!!
EDIT: Although I feel like this is kind of overkill, storing it to a program and running that program does work (and might even be the only way to get this to work). Here is the code I came up with, it is pretty straightforward. Because of the use of celtic II, this will only work on the ti-84+ CSE for now, and eventually on the ti-84+ CE.

Code:
"SUB→Str0
det(6       //deleting prgmSUB in case it already exists
det(4       //recreating prgmSUB
"Plot1(Histogram,ʟ₁,ʟ₂,"+sub("BLUEREDBLACKMAGENTAGREENORANGEBROWNNAVYLTBLUEYELLOWWHITELTGRAYMEDGRAYGRAYDARKGRAY",N,1→Str9      //storing the code we want to run in Str9 (N is the number of the color we want (1 is blue, 2 is red, etc.)
1
det(2      //Inserting the contents of Str9 into the 1st line of prgmSUB
prgmSUB      //Running prgmSUB
mr womp womp wrote:
EDIT: Although I feel like this is kind of overkill, storing it to a program and running that program does work (and might even be the only way to get this to work). Here is the code I came up with, it is pretty straightforward. Because of the use of celtic II, this will only work on the ti-84+ CSE for now, and eventually on the ti-84+ CE. A similar approach would be possible on the monochrome ti-84+/83+, but the commands would differ because celtic III was implemented in DCS7.

Code:
"SUB→Str0
det(6       //deleting prgmSUB in case it already exists
det(4       //recreating prgmSUB
"Plot1(Histogram,ʟ₁,ʟ₂,"+sub("BLUEREDBLACKMAGENTAGREENORANGEBROWNNAVYLTBLUEYELLOWWHITELTGRAYMEDGRAYGRAYDARKGRAY",N,1→Str9      //storing the code we want to run in Str9 (N is the number of the color we want (1 is blue, 2 is red, etc.)
1
det(2      //Inserting the contents of Str9 into the 1st line of prgmSUB
prgmSUB      //Running prgmSUB


Thanks for going to so much effort! I admit I don't understand why that would work: won't a substring of length 1 simply be a single letter and not a color name at all? Anyway, if it works you're brilliant, but I was still rather hoping that in some way the color number as described in TI's own Handbook ought to work. But for the time being I'm probably going to develop my program without that extra frill and just use a single default color instead. I've put you to too much trouble already.
Its no trouble at all, I enjoy doing this Smile
Also, the substring of length 1 is actually 1 token, rather than 1 character. I did not type out the colors, those are the tokens that I got from the COLOR sub-menu in the VARS menu. That's why this works.
Got it! In that case I might try writing something like this in TI-BASIC using expr(sub( with the String of tokens you've indicated. First glance, it looks as though this will work, but I don't have time to try it properly at the moment.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement