labels (optional) A string array of labels for the legend. The array must contain the same number of elements as data. If this parameter is not supplied, no legend is displayed.
Line_Fill If nonzero, a line fill algorithm is used to fill the slices. This keyword can also be set to an array of ones and zeroes to apply line filling to specific slices. (Default: no line filling)
Fill_Thick A floating point scalar or array specifying the thickness of fill lines. If set to a scalar value, all slices receive the same line thickness. If set to an array, line thicknesses are mapped, in sequential slices, to the value of each array index. A thickness of 1 is normal, two is double-wide, and so on. (Default: !P.Thick)
NOTE: This keyword has no effect unless Line_Fill is set.
NOTE: This keyword has no effect unless Line_Fill is set.
NOTE: This keyword has no effect unless Line_Fill is set.
Index | X Windows Style | Windows Style |
---|---|---|
0 | Solid | Solid |
1 | Dotted | Short dashes |
2 | Dashed | Long dashes |
3 | Dash dot | Long-short dashes |
4 | Dash-dot-dot-dot | Long-short-short dashes |
5 | Long dashes | Long dashes |
NOTE: This keyword has no effect unless Line_Fill is set.
NOTE: This keyword has no effect unless Line_Fill is set.
Outline_Color An integer specifying the color index used for the outline of the pie slices and for the box around the legend. (Default: !P.Color)
NoLegend_Box If nonzero, do not draw a box around the legend.
Legend_Position Specifies the corner in which to place the legend. Choices are:
TIP: If you do not want a legend to appear, do not specify the labels input parameter.
Value_Label If nonzero, each slice is labeled with its value from the data array. If the slice is too small so that the text won't fit, then it is not be labeled. You may not specify both the Percent_Label and Value_Label keywords.
Label_Colors Colors used for the slice labels, if one of Percent_Label or Value_Label is set. May be a scalar or an array. If If set to a scalar, the specified color applies to all of the slices. If set to an array, the colors for each slice are mapped, sequentially, to the value of each array index. (Default: !P.Color)
Explode An array of ones and zeroes specifying which (if any) slices should be "exploded" (drawn away from the center of the pie circle). This array must have the same number of elements as data. (Default: not exploded)
Offset_Explode A scalar specifying the offset from the center of the circle for exploded slices. The value is a fraction of the circle radius. (Default: 0.1)
Shadow_Color An integer specifying the color index for a shadow under the circle. (Default: no shadow)
Offset_Shadow A scalar specifying the offset from the center of the pie circle for the shadow. The value is a fraction of the circle radius. (Default: 0.05)
Slice_Start_Ang A floating point value specifying the angle, in degrees clockwise from the vertical, where to start drawing the first slicethe slice represented by data(0). (Default: 0 (vertical)).
Slice_Reverse_Direction If nonzero, draws slices in counterclockwise order rather than in the default direction, clockwise.
Other PIE keywords are listed below. For a description of each keyword, see Chapter 3, Graphics and Plotting Keywords, in the PV-WAVE Reference.
Charsize | Noerase | Title |
Font | Subtitle | [XY]Margin |
A legend for the colored pie slices is displayed in one corner, and labels (percent or data value) may be displayed on the slices.
If the legend occupies a significant portion of the plot area, there may not be enough room for the pie chart. The pie may be drawn very small, or it may overlap the legend. Use a smaller character size or a larger window.
Some combinations of shadowing and explosion may cause the pie to be slightly smaller than you may consider optimal. Sometimes, the shadow may overlap the corner of the legend box. Try moving the legend to the left side (set the keyword Legend_Position to 0 or 2).
Negative values in data produce unwanted plotting results (some slices are plotted backwards); therefore, the absolute value of data is plotted. All labels, however, will display the correct negative values.
You can use !P.Multi, !P.Position, and !P.Region with PIE.
; Create data data = FLTARR(4) data(0) = 32 data(1) = 22 data(2) = 11 data(3) = 35 ; Create labels strg = STRARR(4) strg(0)='Renault' strg(1)='Peugeot' strg(2)='Citroen' strg(3)='Others' title = '!18French automobile market shares' ; Create pie chart PIE, data, strg, /Line_fill, Title=title, Fill_background=1, $ /Percent_label, Text_color=1
Figure 2-65 A pie chart with line-filled slices, a legend, and a title. Each slice is labeled with its percentage of the total pie.See Also