Displays data as a pie chart.
xcenter, ycenter
radius
Label
Font
Charsize
Tposition
0 | Draw the label inside the slice. |
1 | Draw the label outside the slice. Draw the label text horizontally. |
2 | Draw the label outside the slice. Align the angle of the label text with the slice. |
Tcolor
Tperct
Tvalue
Tborder
Tbord_color
Shade
Explode
Other PIE_CHART keywords are listed below. For a description of each keyword, see Chapter 3, Graphics and Plotting Keywords, in the PV-WAVE Reference.
Channel | Fill_Pattern | Normal | Spacing |
Clip | Linestyle | Pattern | Symsize |
Color | Line_Fill | PClip | T3d |
Data | Noclip | Psym | Thick |
Device | Orientation |
This procedure creates a pie chart at a specified position within the graphics window. You can add text labels and colors to individual slices of the pie. In addition, pie slices can be offset or "exploded" from the center, and slices can be given shadows for a three-dimensional look.
You can display up to 30 slices; however fewer than 15 is recommended for the best display. Labels are not displayed in any slices that are too small. If data for a particular slice represents less than 0.01% of the overall dataset, the slice is not drawn and an informational message appears.
data = fltarr(4) data(0) = 32 data(1) = 22 data(2) = 11 data(3) = 35 strg = strarr(4) ; Create labels ; --------------- strg(0)='Renault' strg(1)='Peugeot' strg(2)='Citroen' strg(3)='Others' title = '!18French automobile market shares' ; Create the window ; ----------------- WINDOW, /Free, Xsize=800, Ysize=800 ; Initialize a white background ; ----------------------------- loadct,13 !p.color=0 !P.Background=!d.n_colors-1 ERASE,!P.Background ; Plot the chart ; -------------- PIE_CHART, data, .5, .5, .25, /Tperc, Explode=[.05,0,0,.1], $ Shade=0.04, Tpos=[1,1,1,1], /Tborder, Color=[60,120,140,200],$ Label=strg, Font='3', Charsize=1.5 XYOUTS, .5,.9, Title, Charsize=3, Charthick=2, Align=.5, $ /Normal, Color=0
Figure 2-66 An exploded pie chart with labels and a title.See Also