File: gradients.htm

package info (click to toggle)
extrema 4.3.6-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 19,212 kB
  • ctags: 6,452
  • sloc: cpp: 86,428; sh: 8,229; makefile: 814
file content (112 lines) | stat: -rw-r--r-- 5,186 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<HTML>
<HEAD>
<TITLE>Color gradients</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">

<P><font size="+3" color="green"><B>Color gradients</B></font></P>

<TABLE border="1" cols="2" frame="box" rules="all" width="572">
<TR>
<TD width="15%" valign="top"><B>Syntax</B>:</TD>
<TD width="85%" valign="top"><CODE>
DENSITY { x y } z { p1 p2 }</CODE>
</TD></TR>
<TR>
<TD width="15%" valign="top"><B>Qualifiers</B>:</TD>
<TD width="85%" valign="top"><CODE>
\LEGEND, \HISTOGRAM, \PARTIAL, \XPROFILE, \YPROFILE, \BORDER, \AXES, \RESET</CODE>
</TD></TR>
<TR>
<TD width="15%" valign="top"><B>Defaults</B>:</TD>
<TD width="85%" valign="top"><CODE>
if <CODE>z</CODE> is a matrix:
<CODE>x=[1;2;3;...], y=[1;2;3;...],</CODE>
<CODE>p1 = 0, p2 = 1,</CODE>
\LINEAR, \-PARTIAL, \-XPROFILE, \-YPROFILE, \BORDER, \AXES, \RESET</CODE>
</TD></TR>
</TABLE>
<P>
 Color gradients is the default density type. No qualifiers are
 needed to produce this type of drawing. The range of values of the matrix is
 divided into ten (10) equal levels, and a different color is associated
 with each level. By default, a value is interpolated at each pixel location
 within the matrix region so as to give smoothly joined regions.</P>
<P>
 <font size="+1" color="green">Input variables</font></P>
<P>
 If <CODE>z</CODE> is a vector, the parameters <CODE>x</CODE> and <CODE>y</CODE>
 are expected and must be vectors. <CODE>x</CODE> and <CODE>y</CODE> are assumed to represent a scattered set
 of points, where <CODE>z[i]</CODE> is the altitude corresponding to the location
 <CODE>(x[i],y[i])</CODE>. A matrix is interpolated on these scattered points by means of a Thiessen
 triangulation of the plane. The three vectors must be the same length.</p>
<p>
 If <CODE>z</CODE> is a matrix, the parameters <CODE>x</CODE> and <CODE>y</CODE> default to
 <CODE>[1;2;3;...]</CODE>, but if entered they must be vectors. Each matrix element,
 <CODE>z[i,j]</CODE>, is associated with the coordinates
 <CODE>(x[j],y[i])</CODE>.  The length of <CODE>x</CODE> must be equal to
 the number of columns of <CODE>z</CODE> and the length of
 <CODE>y</CODE> must be equal to the number
 of rows. The vectors <CODE>x</CODE> and <CODE>y</CODE> are used for scaling the axes.</p>
<p>
 <font size="+1" color="green">Not interpolated gradients</font></p>
<p>
 If the <CODE>\HISTOGRAM</CODE> qualifier is used, each
 data location is represented by a rectangle of color, centered on the data location.
 The regions are not smoothly joined.</p>
<p>
 <font size="+1" color="green">Changing the range of values</font></p>
<p>
 The optional parameters <CODE>p1</CODE> and <CODE>p2</CODE> can be used to broaden or shrink the range of
 data values. If <CODE>z<sub>max</sub></CODE> is the maximum value of the data and
 <CODE>z<sub>min</sub></CODE> is the minimum value of the data, the full color range
 will be from a minimum of <CODE>p1*(z<sub>max</sub>-z<sub>min</sub>)+z<sub>min</sub></CODE>
 to a maximum of <CODE>p2*(z<sub>max</sub>-z<sub>min</sub>)+z<sub>min</sub></CODE>.
 If <CODE>z</CODE> is a data value and if
 <CODE>z &lt; p1*(z<sub>max</sub>-z<sub>min</sub>)+z<sub>min</sub></CODE>,
 that data value is treated as <CODE>z<sub>min</sub></CODE>.
 If <CODE>z &gt; p1*(z<sub>max</sub>-z<sub>min</sub>)+z<sub>min</sub></CODE>,
 that data value is treated as <CODE>z<sub>max</sub></CODE>.
 The default values are: <CODE>p1=0</CODE> and
 <CODE>p2=1</CODE>.</p>
<p>
 <font size="+1" color="green">Legend</font></p>
<p>
 If the <CODE>\LEGEND</CODE> qualifier is used, a legend is
 drawn along the right side of the axes. The legend requires the right end of the
 <i>x</i>-axis to be set to <CODE>75%</CODE> of the window, that is,
 <CODE><a href="../Characteristics/Xaxis/xupperaxis.htm">XUPPERAXIS</a></CODE> is set to <CODE>75%</CODE>.</P>
<p>
 When a <i>y</i>-profile is drawn, using the
 <CODE>\YPROFILE</CODE> qualifier, the right edge of the axis box must allow space for the
 profile as well as a possible legend. If a <i>y</i>-legend profile and a legend are present, then
 <CODE>XUPPERAXIS</CODE> is set to <CODE>65%</CODE>. If a <I>y</I>-legend profile is present but
 not a legend, then <CODE>XUPPERAXIS</CODE> is set to <CODE>85%</CODE>.</p>
<p>
 By default, <CODE>XUPPERAXIS</CODE> is reset to its former value after the
 <CODE>DENSITY</CODE> command. If the <CODE>/-RESET</CODE> qualifier is used, the
 axis location  is not reset.</p>
<p>
 <font size="+1" color="green">Examples</font></p>
<p>
 These examples use the following vectors.</p>
 <pre>
 X=[  1;  0;  1;  0;   .2; .3;   .5;  .8]
 Y=[  5;  5;  0;  0;    1;1.5;  2.5;   4]
 Z=[ 10; 10; 10; 10; -100; 10; -100; 500]
 </PRE>
<p>
 <font color="blue"><code>SET COLORMAP THERMAL</code><br />
 <CODE>DENSITY\LEGEND X Y Z</CODE></font>
 <img src="gradients1.jpg"></p>
<p>
 <font color="blue"><code>SET COLORMAP RAINBOW</code><br />
 <CODE>DENSITY\LEGEND X Y Z</CODE></font>
 <img src="gradients2.jpg"></p>
<p>
 <a href="densitycommand.htm"><img src="../shadow_left.gif">&nbsp;
 <font size="+1" color="olive">DENSITY command</font></a><br />
 <a href="dithering.htm"><img src="../shadow_right.gif">&nbsp;
 <font size="+1" color="olive">DITHERING</font></a></P>
</BODY>
</HTML>