R language Drawing: Drawing a thermal diagram on a map

Source: Internet
Author: User

Use Ggplot2 to draw thermal diagrams on a map
  ######***** Draw the Heat force code *****###### #interval <-seq (0, 150000, 25000) [-2]                                                        #设置价格区间newpri <-Cut (data1$price, interval, labels = F) #设置价格为因子类型newpri <-factor (newpri, levels = 1:5, labels = c ("25000", "50000", "75000", "100000", "125                                                                                  ) #设置因子顺序data1 $newpri <-Newpri              #添加到数据框中ggmap (Beijing) + stat_bin2d (Aes (LONG, LAT, fill = newpri), data = data1, size = 0.5, alpha = 0.5) +        #绘制热力图 Labs (title = "Beijing Housing Unit Price", x = ' longitude ', y = ' latitude ') + #添加标题                          Scale_fill_manual ("Unit Price (Yuan)", values = C ("#64f830", "#adda30", "#d1b930", "#e89230", "#fa5030"), breaks = C ("125000", "100000", "75000", "50000", "25000")) #设置热力图渐进颜色  

R language Drawing: drawing a thermal map on a chart

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.