gnuplot> col(r, g, b) = sprintf('#%X%X%X', r, g, b)
gnuplot> print col(255, 23.4, 255)
#FF17FF
gnuplot> plot sin(x) w l lc rgb col(255, 23.4, 255)
works
'sprintf' returns a string, you don't have to enclose it in quotes.
renzresearch wrote:
>
> Why can't I do this? How can I fix it? Thank you.
>
> Zhong
>
>
>
> gnuplot> col(r, g, b) = sprintf('"#%X%X%X"', r, g, b)
> gnuplot> print col(255, 23.4, 255)
> "#FF17FF"
> gnuplot> plot sin(x) w l lc rgb col(255, 23.4, 255)
> ^
> expected a known color name or a string of form "#RRGGBB"
>
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full
> prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> Gnuplot-info mailing list
> Gnu...@li...
> https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>
>
--
View this message in context: http://www.nabble.com/3D-function-tp23965589p24513410.html
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|