gvisGeoMap() - 如何放大安大略省

发布于 2024-12-21 18:04:10 字数 129 浏览 6 评论 0原文

有谁知道如何使用 googleVis 包中的 gvisGeoMap() 查看加拿大(安大略省)的特定省份?我尝试将“区域”选项设置为“CA-ON”,这是该省的 ISO 3166-2 代码,但它不起作用。缩放选项也不太适用。寻找一些建议。谢谢!!

Does any know how to look at a specific province in Canada (Ontario) using gvisGeoMap() from googleVis package? I've tried to set the 'region' option to "CA-ON" which is the ISO 3166-2 code for the province but it doesn't work. The zoom option doesn't quite apply either. Looking for some suggestion. Thanks!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

春风十里 2024-12-28 18:04:11

我不认为你可以用地理地图来绘制加拿大各省的数据。
在我看来,谷歌对地理图表的推动和开发比地理地图更多。
地理图表使用 SVG / VML 来渲染图表,而不是 Flash。

12 月 6 日,Google 发布了新版本的可视化 API。
地理图表也得到了改进,请参阅:
http://code.google.com/apis/chart/interactive /docs/gallery/geochart.html

googleVis 软件包的新版本 (0.2.13) 考虑了这些更新。
特别是,您可以设置地理图表的分辨率,例如“省份”:
我相信您今天可以为加拿大各省取得的最好成绩如下,

library(googleVis)
plot(gvisGeoChart(CityPopularity, locationvar="City", colorvar="Popularity",
     options=list(displayMode="markers", region="CA", resolution="provinces")))

# There seem to be more granular maps available for the US:

plot(gvisGeoChart(CityPopularity, locationvar="City", colorvar="Popularity",
    options=list(displayMode="markers", region="US", resolution="metros")))

plot(gvisGeoChart(CityPopularity, locationvar="City", colorvar="Popularity",
    options=list(displayMode="markers", region="US-AL", resolution="metros")))

希望这会有所帮助。

I don't think that you can plot data by Canadian provinces with a Geo Map.
It appears to me that Google pushes and develops the Geo Chart more than the Geo Map.
The Geo Chart uses SVG / VML to render the chart rather than Flash.

On December 6 Google published a new version of their Visualisation API.
The Geo Chart was improved as well, see:
http://code.google.com/apis/chart/interactive/docs/gallery/geochart.html

The new version (0.2.13) of the googleVis package takes those updates into account.
In partticular, you can set the resolution of the geo chart, e.g. to 'provinces':
I believe the best you can achieve today for Canadian provinces is the following

library(googleVis)
plot(gvisGeoChart(CityPopularity, locationvar="City", colorvar="Popularity",
     options=list(displayMode="markers", region="CA", resolution="provinces")))

# There seem to be more granular maps available for the US:

plot(gvisGeoChart(CityPopularity, locationvar="City", colorvar="Popularity",
    options=list(displayMode="markers", region="US", resolution="metros")))

plot(gvisGeoChart(CityPopularity, locationvar="City", colorvar="Popularity",
    options=list(displayMode="markers", region="US-AL", resolution="metros")))

I hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文