[gradsusr] Change Numbers for Words: CBARN
Matt Alonso
matt.alonso at gmail.com
Fri Sep 14 20:16:39 EDT 2012
Hi Guisseppe,
It has been a bit since I've done much scripting in grads so this might not
be the optimal approach; it depends on how flexible this needs to me. I've
never tried passing arrays as function args but you might want to try that.
There are 2 main things you need to do:
1) Create an array at the top of the function w/the text you want displayed:
labels.1=''
labels.2='cold'
labels.3='warm'
.....
2) Then change the code that plots the strings
* Put numbers under each segment of the color key
* num started at 0 but the array index for labels started
* at 1, so we need to account for that
labNum=num+1
label=labels.labNum
if (num < cnum-1)
if (vert)
xp=xr+stroff
'draw string 'xp' 'yt' 'label
else
yp=yb-stroff
'draw string 'xr' 'yp' 'label
endif
endif
I haven't actually tried this but it seems like it should work.
Let me know how it goes.
On Sun, Sep 9, 2012 at 11:02 PM, arturo vasqez <hibiki_inuyasha at yahoo.es>wrote:
> Hi all.
> I need help with the function CBARN, i want to configure the output of the
> bar. I want to put words instead of numbers, for example if the bar give me:
>
> ________________________
> _____/______/_____/____/
> 2 4 6 8 10
>
>
> i want to put it like this
> ________________________
> _____/______/_____/____/
> cold warm hot and so on ...
>
> any help please i don't know which part of the CBARN.gs i have to modify
> .... please if anyone knows how to do it, please help me.
>
>
> Thanks.
>
> Guisseppe Vasquez
> Agraria University, Peru
>
>
>
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20120914/98ddf8a9/attachment-0003.html
More information about the gradsusr
mailing list