Mathematica可以连接数据库。
举个例子直接抄AdministrativeDivisionData的帮助,画一个中国人口分布。- pro = CountryData["China", "Regions"];divisions = (Entity["AdministrativeDivision", {#, "China"}] & /@ pro);GeoGraphics[{EdgeForm[Red], Opacity[0.1], Polygon[divisions]}]dat = EntityValue[ Reverse@divisions, {"Name", "Population", "Polygon"}];rng = Through[{Min, Max}@QuantityMagnitude[dat[[All, 2]]]];Labeled[GeoGraphics[{GeoStyling[None], EdgeForm@GrayLevel[0, 0.5], Tooltip[{ColorData["LightTemperatureMap"]@ Rescale[QuantityMagnitude[#2], rng], #3}, Column[{Style[#1, Bold], #2}]] & @@@ dat}], BarLegend[{"LightTemperatureMap", rng}, 8], Right]
复制代码
或者亚洲的能读能写人口百分比:
GeoRegionValuePlot[EntityClass["Country", "Asia"] -> "LiteracyRate"]
|