source: trunk/SRC/Documentation/idldoc_html_output/ToBeReviewed/PLOTS/DESSINE/bar_plot.html

Last change on this file was 338, checked in by smasson, 16 years ago

update documentation

File size: 13.1 KB
Line 
1
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
5<!-- Generated by IDLdoc 2.0 -->
6
7<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
8  <head>
9    <title>bar_plot.pro (SAXO Documentation)</title>
10
11   
12    <link rel="stylesheet" type="text/css" media="all" href="./../../../main_files.css" />
13    <link rel="stylesheet" type="text/css" media="print" href="./../../../main_files_print.css" />
14   
15
16    <script type="text/javascript">
17      function setTitle() {
18        parent.document.title="bar_plot.pro (SAXO Documentation)";
19      }
20    </script>
21  </head>
22
23  <body onload="setTitle();">
24
25    <div id="navbar_title">
26  <h1>SAXO Documentation</h1>
27</div>
28
29
30<div id="main_navbar">
31
32  <table cellspacing="0">
33    <tr>
34     
35      <td><a href="./../../../overview.html" title="Overview of library">Overview</a></td>
36     
37
38     
39      <td >Directory</td>
40     
41
42     
43      <td><a href="./../../../idldoc-categories.html" title="Browse library by category">Categories</a></td>
44     
45
46     
47      <td><a href="./../../../idldoc-index.html" title="Index of files, routines, and parameters">Index</a></td>
48     
49
50     
51      <td><a href="./../../../search-page.html" title="Search library">Search</a></td>
52     
53
54      <td id="selected">File</td>
55
56     
57      <td><a href="../../../../../ToBeReviewed/PLOTS/DESSINE//bar_plot.pro" title="Source code of a file">Source</a></td>
58     
59
60     
61      <td><a href="./../../../idldoc-help.html" title="Help on IDLdoc">Help</a></td>
62     
63
64      <td >Etc</td>
65
66      <td id="flexible">Developer&nbsp;documentation</td>
67    </tr>
68  </table>
69
70</div>
71
72<div id="secondary_navbar">
73
74&lt;&lt; prev file | <a href="plt.html">next file &gt;&gt;</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="bar_plot.html" target="_TOP">view single page</a> | <a href="./../../../index.html" target="_TOP">view frames</a>&nbsp;&nbsp;&nbsp;&nbsp;summary: fields | routine&nbsp;&nbsp;&nbsp;&nbsp;details: <a href="#routine_details">routine</a>
75
76</div>
77
78
79    <div id="container">
80
81      <h1 class="directory"><a href="directory-overview.html">ToBeReviewed/PLOTS/DESSINE/</a></h1>
82      <h2 class="pro_file">bar_plot.pro</h2>
83
84      <div id="file_attr">
85        <dl>
86        </dl>
87      </div>
88
89      <div id="file_comments">
90 Create a bar graph, or overplot on an existing one.
91</div>
92
93     
94
95     
96
97     
98
99     
100
101      <div id="routine_details">
102       
103
104        <div class="routine_details" id="_bar_plot">
105
106          <h2><a class="top" href="#container">top</a>bar_plot <span class="categories">
107 Graphics
108</span></h2>
109       
110          <p class="header">
111            bar_plot<span class="result">, <a href="#_bar_plot_param_values">values</a></span>, <a href="#_bar_plot_keyword_BASELINES">BASELINES</a>=<span class="result">vector</span>, <a href="#_bar_plot_keyword_COLORS">COLORS</a>=<span class="result">vector</span>, <a href="#_bar_plot_keyword_BARNAMES">BARNAMES</a>=<span class="result">string</span>, <a href="#_bar_plot_keyword_TITLE">TITLE</a>=<span class="result">string</span>, <a href="#_bar_plot_keyword_XTITLE">XTITLE</a>=<span class="result">string</span>, <a href="#_bar_plot_keyword_YTITLE">YTITLE</a>=<span class="result">string</span>, <a href="#_bar_plot_keyword_BASERANGE">BASERANGE</a>=<span class="result">float</span>, <a href="#_bar_plot_keyword_BARWIDTH">BARWIDTH</a>=<span class="result">float</span>, <a href="#_bar_plot_keyword_BARSPACE">BARSPACE</a>=<span class="result">scalar</span>, <a href="#_bar_plot_keyword_BAROFFSET">BAROFFSET</a>=<span class="result">scalar</span>, <a href="#_bar_plot_keyword_OUTLINE">OUTLINE</a>=<span class="result">OUTLINE</span>, <a href="#_bar_plot_keyword_OVERPLOT">OVERPLOT</a>=<span class="result">OVERPLOT</span>, <a href="#_bar_plot_keyword_BACKGROUND">BACKGROUND</a>=<span class="result">scalar</span>, <a href="#_bar_plot_keyword_ROTATE">ROTATE</a>=<span class="result">ROTATE</span>, <a href="#_bar_plot_keyword__EXTRA">_EXTRA</a>=<span class="result">_EXTRA</span></p>
112       
113          <div class="comments">
114</div>
115
116         
117
118         
119            <h3>Parameters</h3>
120       
121           
122            <h4 id="_bar_plot_param_values">values&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
123              <span class="attr">in</span>
124             
125             
126              <span class="attr">required</span>
127             
128              <span class="attr">type:</span> <span class="value">vector</span>
129             
130             
131            </h4>
132       
133          <div class="comments">
134 A vector containing the values to be represented by the bars.
135 Each element in VALUES corresponds to a single bar in the
136 output.
137</div>
138           
139
140         
141
142         
143
144            <h3>Keywords</h3>
145           
146            <h4 id="_bar_plot_keyword_BASELINES">BASELINES&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
147             
148             
149             
150             
151             
152              <span class="attr">type:</span> <span class="value">vector</span>
153             
154             
155            </h4>
156       
157            <div class="comments">
158 A vector, the same size as VALUES, that contains the
159 base value associated with each bar.  If not specified,
160 a base value of zero is used for all bars.
161</div>
162           
163            <h4 id="_bar_plot_keyword_COLORS">COLORS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
164             
165             
166             
167             
168             
169              <span class="attr">type:</span> <span class="value">vector</span>
170             
171             
172            </h4>
173       
174            <div class="comments">
175 A vector, the same size as VALUES, containing the color index
176 to be used for each bar.  If not specified, the colors are
177 selected based on spacing the color indexes as widely as
178 possible within the available colors (specified by D.N_COLORS).
179</div>
180           
181            <h4 id="_bar_plot_keyword_BARNAMES">BARNAMES&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
182             
183             
184             
185             
186             
187              <span class="attr">type:</span> <span class="value">string</span>
188             
189             
190            </h4>
191       
192            <div class="comments">
193 A string array, containing one string label per bar.
194 If the bars are vertical, the labels are placed beneath
195 them.  If horizontal (rotated) bars are specified, the labels
196 are placed to the left of the bars.
197</div>
198           
199            <h4 id="_bar_plot_keyword_TITLE">TITLE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
200             
201             
202             
203             
204             
205              <span class="attr">type:</span> <span class="value">string</span>
206             
207             
208            </h4>
209       
210            <div class="comments">
211 A string containing the main title to for the bar plot.
212</div>
213           
214            <h4 id="_bar_plot_keyword_XTITLE">XTITLE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
215             
216             
217             
218             
219             
220              <span class="attr">type:</span> <span class="value">string</span>
221             
222             
223            </h4>
224       
225            <div class="comments">
226 A string containing the title for the X axis.
227</div>
228           
229            <h4 id="_bar_plot_keyword_YTITLE">YTITLE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
230             
231             
232             
233             
234             
235              <span class="attr">type:</span> <span class="value">string</span>
236             
237             
238            </h4>
239       
240            <div class="comments">
241 A string containing the title for the Y axis.
242</div>
243           
244            <h4 id="_bar_plot_keyword_BASERANGE">BASERANGE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
245             
246             
247             
248             
249             
250              <span class="attr">type:</span> <span class="value">float</span>
251             
252             
253            </h4>
254       
255            <div class="comments">
256 A floating-point scalar in the range 0.0 to 1.0, that
257 determines the fraction of the total available plotting area
258 (in the direction perpendicular to the bars) to be used.
259 If not specified, the full available area is used.
260</div>
261           
262            <h4 id="_bar_plot_keyword_BARWIDTH">BARWIDTH&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
263             
264             
265             
266             
267             
268              <span class="attr">type:</span> <span class="value">float</span>
269             
270             
271            </h4>
272       
273            <div class="comments">
274 A floating-point value that specifies the width of the bars
275 in units of "nominal bar width".  The nominal bar width is
276 computed so that all the bars (and the space between them,
277 set by default to 20% of the width of the bars) will fill the
278 available space (optionally controlled with the BASERANGE
279 keyword).
280</div>
281           
282            <h4 id="_bar_plot_keyword_BARSPACE">BARSPACE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
283             
284             
285             
286             
287             
288              <span class="attr">type:</span> <span class="value">scalar</span>
289             
290             
291            </h4>
292       
293            <div class="comments">
294 A scalar that specifies, in units of "nominal bar width",
295 the spacing between bars.  For example, if BARSPACE is 1.0,
296 then all bars will have one bar-width of space between them.
297 If not specified, the bars are spaced apart by 20% of the bar
298 width.
299</div>
300           
301            <h4 id="_bar_plot_keyword_BAROFFSET">BAROFFSET&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
302             
303             
304             
305             
306             
307              <span class="attr">type:</span> <span class="value">scalar</span>
308              <span class="attr">default:</span> <span class="value">BARSPACE</span>
309             
310            </h4>
311       
312            <div class="comments">
313 A scalar that specifies the offset to be applied to the
314 first bar, in units of "nominal bar width".  This keyword
315 allows, for example, different groups of bars to be overplotted
316 on the same graph.
317</div>
318           
319            <h4 id="_bar_plot_keyword_OUTLINE">OUTLINE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
320             
321             
322             
323             
324             
325             
326             
327             
328            </h4>
329       
330            <div class="comments">
331 If set, this keyword specifies that an outline should be
332 drawn around each bar.
333</div>
334           
335            <h4 id="_bar_plot_keyword_OVERPLOT">OVERPLOT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
336             
337             
338             
339             
340             
341             
342             
343             
344            </h4>
345       
346            <div class="comments">
347 If set, this keyword specifies that the bar plot should be
348 overplotted on an existing graph.
349</div>
350           
351            <h4 id="_bar_plot_keyword_BACKGROUND">BACKGROUND&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
352             
353             
354             
355             
356             
357              <span class="attr">type:</span> <span class="value">scalar</span>
358              <span class="attr">default:</span> <span class="value">The normal IDL background color is used</span>
359             
360            </h4>
361       
362            <div class="comments">
363 A scalar that specifies the color index to be used for
364 the background color.
365</div>
366           
367            <h4 id="_bar_plot_keyword_ROTATE">ROTATE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
368             
369             
370             
371             
372             
373             
374             
375             
376            </h4>
377       
378            <div class="comments">
379 If set, this keyword indicates that horizontal rather than
380 vertical bars should be drawn.  The bases of horizontal bars
381 are on the left, "Y" axis and the bars extend to the right.
382</div>
383           
384            <h4 id="_bar_plot_keyword__EXTRA">_EXTRA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
385             
386             
387             
388             
389             
390             
391             
392             
393            </h4>
394       
395            <div class="comments"></div>
396           
397         
398
399          <h3>Examples</h3><div class="preformat">
400 By using the overplotting capability, it is relatively easy to create
401        stacked bar charts, or different groups of bars on the same graph.
402
403        For example, if ARRAY is a two-dimensional array of 5 columns and 8
404        rows, it is natural to make a plot with 5 bars, each of which is a
405        "stacked" composite of 8 sections.  First, create a 2D COLORS array,
406        equal in size to ARRAY, that has identical color index values across
407        each row to ensure that the same item is represented by the same color
408        in all bars.
409
410        With ARRAYS and COLORS defined, the following code fragment
411        illustrates the creation of stacked bars (note that the number of rows
412        and columns is arbitrary):
413
414        !Y.RANGE = [0,ymax] ; Scale range to accommodate the total bar lengths.
415        BASE = INTARR(NROWS)
416        FOR I = 0, NROWS-1 DO BEGIN
417           BAR_PLOT, ARRAY(*,I), COLORS=COLORS(*,I), BASELINES=BASE, $
418                     BARWIDTH=0.75, BARSPACE=0.25, OVER=(I GT 0)
419           BASE = BASE + ARRAY(*,I)
420        ENDFOR
421
422        To plot each row of ARRAY as a clustered group of bars within the same
423        graph, use the BASERANGE keyword to restrict the available plotting
424        region for each set of bars.  The sample code fragment below
425        illustrates this method:
426
427        FOR I = 0, NROWS-1 DO $
428           BAR_PLOT, ARRAY(*,I), COLORS=COLORVECT, BARWIDTH=0.8,BARSPACE=0.2, $
429             BAROFFSET=I*((1.0+BARSPACE)*NCOLS), OVER=(I GT 0), BASERANGE=0.19
430
431        where NCOLS is the number of columns in ARRAY, and COLORVECT is a
432        vector containing the color indices to be used for each group of
433        bars.  (In this example, each group uses the same set of colors, but
434        this could easily be changed.)
435</div>
436          <h3>Version history</h3>
437         
438          <h4>Version</h4><div class="preformat">
439 $Id: bar_plot.pro 327 2007-12-13 16:22:35Z pinsard $
440</div>
441          <h4>History</h4><div class="preformat">
442 August 1990, T.J. Armitage, RSI, initial programming.  Replacement
443        for PLOTBAR and OPLOTBAR routines written by William Thompson.
444
445        September 1990, Steve Richards, RSI, changed defaults to improve the
446        appearance of the bar plots in the default mode. Included
447        spacing the bars slightly.
448</div>
449         
450         
451         
452         
453         
454         
455         
456       
457         
458         
459         
460         
461         
462         
463         
464       
465          <h3>Statistics</h3>
466          <table class="statistics">
467            <tr><td>McCabe cyclic</td><td>          20</td></tr>
468            <tr><td>McCabe essential</td><td>           1</td></tr>
469            <tr><td>McCabe modular design</td><td>           1</td></tr>
470          </table>
471         
472       
473        </div>
474       
475      </div>
476
477     
478
479      <div id="tagline">Produced by IDLdoc 2.0.</div>
480
481    </div>
482
483  </body>
484</html>
Note: See TracBrowser for help on using the repository browser.