ggmap,其值显示在国家/地区

时间:2017-08-19 09:07:47

标签: r ggplot2 plotly ggmap

我正在寻找一个列的国家给定样本数据的一些帮助,并指望另一列。我正在尝试使用ggplot构建地理地图,当我将鼠标悬停在国家/地区上方时,会显示地图各个位置的国家/地区的计数和名称。以下是给出的样本数据。我尝试使用带有lat和long位置的ggmap来识别国家,但是在悬停时无法显示国家的计数和名称。

structure(list(Countries = c("USA", "India", "Europe", "LATAM", 
"Singapore", "Phillipines", "Australia", "EMEA", "Malaysia", 
"Hongkong", "Philippines", "Thailand", "New Zealand"
), count = c(143002, 80316, 33513, 3736, 2180, 1905, 1816, 921, 
707, 631, 207, 72, 49)), .Names = c("Countries", "count"), row.names = c(NA, 
13L), class = "data.frame")

我尝试了以下代码。

countries = geocode(Countryprofile$Countries)
Countryprofile = cbind(Countryprofile,countries)
mapWorld <- borders("world", colour="grey", fill="lightblue")
q<-ggplot(data = Countryprofile) + mapWorld + geom_point(aes(x=lon, y=lat) ,color="red", size=3)+
  geom_text(data = Countryprofile,aes(x=lon,y=lat,label=Countries))

ggplotly(q)

1 个答案:

答案 0 :(得分:0)

您可以更改with tf.Session() as sess: with tf.name_scope('input'): x=tf.placeholder(tf.float32,[None,bucketlen],name="input") ...... with tf.name_scope('out'): y=tf.tanh(tf.matmul(h,hW)+hb,name="predict") builder=tf.saved_model.builder.SavedModelBuilder(export_dir) builder.add_meta_graph_and_variables(sess,['foo-tag']) ......after the train process builder.save() 结果中的任何属性。在这种情况下,您可以设置第二条迹线的 try (Graph g=model.graph()){ try(Session s=model.session()){ Operation operation=g.operation("input/input"); logger.info(operation.name()); } } 属性(定义标记的位置)。

ggplotly

enter image description here

text