Hi Xiao Dong,
>
> Hello Visad Community:
> I am new to visAD. I have a question about display time-series. I have
> time-series data, y(i)=f(x(i))+iK (i=1,...N, K=const). I want to plot them
> on the same graph with different colors to distinguish the lines. How can it
> be implemented?
Suppose you have a line with MathType (data structure) like
( time -> temperature )
See tutorial section 1.3 for such an example:
http://www.ssec.wisc.edu/~billh/tutorial/s1/Section1.html#section1_3
The "trick" to give your data a special color is not to add data to a
display in the usual way:
display.addReference( data_ref );
but instead, to add it with an arrays of ConstantMaps
ConstantMap[] pointsCMap = { new ConstantMap( 1.0f, Display.Red ),
new ConstantMap( 0.0f, Display.Green
),
new ConstantMap( 0.0f, Display.Blue ),
new ConstantMap( 3.50f,
Display.PointSize ) };
And finally add data to display with teh (color) maps:
display.addReference( data_ref, pointsCMap );
This is done in tutorial section 2.4
http://www.ssec.wisc.edu/~billh/tutorial/s2/Section2.html#section2_4
Also note that an answer to your question can be found in Unidata's
visad-list archive
http://www.unidata.ucar.edu/staff/russ/visad/
An answer can be found by searching for the word "color" the archive. If
you browse through the answers you'll find
Re: plotting multiple time-series in different colors
http://www.unidata.ucar.edu/glimpse/visad-list/1777
A search for "time-series" will return an even better result.
Cheers,
Ugo