contour plot of a custom function in R
问题 I'm working with some custom functions and I need to draw contours for them based on multiple values for the parameters. Here is an example function: I need to draw such a contour plot: Any idea? Thanks. 回答1: First you construct a function, fourvar that takes those four parameters as arguments. In this case you could have done it with 3 variables one of which was lambda_2 over lambda_1. Alpha1 is fixed at 2 so alpha_1/alpha_2 will vary over 0-10. fourvar <- function(a1,a2,l1,l2){ a1*