RectangleChart3D[{{x1,y1,z1},{x2,y2,z2},…}]
makes a 3D rectangle chart with bars of width xi, depth yi, and height zi.
RectangleChart3D[{…,wi[{xi,yi,zi},…],…,wj[{xi,yj,zj},…],…}]
makes a 3D rectangle chart with bar features defined by the symbolic wrappers wk.
RectangleChart3D[{data1,data2,…}]
makes a 3D rectangle chart from multiple datasets datai.
RectangleChart3D
RectangleChart3D[{{x1,y1,z1},{x2,y2,z2},…}]
makes a 3D rectangle chart with bars of width xi, depth yi, and height zi.
RectangleChart3D[{…,wi[{xi,yi,zi},…],…,wj[{xi,yj,zj},…],…}]
makes a 3D rectangle chart with bar features defined by the symbolic wrappers wk.
RectangleChart3D[{data1,data2,…}]
makes a 3D rectangle chart from multiple datasets datai.
Details and Options
- Data elements for RectangleChart3D can be given in the following forms:
-
{xi,yi,zi} pure bar width, depth, and height {Quantity[xi,ux],Quantity[yi,uy],Quantity[zi,uz]} bar width, depth, and height with units wi[{xi,yi,zi}i,…] a bar with size {xi,yi,zi} and wrapper wi formi->mi a bar form with metadata mi - Data not given in these forms is ignored in forming the 3D rectangle chart.
- Datasets for RectangleChart3D can be given in the following forms:
-
{e1,e2,…} list of elements with or without wrappers <|k1{x1,y1},k2{x2,y2},…|> association of keys and values TimeSeries[…],EventSeries[…],TemporalData[…] time series, event series, and temporal data WeightedData[…] augmented datasets w[{e1,e2,…},…] wrapper applied to a whole dataset w[{data1,data2,…},…] wrapper applied to all datasets - RectangleChart3D[objcspec] extracts and plots values from the Tabular, TimeSeries or EventSeries object obj using the column specification cspec.
- The following forms of column specifications cspec are allowed for plotting tabular data:
-
{colx,coly,colz} plot data from columns x. y and z {{colx1,coly1,colz1},{colx2,coly2,colz2},…} plot multiple sets of columns - The following wrappers can be used for chart elements:
-
Annotation[e,label] provide an annotation Button[e,action] define an action to execute when the element is clicked EventHandler[e,…] define a general event handler for the element Hyperlink[e,uri] make the element act as a hyperlink Labeled[e,…] display the element with labeling Legended[e,…] include features of the element in a chart legend Mouseover[e,over] make the element show a mouseover form PopupWindow[e,cont] attach a popup window to the element StatusArea[e,label] display in the status area when the element is moused over Style[e,opts] show the element using the specified styles Tooltip[e,label] attach an arbitrary tooltip to the element - In RectangleChart3D, Labeled and Placed allow the following positions:
-
Top,Bottom,Left,Right,Center, Front,Back positions within bars Above,Below, Before, After positions outside bars Axis on the bar origin axis {{bx,by,bz},{lx,ly}} scaled position {lx,ly} in the label at scaled position {bx,by,bz} in the bar - RectangleChart3D has the same options as Graphics3D with the following additions and changes: [List of all options]
-
Axes True whether to draw axes BarOrigin Bottom origin of bars BarSpacing Automatic spacing between bars Boxed False whether to draw a bounding box ChartElementFunction Automatic how to generate raw graphics for bars ChartElements Automatic graphics to use for each of the bars ColorFunction Automatic how to color bars ColorFunctionScaling True whether to normalize arguments to ColorFunction FaceGrids Automatic grid lines to draw on the bounding box LabelingFunction Automatic how to label elements LegendAppearance Automatic overall appearance of legends Lighting "Neutral" simulated light sources to use PerformanceGoal $PerformanceGoal aspects of performance to try to optimize PlotInteractivity $PlotInteractivity whether to allow interactive elements PlotLabels None category labels for bars PlotLayout Automatic overall layout to use PlotLegends None legends for data elements and datasets PlotStyle Automatic style for bars PlotTheme $PlotTheme overall theme for the chart ScalingFunctions None how to scale individual coordinates TargetUnits Automatic units to display in the chart ViewPoint Automatic viewing position - The following settings for PlotLayout can be used to display multiple sets of data:
-

"Grouped" separate the data for each dataset 
"Stepped" accumulate and separate the data for each dataset - Typical settings for PlotLegends include:
-
None no legend Automatic automatically determine legend {lbl1,lbl2,…} use lbl1, lbl2, … as legend labels Placed[lspec,…] specify placement for legend - PlotStylesty specifies the styles to use for each curve. Possible settings include:
-
{sty1,sty2,…} sequence of styles for the data <|"key"val,…|> styling elements for different levels of data - The accepted keys are:
-
"Base" overall style for all the bars "Elements" list of styles for the elements yi in each group "Groups" list of styles of each group of values datai - ColorData["DefaultChartColors"] gives the default sequence of colors used by PlotStyle.
- The arguments supplied to ChartElementFunction are the bar region {{xmin,xmax},{ymin,ymax},{zmin,zmax}}, the data values {xi,yi,zi}, and metadata {m1,m2,…} from each level in a nested list of datasets.
- A list of built-in settings for ChartElementFunction can be obtained from ChartElementData["RectangleChart3D"].
- With the setting ChartElements->g, the graphic g will be used to form pictorial bars consisting of stretched versions of g.
- The arguments supplied to ColorFunction consist of xi, yi, and zi.
- Style and other specifications from options and other constructs in RectangleChart3D are effectively applied in the order PlotStyle, ColorFunction, Style and other wrappers, ChartElements, and ChartElementFunction, with later specifications overriding earlier ones.
-
AlignmentPoint Center the default point in the graphic to align with AspectRatio Automatic ratio of height to width Axes True whether to draw axes AxesEdge Automatic on which edges to put axes AxesLabel None axes labels AxesOrigin Automatic where axes should cross AxesStyle {} graphics directives to specify the style for axes Background None background color for the plot BarOrigin Bottom origin of bars BarSpacing Automatic spacing between bars BaselinePosition Automatic how to align with a surrounding text baseline BaseStyle {} base style specifications for the graphic Boxed False whether to draw a bounding box BoxRatios Automatic bounding 3D box ratios BoxStyle {} style specifications for the box ChartElementFunction Automatic how to generate raw graphics for bars ChartElements Automatic graphics to use for each of the bars ClipPlanes None clipping planes ClipPlanesStyle Automatic style specifications for clipping planes ColorFunction Automatic how to color bars ColorFunctionScaling True whether to normalize arguments to ColorFunction ContentSelectable Automatic whether to allow contents to be selected ControllerLinking False when to link to external rotation controllers ControllerPath Automatic what external controllers to try to use Epilog {} 2D graphics primitives to be rendered after the main plot FaceGrids Automatic grid lines to draw on the bounding box FaceGridsStyle {} style specifications for face grids FormatType TraditionalForm default format type for text ImageMargins 0. the margins to leave around the graphic ImagePadding All what extra padding to allow for labels, etc. ImageSize Automatic absolute size at which to render the graphic LabelingFunction Automatic how to label elements LabelStyle {} style specifications for labels LegendAppearance Automatic overall appearance of legends Lighting "Neutral" simulated light sources to use Method Automatic details of 3D graphics methods to use PerformanceGoal $PerformanceGoal aspects of performance to try to optimize PlotInteractivity $PlotInteractivity whether to allow interactive elements PlotLabel None a label for the plot PlotLabels None category labels for bars PlotLayout Automatic overall layout to use PlotLegends None legends for data elements and datasets PlotRange All range of values to include PlotRangePadding Automatic how much to pad the range of values PlotRegion Automatic final display region to be filled PlotStyle Automatic style for bars PlotTheme $PlotTheme overall theme for the chart PreserveImageOptions Automatic whether to preserve image options when displaying new versions of the same graphic Prolog {} 2D graphics primitives to be rendered before the main plot RotationAction "Fit" how to render after interactive rotation ScalingFunctions None how to scale individual coordinates SphericalRegion Automatic whether to make the circumscribing sphere fit in the final display area TargetUnits Automatic units to display in the chart Ticks Automatic specification for ticks TicksStyle {} style specification for ticks TouchscreenAutoZoom False whether to zoom to fullscreen when activated on a touchscreen ViewAngle Automatic angle of the field of view ViewCenter Automatic point to display at the center ViewMatrix Automatic explicit transformation matrix ViewPoint Automatic viewing position ViewProjection Automatic projection method for rendering objects distant from the viewer ViewRange All range of viewing distances to include ViewVector Automatic position and direction of a simulated camera ViewVertical {0,0,1} direction to make vertical
List of all options
Examples
open all close allBasic Examples (4)
Generate a 3D rectangle chart for width, depth, and height values:
RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}]RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}]data = {{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}};RectangleChart3D[data, PlotLabels -> <|"Elements" -> Placed[{"a", "b", "c"}, Center]|>]RectangleChart3D[data, PlotLegends -> <|"Elements" -> {"a", "b", "c"}|>]RectangleChart3D[Tuples[{1, 3}, 3], PlotStyle -> {RGBColor[0.237736, 0.340215, 0.575113], RGBColor[0.25826842857142857, 0.3783777142857143, 0.4839005714285714], RGBColor[0.2876055714285714, 0.46943485714285715, 0.2876237142857143], RGBColor[0.4759574285714286, 0.589047, 0.2482417142857143], RGBColor[0.759271, 0.7397234285714285, 0.29226885714285716], RGBColor[0.8685795714285713, 0.7007091428571428, 0.32354785714285716], RGBColor[0.7654144285714286, 0.35909685714285716, 0.2620315714285714], RGBColor[0.72987, 0.239399, 0.230961]}]RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, ChartElements -> [image]]RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, ChartElementFunction -> "ProfileCube"]Scope (35)
Data and Layouts (12)
Items in a dataset are grouped together:
RectangleChart3D[{{{1, 1, 1}, {1, 1, 1}, {1, 1, 1}}, {{2, 2, 2}, {2, 2, 2}, {2, 2, 2}}}]Datasets do not need to have the same number of items:
RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}]Nonreal data is taken to be missing:
RectangleChart3D[{{{1, 1, 1}, Missing[], {1, 1, 1}}, {1 + I, {2, 2, 2}, foo, {2, 2, 2}}}]RectangleChart3D[{{Quantity[3, "Seconds"], Quantity[5, "Seconds"], Quantity[2, "Meters"]}, {Quantity[8, "Seconds"], Quantity[2, "Seconds"], Quantity[5, "Meters"]}, {Quantity[2, "Seconds"], Quantity[1, "Seconds"], Quantity[3, "Meters"]}, {Quantity[1, "Seconds"], Quantity[3, "Seconds"], Quantity[3, "Meters"]}, {Quantity[8, "Seconds"], Quantity[2, "Seconds"], Quantity[7, "Meters"]}, {Quantity[7, "Seconds"], Quantity[3, "Seconds"], Quantity[1, "Meters"]}}, AxesLabel -> Automatic, BarSpacing -> None]RectangleChart3D[{{Quantity[3, "Seconds"], Quantity[5, "Seconds"], Quantity[2, "Meters"]}, {Quantity[8, "Seconds"], Quantity[2, "Seconds"], Quantity[5, "Meters"]}, {Quantity[2, "Seconds"], Quantity[1, "Seconds"], Quantity[3, "Meters"]}, {Quantity[1, "Seconds"], Quantity[3, "Seconds"], Quantity[3, "Meters"]}, {Quantity[8, "Seconds"], Quantity[2, "Seconds"], Quantity[7, "Meters"]}, {Quantity[7, "Seconds"], Quantity[3, "Seconds"], Quantity[1, "Meters"]}}, AxesLabel -> Automatic, BarSpacing -> None, TargetUnits -> {"Minutes", "Minutes", "Feet"}]The time stamps in TimeSeries, EventSeries, and TemporalData are ignored:
RectangleChart3D[TimeSeries[{{19, 16, 12}, {9, 8, 6}, {7, 2, 15}, {17, 3, 5}}, {"May 24, 1982"}]]The values in associations are taken as the dimensions of the bars:
RectangleChart3D[<|"a" -> {1, 1, 1}, "b" -> {1, 3, 2}, "c" -> {2, 1, 4}, "d" -> {2, 2, 1}|>]RectangleChart3D[<|"a" -> {1, 1, 1}, "b" -> {1, 3, 2}, "c" -> {2, 1, 4}, "d" -> {2, 2, 1}|>, PlotLegends -> Automatic, PlotStyle -> {RGBColor[0.65, 0., 0.], RGBColor[0.0504678, 0.526626, 0.627561], RGBColor[0.752461, 0.362306, 0.125339], RGBColor[0.435888, 0.259065, 0.71028]}]RectangleChart3D[<|"group a" -> <|"a" -> {1, 3, 2}, "b" -> {2, 1, 4}|>, "group b" -> <|"a" -> {1, 2, 1}, "b" -> {2, 3, 2}|>|>, PlotLegends -> Automatic]The weights in WeightedData are ignored:
RectangleChart3D[WeightedData[{{1, 1, 3}, {2, 1, 2}, {3, 1, 2}, {3, 4, 3}, {5, 2, 5}}, {0.5, 0.2, 0.1, 0.2, 0.3}]]Use different layouts to display multiple datasets:
Table[RectangleChart3D[{{{1, 1, 1}, {1, 1, 1}, {1, 1, 1}}, {{2, 2, 2}, {2, 2, 2}, {2, 2, 2}}}, ChartLayout -> l], {l, {"Grouped", "Stepped"}}]Table[RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, BarOrigin -> o, PlotLabel -> o, ImageSize -> Tiny, Ticks -> None], {o, {Bottom, Left, Top, Right}}]Adjust the spacing between bars and groups of bars:
Table[RectangleChart3D[{{1, 2, 3}, {2, 3, 1}, {2, 2, 2}}, BarSpacing -> s, PlotLabel -> s, PlotStyle -> Opacity[0.8]], {s, {Automatic, {1, 1}, {-0.3, 1}}}]Tabular Data (3)
tabdata = AggregateRows[Tabular[ResourceData["Sample Data: 1993 US Cars"]], {"AvgPrice" -> (Mean[#AvgPrice]&), "TotalCars" -> (Length[#AvgPrice]&), "AvgWeight" -> (Mean[#Weight]&), "AvgFuelTankCap" -> (Mean[#FuelTankCapacity]&)}, {"Type"}]Compare the average weight and price of each group of cars:
RectangleChart3D[tabdata -> {"AvgPrice", "TotalCars", "AvgWeight"}, PlotLabels -> Placed[{"Small", "Midsize", "Compact", "Large", "Sporty", "Van"}, Center]]Plot the values for all the components in TimeSeries or EventSeries:
RectangleChart3D[TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> True, "Count" -> 5,
"Endpoints" -> TabularColumn[Association[
"Data" -> {2, {{NumericArray[{20563, -2147483648}, "Integer32"], {},
DataStructure["BitVec ... larColumn[Association[
"Data" -> {{2, 2, 16, 17, 17}, {}, None}, "ElementType" -> "Integer64"]],
TabularColumn[Association["Data" -> {{5, 5, 4, 4, 2}, {}, None},
"ElementType" -> "Integer64"]]}}]]]], Association[]]]Plot the values for a set of components of a TimeSeries or EventSeries:
ts = TimeSeries[TimeEventSeries`TimestampData[Association["UniformlySpacedQ" -> True, "Count" -> 5,
"Endpoints" -> TabularColumn[Association[
"Data" -> {2, {{NumericArray[{20563, -2147483648}, "Integer32"], {},
DataStructure["BitVec ... TabularColumn[Association["Data" -> {{5, 5, 4, 4, 2}, {}, None},
"ElementType" -> "Integer64"]], TabularColumn[Association[
"Data" -> {{13, 12, 12, 16, 15}, {}, None}, "ElementType" -> "Integer64"]]}}]]]],
Association[]];RectangleChart3D[ts -> {"a", "b", "c"}]Plot values from multiple sets of components:
RectangleChart3D[ts -> {{"a", "b", "c"}, {"a", "b", "d"}}]Wrappers (5)
Use wrappers on individual data, datasets, or collections of datasets:
{{d1, d2, d3}, {e1, e2}} = {{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}};{RectangleChart3D[{{d1, Style[d2, RGBColor[0.93, 0.27, 0.27]], d3}, {e1, e2}}], RectangleChart3D[{Style[{d1, d2, d3}, RGBColor[0.14, 0.8, 0.14]], {e1, e2}}], RectangleChart3D[Style[{{d1, d2, d3}, {e1, e2}}, RGBColor[0.4, 0.6, 1]]]}{{d1, d2, d3}, {e1, e2}} = {{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}};{RectangleChart3D[{{d1, Style[d2, RGBColor[0.93, 0.27, 0.27]], d3}, {e1, e2}}], RectangleChart3D[{Style[{d1, Style[d2, RGBColor[0.93, 0.27, 0.27]], d3}, RGBColor[0.14, 0.8, 0.14]], {e1, e2}}], RectangleChart3D[Style[{{d1, Style[d2, RGBColor[0.93, 0.27, 0.27]], d3}, {e1, e2}}, RGBColor[0.4, 0.6, 1]]]}Override the default tooltips:
RectangleChart3D[{{2, 3, 3}, Tooltip[{1, 2, 2}, "median"], {1, 1, 1}}]Use PopupWindow to provide additional drilldown information:
RectangleChart3D[{{1, 2, 2}, PopupWindow[{2, 3, 3}, DateListPlot[FinancialData["MSFT", "Jan. 1, 2004"]]], {1, 1, 1}}]Button can be used to trigger any action:
RectangleChart3D[{{1, 2, 2}, Button[{2, 3, 3}, Speak[2]], {1, 1, 1}}]Styling and Appearance (7)
Use an explicit list of styles for the bars:
RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, PlotStyle -> {RGBColor[0.93, 0.27, 0.27], RGBColor[0.14, 0.8, 0.14], RGBColor[0.4, 0.6, 1]}]PlotStyle can be used to set an initial style for all chart elements:
RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, PlotStyle -> <|"Base" -> EdgeForm[Dashed], "Elements" -> {RGBColor[0.797253, 0.904982, 0.410498], RGBColor[0.934691, 0.945708, 0.75346], RGBColor[0.769879, 0.92369, 0.977371]}|>]Style can be used to override styles:
RectangleChart3D[{{1, 2, 2}, {1, 1, 1}, Style[{3, 4, 1}, RGBColor[0.93, 0.27, 0.27]], {2, 3, 3}}, PlotStyle -> GrayLevel[0.62]]Use any graphic for pictorial bars:
RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, ChartElements -> Graphics3D[Cylinder[]]]Use built-in programmatically generated bars:
ChartElementData["RectangleChart3D"]Table[RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, ChartElementFunction -> f, PlotStyle -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.9584254999999999, 0.877884, 0.5906629999999999], RGBColor[0.431296, 0.709773, 0.927077]}], {f, {"FadingCube", "GradientScaleCube"}}]For detailed settings use Palettes ▶ ChartElementSchemes:
RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, ChartElementFunction -> ChartElementDataFunction["SegmentScaleCube", "Segments" -> 7, "ColorScheme" -> "SolarColors"]]Use a theme with detailed frame ticks and grid lines:
RectangleChart3D[{{{1, 2, 1}, {3, 1, 2}, {2, 3, 4}}, {{2, 4, 4}, {1, 2, 2}}}, PlotTheme -> "Detailed"]Use a theme with a high-contrast color scheme and profile 3D rectangles:
RectangleChart3D[{{{1, 2, 1}, {3, 1, 2}, {2, 3, 4}}, {{2, 4, 4}, {1, 2, 2}}}, PlotTheme -> "Marketing"]Labeling and Legending (8)
Use Labeled to add a label to a bar:
RectangleChart3D[{{1, 2, 2}, Labeled[{2, 3, 3}, "label"], {1, 1, 1}}]Use symbolic positions for label placement:
Table[RectangleChart3D[{{1, 2, 2}, Labeled[{2, 3, 3}, "label", p], {1, 1, 1}}, PlotLabel -> p, Ticks -> None], {p, {Bottom, Center, Top}}]Table[RectangleChart3D[{{1, 2, 2}, Labeled[{2, 3, 3}, "label", p], {1, 1, 1}}, PlotLabel -> p, Ticks -> None], {p, {Left, Center, Right}}]Specify categorical labels for data elements:
RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, PlotLabels -> <|"Elements" -> {"c1", "c2", "c3"}|>]RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, PlotLabels -> <|"Groups" -> {"r1", "r2"}|>]RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, PlotLabels -> <|"Elements" -> {"c1", "c2", "c3"}, "Groups" -> {"r1", "r2"}|>]Use Placed to control the positioning of labels, using the same positions as for Labeled:
RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, PlotLabels -> <|"Elements" -> Placed[{"c1", "c2", "c3"}, Center], "Groups" -> Placed[{"r1", "r2"}, Above]|>]Provide value labels for bars by using LabelingFunction:
RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, LabelingFunction -> Above]Use Placed to control placement and formatting:
labeler[v_, {i_, j_}, {ri_, cj_}] := Placed[Row[{v, ri[[1]], cj[[1]]}, ","], Tooltip, Rotate[#, Pi / 3]&]RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, PlotLabels -> <|"Elements" -> {"c1", "c2", "c3"}, "Groups" -> {"r1", "r2"}|>, PlotRange -> All, LabelingFunction -> labeler]Add categorical legend entries for the columns of data:
RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, PlotLegends -> <|"Elements" -> {"aaa", "bbb", "ccc"}|>, PlotStyle -> <|"Elements" -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.9584254999999999, 0.877884, 0.5906629999999999], RGBColor[0.431296, 0.709773, 0.927077]}|>]RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, PlotLegends -> {"rr1", "rr2"}, PlotStyle -> <|"Groups" -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.431296, 0.709773, 0.927077]}|>]Use Legended to add additional legend entries:
RectangleChart3D[{{{2, 3, 3}, Legended[Style[{1, 2, 2}, RGBColor[0.93, 0.27, 0.27]], "extra"], {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, PlotStyle -> <|"Elements" -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.9584254999999999, 0.877884, 0.5906629999999999], RGBColor[0.431296, 0.709773, 0.927077]}|>, PlotLegends -> <|"Elements" -> {"aaa", "bbb", "ccc"}|>]Use Placed to affect the positioning of legends:
Table[RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, PlotLegends -> <|"Elements" -> Placed[{"ccc1", "ccc2", "ccc3"}, p]|>, PlotStyle -> <|"Elements" -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.9584254999999999, 0.877884, 0.5906629999999999], RGBColor[0.431296, 0.709773, 0.927077]}|>], {p, {Bottom, Top}}]Options (94)
Axes (3)
By default, Axes are drawn:
RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}]Use AxesFalse to turn off axes:
RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, Axes -> False]Turn each axis on individually:
{RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, Axes -> {False, True, False}], RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, Axes -> {False, False, True}]}AxesLabel (3)
No axes labels are drawn by default:
RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}]RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, AxesLabel -> n]RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, AxesLabel -> {x, y, z}]AxesOrigin (2)
The position of the axes is determined automatically:
RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}]Specify an explicit origin for the axes:
RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, AxesOrigin -> {1, 1, 1}]AxesStyle (3)
Change the style for the axes:
RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, AxesStyle -> RGBColor[0.93, 0.27, 0.27]]Specify the style of each axis:
RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, AxesStyle -> {{Thick, RGBColor[0.93, 0.27, 0.27]}, {Thick, RGBColor[0.4, 0.6, 1]}, {Thick, RGBColor[0.14, 0.8, 0.14]}}]Use different styles for the ticks and the axes:
RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, AxesStyle -> RGBColor[0.14, 0.8, 0.14], TicksStyle -> RGBColor[0.14, 0.8, 0.14]]BarOrigin (1)
BarSpacing (6)
Use automatically determined spacing between bars:
RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, BarSpacing -> Automatic]RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, BarSpacing -> None]Table[RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, BarSpacing -> s, PlotLabel -> s], {s, {Tiny, Small, Medium, Large}}]Use explicit spacing between bars:
Table[RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, BarSpacing -> s, PlotStyle -> Opacity[0.8], PlotLabel -> s], {s, {Automatic, 1, -0.3}}]Use explicit spacing between bars and groups of bars:
Table[RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, BarSpacing -> s, PlotLabel -> s], {s, {Automatic, {0, 1}, {0, 0.2}}}]With no spacing used between bars, a quantitative
axis is used:
RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, BarSpacing -> {0, 0}]ChartElementFunction (6)
Get a list of built-in settings for ChartElementFunction:
ChartElementData["RectangleChart3D"]For detailed settings, use Palettes ▶ ChartElementSchemes:
RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, ChartElementFunction -> "Cube", PlotStyle -> {RGBColor[0.237736, 0.340215, 0.575113], RGBColor[0.624866, 0.673302, 0.264296], RGBColor[0.72987, 0.239399, 0.230961]}]Table[RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, ChartElementFunction -> f, PlotStyle -> EdgeForm[], ColorFunction -> "SandyTerrain", PlotLabel -> f, ViewPoint -> {2.8, -7.5, 6.7}], {f, {"Cone", "FadingCube", "Cylinder", "ProfileCube"}}]ChartElementFunction is appropriate to show the global scale:
Table[RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, ChartElementFunction -> f, PlotLabel -> f], {f, {"GradientScaleCube", "SegmentScaleCube"}}]Write a custom ChartElementFunction:
f[{{xmin_, xmax_}, {ymin_, ymax_}, {zmin_, zmax_}}, ___] := Cuboid[{xmin, ymin, zmin}, {xmax, ymax, zmax}]RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, ChartElementFunction -> f, PlotStyle -> Lighter[GrayLevel[0.62], .5]]Write a custom ChartElementFunction using ChartElementDataFunction:
f[b : {{xmin_, xmax_}, {ymin_, ymax_}, {zmin_, zmax_}}, ___] := ChartElementDataFunction["SegmentScaleCube", "Segments" -> 10, "ColorScheme" -> 57][b]RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, ChartElementFunction -> f, PlotStyle -> GrayLevel[0.62]]Chart with optional labeled drop planes:
PlaneBar[box : {{xmin_, xmax_}, {ymin_, ymax_}, {zmin_, zmax_}}, y_, {True}] := {PlaneBar[box], EdgeForm[], Opacity[0.5], Polygon[{{-0.1, ymin, zmax}, {xmax, ymin, zmax}, {xmax, ymax, zmax}, {-0.1, ymax, zmax}}]}PlaneBar[{{xmin_, xmax_}, {ymin_, ymax_}, {zmin_, zmax_}}, ___] := {EdgeForm[], Opacity[0.7], Cuboid[{xmin, ymin, zmin}, {xmax, ymax, zmax}]}Setting the metadata to True turns on the drop plane:
RectangleChart3D[{{3, 4, 4}, {3, 6, 3} -> True, {4, 3, 5} -> True}, ChartElementFunction -> PlaneBar, PlotStyle -> {RGBColor[0.237736, 0.340215, 0.575113], RGBColor[0.624866, 0.673302, 0.264296], RGBColor[0.72987, 0.239399, 0.230961]}, ViewPoint -> {-5.17, -8.34, 3.42}, FaceGrids -> None, Axes -> None, PlotLegends -> {"Tim", "John", "Mary"}]ChartElements (7)
Create a pictorial chart based on any Graphics3D object:
RectangleChart3D[{{{1, 3, 2}, {2, 1, 1}}, {{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}}, ChartElements -> Graphics3D[Cylinder[]]]Use a different graphic for each column of data:
RectangleChart3D[{{{1, 3, 2}, {2, 1, 1}}, {{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}}, ChartElements -> {[image], [image], [image]}]Use a different graphic for each row of data:
RectangleChart3D[{{{1, 3, 2}, {2, 1, 1}}, {{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}}, ChartElements -> {{[image], [image]}, None}]RectangleChart3D[Tuples[{1, 2}, 3], ChartElements -> {[image], [image]}]Styles are inherited from styles set through PlotStyle etc.:
RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, ChartElements -> [image], PlotStyle -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.9584254999999999, 0.877884, 0.5906629999999999], RGBColor[0.431296, 0.709773, 0.927077]}]Override individual styles by using Style:
RectangleChart3D[{{3, 4, 4}, Style[{3, 6, 3}, RGBColor[0.93, 0.27, 0.27]], {4, 3, 5}}, ChartElements -> [image], PlotStyle -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.9584254999999999, 0.877884, 0.5906629999999999], RGBColor[0.431296, 0.709773, 0.927077]}]Explicit styles set in the graphic will override other style settings:
RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, ChartElements -> [image], PlotStyle -> GrayLevel[0]]PlotLayout (2)
PlotLayout is "Grouped" by default:
RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, PlotLayout -> "Grouped"]RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, PlotLayout -> "Stepped"]ColorFunction (3)
Color by bar width, depth and height:
RectangleChart3D[Table[{Exp[-t ^ 2], Exp[-t ^ 2], Exp[-t ^ 2]}, {t, -2, 2, 0.25}], ColorFunction -> Function[{x, y, z}, Hue[x, y, 1, z]]]Use "Gradient" colors from ColorData:
RectangleChart3D[Table[{Exp[-t ^ 2], Exp[-t ^ 2], Exp[-t ^ 2]}, {t, -2, 2, 0.25}], ColorFunction -> "SolarColors"]Use ColorFunctionScaling->False to get unscaled width, depth and height values:
RectangleChart3D[{{1, 1, 1}, {2, 2, 2}, {1, 2, 1}}, ColorFunction -> (Switch[{#1, #2, #3}, {1, 1, 1}, RGBColor[1, 0.75, 0], {2, 2, 2}, RGBColor[0.98, 0.56, 0.17], {1, 2, 1}, RGBColor[0.93, 0.27, 0.27], _, RGBColor[0.4, 0.6, 1]]&), ColorFunctionScaling -> False]RectangleChart3D[{{1, 1, 1}, {1, 1, 2}, {1, 2, 1}, {1, 2, 2}, {2, 1, 1}, {2, 1, 2}, {2, 2, 1}, {2, 2, 2}}, ColorFunction -> Function[{x, y, z}, ColorData["Rainbow"][x y z / 8]], ColorFunctionScaling -> False]ColorFunction overrides settings for PlotStyle:
RectangleChart3D[Tuples[{1, 2}, 3], PlotStyle -> {RGBColor[0.93, 0.27, 0.27], RGBColor[0.14, 0.8, 0.14], RGBColor[0.4, 0.6, 1]}, ColorFunction -> (GrayLevel[Mean[{##}]]&)]ColorFunctionScaling (2)
By default, scaled height values are used:
BarChart3D[{{1, 2, 2}, {1, 1, 1}, {2, 3, 3}}, ColorFunction -> (Lighter[Brown, 0.9#]&)]Use ColorFunctionScaling->False to get unscaled height values:
RectangleChart3D[{{1, 1, 1}, {2, 2, 2}, {1, 2, 1}}, ColorFunction -> (Switch[{#1, #2, #3}, {1, 1, 1}, RGBColor[1, 0.75, 0], {2, 2, 2}, RGBColor[0.98, 0.56, 0.17], {1, 2, 1}, RGBColor[0.93, 0.27, 0.27], _, RGBColor[0.4, 0.6, 1]]&), ColorFunctionScaling -> False]ImageSize (7)
Use named sizes, such as Tiny, Small, Medium and Large:
{RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, ImageSize -> Tiny], RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, ImageSize -> Small]}Specify the width of the plot:
{RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, ImageSize -> 150], RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, AspectRatio -> 1.5, ImageSize -> 150]}Specify the height of the plot:
{RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, ImageSize -> {Automatic, 150}], RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, AspectRatio -> 2, ImageSize -> {Automatic, 150}]}Allow the width and height to be up to a certain size:
{RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, ImageSize -> UpTo[200]], RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, AspectRatio -> 2, ImageSize -> UpTo[200]]}Specify the width and height for a graphic, padding with space if necessary:
RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, ImageSize -> {200, 250}, Background -> GrayLevel[0.62]]Setting AspectRatioFull will fill the available space:
RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, AspectRatio -> Full, ImageSize -> {200, 250}, Background -> GrayLevel[0.62]]Use maximum sizes for the width and height:
{RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, ImageSize -> {UpTo[150], UpTo[100]}], RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, AspectRatio -> 2, ImageSize -> {UpTo[150], UpTo[100]}]}Use ImageSizeFull to fill the available space in an object:
Framed[Pane[RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, ImageSize -> Full, Background -> GrayLevel[0.62]], {200, 100}]]Specify the image size as a fraction of the available space:
Framed[Pane[RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, AspectRatio -> Full, ImageSize -> {Scaled[0.5], Scaled[0.5]}, Background -> GrayLevel[0.62]], {200, 200}]]LabelingFunction (7)
Use automatic labeling by values through Tooltip and StatusArea:
RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, LabelingFunction -> Automatic]RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, LabelingFunction -> None]Use Placed to control label placement:
Table[RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, LabelingFunction -> p, PlotLabel -> p, Ticks -> None], {p, {Bottom, Center, Top}}]Symbolic positions outside the bar:
Table[RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, LabelingFunction -> p, PlotLabel -> p, Ticks -> None], {p, {Below, Above}}]Coordinate-based placement relative to a bar:
Table[RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, LabelingFunction -> p, BarSpacing -> 0.5, Ticks -> None, PlotLabel -> p], {p, {{0, 0, 0}, {1 / 2, 1 / 2, 1 / 2}}}]Control the formatting of labels:
RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, LabelingFunction -> (Function[{v}, Placed[Style[Grid[{{"w", v[[1]]}, {"d", v[[2]]}, {"h", v[[3]]}}]], Center]])]Use the given chart labels as arguments to the labeling function:
labeler = Placed[Row[{#3[[1, 1]], #3[[2, 1]], #1}, ","], Tooltip]&;RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, PlotLabels -> <|"Groups" -> Placed[{"r1", "r2"}, Bottom], "Elements" -> Placed[{"c1", "c2", "c3"}, Center]|>, LabelingFunction -> labeler]PerformanceGoal (3)
Generate a bar chart with interactive highlighting:
RectangleChart3D[Tuples[{1, 2, 3}, 3], PerformanceGoal -> "Quality"]Emphasize performance by disabling interactive behaviors:
RectangleChart3D[Tuples[{1, 2, 3}, 3], PerformanceGoal -> "Speed"]Typically less memory is required for noninteractive charts:
Table[ByteCount@RectangleChart3D[Tuples[{1, 2, 3}, 3], PerformanceGoal -> p], {p, {"Quality", "Speed"}}]PlotInteractivity (4)
Charts with a moderate number of bars automatically have tooltips and mouseover effects:
RectangleChart3D[{{1, 1, 2}, {2, 2, 1}, {2, 1, 2}}]Turn off all the interactive elements:
RectangleChart3D[{{1, 1, 2}, {2, 2, 1}, {2, 1, 2}}, PlotInteractivity -> False]Interactive elements provided as part of the input are disabled:
RectangleChart3D[{{1, 1, 2}, {2, 2, 1}, Tooltip[{2, 1, 2}, "Hello"]}, PlotInteractivity -> False]Allow provided interactive elements and disable automatic ones:
RectangleChart3D[{{1, 1, 2}, {2, 2, 1}, Tooltip[{2, 1, 2}, "Hello"]}, PlotInteractivity -> <|"User" -> True, "System" -> False|>]PlotLabels (8)
By default, labels are placed in the axis:
RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, PlotLabels -> {"a", "b", "c"}]data = {{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}};RectangleChart3D[data, PlotLabels -> {"a", "b"}]By default, labels are associated with data elements or groups automatically:
data = {{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}};{RectangleChart3D[data[[1]], PlotLabels -> {"c1", "c2", "c3"}],
RectangleChart3D[data, PlotLabels -> {"r1", "r2"}]}Specify labels to data elements specifically:
RectangleChart3D[data, PlotLabels -> <|"Elements" -> {"c1", "c2", "c3"}|>]Label both groups and elements:
RectangleChart3D[data, PlotLabels -> <|"Groups" -> {"r1", "r2"}, "Elements" -> {"c1", "c2", "c3"}|>]Labeled wrappers in data will place additional labels:
RectangleChart3D[{{3, 4, 4}, Labeled[{3, 6, 3}, "label", Center], {4, 3, 5}}, PlotLabels -> {"a", "b", "c"}]Use Placed to control label placement:
Table[RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, PlotLabels -> Placed[{"a", "b", "c"}, p], PlotLabel -> p, Ticks -> None], {p, {Bottom, Center, Top}}]Symbolic positions outside the bar:
Table[RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, PlotLabels -> Placed[{"a", "b", "c"}, p], PlotLabel -> p, Ticks -> None], {p, {Below, Above}}]Table[RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, PlotLabels -> Placed[{"a", "b", "c"}, p], BarOrigin -> Left, PlotLabel -> p, Ticks -> None], {p, {Before, After}}]Coordinate-based placement relative to a bar:
Table[RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, PlotLabels -> Placed[{"aa", "bb", "cc"}, p], BarSpacing -> 0.5, Ticks -> None, PlotLabel -> p], {p, {{0, 0, 0}, {1 / 2, 1 / 2, 1 / 2}, {1, 1, 1}}}]Place all labels at the upper-right corner and vary the coordinates within the label:
Table[RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, PlotLabels -> Placed[Framed /@ {"aa", "bb", "cc"}, {{1, 1, 1}, p}], BarSpacing -> 0.8, Ticks -> None, PlotLabel -> p], {p, {{0, 0}, {1 / 2, 1 / 2}, {1, 1}}}]Use the third argument to Placed to control formatting:
RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, PlotLabels -> Placed[{"aaa", "bbb", "ccc"}, Center, Rotate[#, 45Degree]&]]RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, PlotLabels -> Placed[{"aaa", "bbb", "ccc"}, Center, Panel[#, FrameMargins -> 0]&]]RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, PlotLabels -> Placed[{"aaa", "bbb", "ccc"}, Center, Hyperlink[#, "http://www.wolfram.com"]&]]RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, PlotLabels -> Placed[{"aaa", "bbb", "ccc"}, Axis, Rotate[#, Pi / 4]&]]Change both the placements of group and element labels:
RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, PlotLabels -> <|"Groups" -> Placed[{"r1", "r2"}, Above], "Elements" -> Placed[{"c1", "c2", "c3"}, Center]|>]Place multiple labels using Placed:
RectangleChart3D[{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, PlotLabels -> Placed[{{"a", "b", "c"}, {"x", "y", "z"}}, {Top, Bottom}]]PlotLegends (7)
data = {{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}};Add categorical legend entries for data elements:
RectangleChart3D[data, PlotLegends -> <|"Elements" -> {"ccc1", "ccc2", "ccc3"}|>, PlotStyle -> <|"Elements" -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.9584254999999999, 0.877884, 0.5906629999999999], RGBColor[0.431296, 0.709773, 0.927077]}|>]RectangleChart3D[data, PlotLegends -> <|"Groups" -> {"rr1", "rr2"}|>, PlotStyle -> <|"Groups" -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.431296, 0.709773, 0.927077]}|>]Use Legended to add additional legend entries:
data = {{{3, 4, 4}, Legended[Style[{3, 6, 3}, RGBColor[0.93, 0.27, 0.27]], "aa"], {4, 3, 5}}, {{1, 3, 2}, {2, 1, 1}}};RectangleChart3D[data, PlotStyle -> <|"Elements" -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.9584254999999999, 0.877884, 0.5906629999999999], RGBColor[0.431296, 0.709773, 0.927077]}|>, PlotLegends -> <|"Elements" -> {"ccc1", "ccc2", "ccc3"}|>]Use Legended to specify a few legend entries:
data = {{3, 4, 4}, Legended[{3, 6, 3}, "aa"], {4, 3, 5}, Legended[{1, 3, 2}, "bb"], {2, 1, 1}};RectangleChart3D[data, PlotStyle -> <|"Elements" -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.898695, 0.686452, 0.6785475], RGBColor[0.9584254999999999, 0.877884, 0.5906629999999999], RGBColor[0.86116075, 0.930182, 0.758764], RGBColor[0.431296, 0.709773, 0.927077]}|>]Generate a legend for data groups:
data = {{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}};RectangleChart3D[data, PlotLegends -> <|"Groups" -> {"Group A", "Group B"}|>, PlotStyle -> <|"Groups" -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.431296, 0.709773, 0.927077]}|>]Unused legend labels are dropped:
data = {{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}};RectangleChart3D[data, PlotLegends -> <|"Groups" -> {"Group A", "Group B", "Group C"}|>, PlotStyle -> <|"Groups" -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.431296, 0.709773, 0.927077]}|>]Use legends for both group and element styles:
data = {{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}};RectangleChart3D[data, PlotLegends -> <|"Groups" -> {"Test A", "Test B"}, "Elements" -> {"John", "Mary", "Bob"}|>, PlotStyle -> <|"Elements" -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.9584254999999999, 0.877884, 0.5906629999999999], RGBColor[0.431296, 0.709773, 0.927077]}, "Groups" -> {EdgeForm[{RGBColor[0.93, 0.27, 0.27], Opacity[1]}], EdgeForm[{RGBColor[0.4, 0.6, 1], Opacity[1]}]}|>]Use Placed to control the placement of legends:
data = {{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}};Table[RectangleChart3D[data, PlotLegends -> <|"Elements" -> Placed[{"John", "Mary", "Bob"}, pos]|>, PlotStyle -> <|"Elements" -> {RGBColor[0.761959, 0.470832, 0.940597], RGBColor[0.9584254999999999, 0.877884, 0.5906629999999999], RGBColor[0.431296, 0.709773, 0.927077]}|>], {pos, {Below, Above, Before, After}}]PlotStyle (10)
RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, PlotStyle -> {RGBColor[0.93, 0.27, 0.27], RGBColor[0.14, 0.8, 0.14], RGBColor[0.4, 0.6, 1]}]RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, BarSpacing -> -0.3, PlotStyle -> Directive[Opacity[0.7], EdgeForm[Dashed], RGBColor[0.3655821205642109, 0.582006632236133, 0.0357851567943297]]]RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, PlotStyle -> {RGBColor[0.93, 0.27, 0.27], RGBColor[0.4, 0.6, 1]}]RectangleChart3D[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}, PlotStyle -> <|"Elements" -> {RGBColor[0.93, 0.27, 0.27], RGBColor[0.14, 0.8, 0.14]}|>]RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, PlotStyle -> <|"Elements" -> {RGBColor[0.93, 0.27, 0.27], RGBColor[0.14, 0.8, 0.14], RGBColor[0.4, 0.6, 1]}|>]RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, PlotStyle -> <|"Groups" -> {RGBColor[0.93, 0.27, 0.27], RGBColor[0.14, 0.8, 0.14]}|>]RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, PlotStyle -> <|"Base" -> {EdgeForm[Directive[{Dashed, Opacity[1]}]], Opacity[0.7]}|>]Style both elements and groups of data:
RectangleChart3D[{{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, {{1, 3, 2}, {2, 1, 1}}}, PlotStyle -> <|"Groups" -> {EdgeForm[Directive[{Dotted, Opacity[1]}]], EdgeForm[Directive[{Dashed, Opacity[1]}]]}, "Elements" -> {RGBColor[0.93, 0.27, 0.27], RGBColor[0.14, 0.8, 0.14], RGBColor[0.4, 0.6, 1]}|>]With both element and group styles specified, the element styles may override the group styles:
RectangleChart3D[{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, PlotStyle -> <|"Elements" -> {RGBColor[0.93, 0.27, 0.27], RGBColor[0.14, 0.8, 0.14], RGBColor[0.4, 0.6, 1]}, "Groups" -> {RGBColor[1, 0.75, 0], RGBColor[0.95, 0.43, 0.96]}|>]PlotStyle combines with Style:
RectangleChart3D[{{2, 3, 3}, Style[{1, 2, 2}, Opacity[0.2]], {1, 1, 1}}, PlotStyle -> {RGBColor[0.93, 0.27, 0.27], RGBColor[0.14, 0.8, 0.14], RGBColor[0.4, 0.6, 1]}]RectangleChart3D[{{2, 3, 3}, Style[{1, 2, 2}, EdgeForm[Directive[Dashed, Opacity[1]]]], {1, 1, 1}}, PlotStyle -> {RGBColor[0.93, 0.27, 0.27], RGBColor[0.14, 0.8, 0.14], RGBColor[0.4, 0.6, 1]}]Style may override settings for PlotStyle:
RectangleChart3D[{{2, 3, 3}, Style[{1, 2, 2}, RGBColor[1, 0.75, 0]], {1, 1, 1}}, PlotStyle -> {RGBColor[0.93, 0.27, 0.27], RGBColor[0.14, 0.8, 0.14], RGBColor[0.4, 0.6, 1]}]Styles from ColorFunction and PlotStyle may be combined:
RectangleChart3D[{{3, 3, 3}, {2, 2, 2}, {1, 1, 1}}, PlotStyle -> Opacity /@ Range[0.3, 0.9, 0.3], ColorFunction -> (Blend[{RGBColor[0.4, 0.6, 1], RGBColor[0.93, 0.27, 0.27]}, #]&)]ColorFunction may override settings for PlotStyle:
RectangleChart3D[{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, PlotStyle -> {RGBColor[0.93, 0.27, 0.27], RGBColor[0.14, 0.8, 0.14], RGBColor[0.4, 0.6, 1]}, ColorFunction -> Function[{x, y, z}, ColorData["SolarColors"][z]]]ChartElements may override settings for PlotStyle:
RectangleChart3D[{{2, 3, 3}, {1, 2, 2}, {1, 1, 1}}, ChartElements -> Graphics3D[Cylinder[]], PlotStyle -> {RGBColor[0.93, 0.27, 0.27], RGBColor[0.14, 0.8, 0.14], RGBColor[0.4, 0.6, 1]}]PlotTheme (1)
Ticks (6)
Ticks are placed automatically in each chart:
RectangleChart3D[{{1, 1, 1}, {1, 2, 1}, {2, 3, 2}, {3, 1, 1}, {1, 4, 2}, {2, 4, 3}}]Use TicksNone to not draw any tick marks:
RectangleChart3D[{{1, 1, 1}, {1, 2, 1}, {2, 3, 2}, {3, 1, 1}, {1, 4, 2}, {2, 4, 3}}, Ticks -> None]Place tick marks at specific positions:
RectangleChart3D[{{1, 1, 1}, {1, 2, 1}, {2, 3, 2}, {3, 1, 1}, {1, 4, 2}, {2, 4, 3}}, Ticks -> {None, {0, 2, 4}, {1, 2, 3}}]Draw tick marks at the specified positions with the specified labels:
RectangleChart3D[{{1, 1, 1}, {1, 2, 1}, {2, 3, 2}, {3, 1, 1}, {1, 4, 2}, {2, 4, 3}}, Ticks -> {{{.5, Set1}, {3, Set3}, {6, Set4}, {9.5, Set6}}, {{0, a}, {2, b}, {4, c}}, {{1, d}, {2, b}, {3, e}}}]Specify tick marks with scaled lengths:
RectangleChart3D[{{1, 1, 1}, {1, 2, 1}, {2, 3, 2}, {3, 1, 1}, {1, 4, 2}, {2, 4, 3}}, Ticks -> {{{.5, Set1, .4}, {3, Set3, .25}, {6, Set4, .4}, {9.5, Set6, .15}}, {{0, a, .05}, {2, b, .05}, {4, c, .05}}, {{1, d, .05}, {2, b, .05}, {3, e, .12}}}]Customize each tick with position, length, labeling and styling:
RectangleChart3D[{{1, 1, 1}, {1, 2, 1}, {2, 3, 2}, {3, 1, 1}, {1, 4, 2}, {2, 4, 3}}, Ticks -> {{{.5, Set1, .4, Directive[Thick, RGBColor[0.93, 0.27, 0.27]]}, {3, Set3, .25, Directive[Thick, RGBColor[0.93, 0.27, 0.27]]}, {6, Set4, .4, Directive[Thick, RGBColor[0.93, 0.27, 0.27]]}, {9.5, Set6, .15, Directive[Thick, RGBColor[0.93, 0.27, 0.27]]}}, {{0, a, .05, Directive[RGBColor[0.4, 0.6, 1]]}, {2, b, .05, Directive[RGBColor[0.4, 0.6, 1]]}, {4, c, .05, Directive[RGBColor[0.4, 0.6, 1]]}}, {{1, d, .05, Directive[RGBColor[0.93, 0.27, 0.27]]}, {2, b, .05, Directive[RGBColor[0.93, 0.27, 0.27]]}, {3, e, .12, Directive[RGBColor[0.14, 0.8, 0.14]]}}}]TicksStyle (3)
By default, the ticks and tick labels use the same styles as the axis:
RectangleChart3D[{{1, 1, 1}, {1, 2, 1}, {2, 3, 2}, {3, 1, 1}, {1, 4, 2}, {2, 4, 3}}, AxesStyle -> Directive[RGBColor[0.93, 0.27, 0.27], Bold]]Specify overall tick style, including the tick labels:
RectangleChart3D[{{1, 1, 1}, {1, 2, 1}, {2, 3, 2}, {3, 1, 1}, {1, 4, 2}, {2, 4, 3}}, TicksStyle -> Directive[RGBColor[0.93, 0.27, 0.27], Bold]]Specify tick style for each of the axes:
RectangleChart3D[{{1, 1, 1}, {1, 2, 1}, {2, 3, 2}, {3, 1, 1}, {1, 4, 2}, {2, 4, 3}}, TicksStyle -> {None, Directive[Thick, RGBColor[0.4, 0.6, 1]], Directive[RGBColor[0.93, 0.27, 0.27], Bold]}]Applications (3)
Compare the dollar value produced by each widget maker:
data = | | | | |
| ------- | -- | -- | --- |
| "Frank" | 3 | 23 | 193 |
| "Susan" | 17 | 14 | 78 |
| "Peter" | 7 | 5 | 170 |
| "Anne" | 10 | 7 | 110 |
| "John" | 5 | 17 | 53 |;Mouse over the bars for the employee names:
RectangleChart3D[data[[All, 2 ;; 4]], BarSpacing -> {0, 0}, PlotLabels -> Placed[data[[All, 1]], Tooltip], AxesLabel -> {"widgets / hour", "hours worked", "dollar value per widget"}]Click the bars to hear the country name, GDP per capita, poverty fraction, and population:
countries = {"Kenya", "Peru", "Senegal", "SriLanka", "Zimbabwe"};
properties = {"GDPPerCapita", "PovertyFraction", "Population"};data = Table[With[{v = cp}, Button[v[[2 ;; 4]], Speak[StringJoin[ToString /@ {v[[1]], ", GDP per capita: $", Round[v[[2]]], ", Poverty Fraction: ", v[[3]], ", Population: ", Round[v[[4]]10 ^ 6]}]]]], {cp, Table[Prepend[Table[CountryData[c, p], {p, properties}] * {1, 1, 10 ^ (-6)}, c], {c, countries}]}];RectangleChart3D[data, PlotStyle -> {RGBColor[0.471412, 0.108766, 0.527016], RGBColor[0.266122, 0.486664, 0.802529], RGBColor[0.513417, 0.72992, 0.440682], RGBColor[0.863512, 0.670771, 0.236564], RGBColor[0.857359, 0.131106, 0.132128]}, BarSpacing -> 1, PlotLabels -> Placed[countries, Tooltip]]Get the data for G15 countries:
countries = CountryData["G15"];
properties = {"FemaleAdultPopulation", "TotalFertilityRate", "FemaleLifeExpectancy"};
data = {#1 10 ^ -6, #2 , #3}&@@@Table[CountryData[c, p], {c, countries}, {p, properties}];Mouse over the bars to get the name of the country:
RectangleChart3D[data, PlotLabels -> Placed[countries, Tooltip], BarSpacing -> {0, 0}, ViewPoint -> {3, -9, 4}, AxesLabel -> properties, ColorFunction -> Function[{x, y, z}, ColorData[24][x]], ColorFunctionScaling -> False]Properties & Relations (2)
Use RectangleChart3D to get a 3D rendering of a RectangleChart:
{RectangleChart[{{1, 1}, {1, 2}, {2, 3}}], RectangleChart3D[{{1, 1, 1}, {1, 1, 2}, {2, 1, 3}}]}Use SectorChart3D and BubbleChart as alternative visualizations:
Table[f[{{3, 4, 4}, {3, 6, 3}, {4, 3, 5}}], {f, {RectangleChart3D, SectorChart3D, BubbleChart}}]Related Guides
History
Introduced in 2008 (7.0) | Updated in 2010 (8.0) ▪ 2012 (9.0) ▪ 2014 (10.0) ▪ 2025 (14.2) ▪ 2025 (14.3) ▪ 2026 (15.0)
Text
Wolfram Research (2008), RectangleChart3D, Wolfram Language function, https://reference.wolfram.com/language/ref/RectangleChart3D.html (updated 2026).
CMS
Wolfram Language. 2008. "RectangleChart3D." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2026. https://reference.wolfram.com/language/ref/RectangleChart3D.html.
APA
Wolfram Language. (2008). RectangleChart3D. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RectangleChart3D.html
BibTeX
@misc{reference.wolfram_2026_rectanglechart3d, author="Wolfram Research", title="{RectangleChart3D}", year="2026", howpublished="\url{https://reference.wolfram.com/language/ref/RectangleChart3D.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_rectanglechart3d, organization={Wolfram Research}, title={RectangleChart3D}, year={2026}, url={https://reference.wolfram.com/language/ref/RectangleChart3D.html}, note=[Accessed: 13-June-2026]}