
As the sketch map above, you can imagine the upper one is a plot of parameter space, for example, the mean and variance for normal distribution, and the lower one is the corresponding density plot. Any hints for doing this? Thank you~
UPDATE: As an enhancement, can I build a interactive version for this? Say, whenever I mouse-over a point, R shows the corresponding plot beneath.
Here is an interactive version, you can click on a point and then corresponding density plot appears. Mainly used
?identifyand as @Tyler suggested?zoomInPlot.Some more details on how it works:
rxlimandrylimdefined at the very beginning is the size of rectangle which surrounds the selected point, so one might want to change the factor/20. Possibility of multiple clicks is nontrivial:identify()detects clicks only in the “recent” plot, i.e.detects clicks only in the plot #2 (here
identifyPch()is from?identify). For this issuepar(mfg=c(1, 1))was used: