I am looking for an optimal code to build a 3D histogram of USA population with bars bounded by state borders. Here is my initial version. Can anyone suggest improvements?
(* get the states *)
divisions =
EntityValue[Entity["AdministrativeDivision", {_, "UnitedStates"}],
"Entities"];
(* get polygons of borders *)
dat = EntityValue[
divisions, {"Population", "Polygon"}] /. {GeoPosition -> Identity,
Quantity[x_, _] -> x};
(* some arbitrary rescaling to improve relative height perception *)
pop = Rescale[(# - Min[#]) &@Log[dat[[All, 1]]] // N];
(* plot constants of population of regions of polygons *)
polygs = Plot3D[#1, {x, y} \[Element] #2, Mesh -> None, Filling -> 0,
ColorFunction -> "Rainbow", ColorFunctionScaling -> False] & @@@
Transpose[{pop, dat[[All, 2]]}];
(* combine all *)
Show[polygs, PlotRange -> {{23, 50}, {-60, -130}, All},
BoxRatios -> {27, 70, 50}, ImageSize -> 800, Boxed -> False,
Axes -> False]