How to draw a “zoom in” effect in R

前端 未结 2 502
隐瞒了意图╮
隐瞒了意图╮ 2020-12-22 22:07

\"enter

As the sketch map above, you can imagine the upper one is a plot of parameter

2条回答
  •  猫巷女王i
    2020-12-22 22:32

    iplots package comes pretty close to this, though there's technically no 'zooming'. iplots has interactive linked plots implemented with a Java GUI. You can select points on one plot and the same points become highlighted in other plots. The website for the package is here.

    library(iplots)
    data(Cars93)
    iplot(Cars93$Horsepower, Cars93$MPG.city)
    ihist(Cars93$Horsepower)
    

    Here, I've selected some points in the left scatterplot, turning them red, and they also become highlighted in the right histogram (histogram is the closest they have to a density plot).

    enter image description here

提交回复
热议问题