# Plotting with 2 variables and given list of f(u,v) values [closed]

Lets say I have a function y with 2 variables u and v :

$f(u,v)=y=u+4v$

I want to plot y in 2-D. My first axis is u and my second is v. How do I plot this, if I have a list of values for my y?

I tried

g[y_]:= InverseFunction[y[u_,v_]]


and put my values in with g/@{1,2,3,4,5} and then created

Table[g[ylist[[i]]{i,1,Length[ylist]}]


This does not work.

Then I tried

aa = Table[ ]

plot = ContourPlot[u+4v, {u, -24, 24}, {v, -20, 20}, Contours -> aa]


but what do I put in Table[ ]? I only have the values for y.

Thank you for the answers. I solved my Problem by just adding my list of values with

Contours->{1,2,3}.

plot = ContourPlot[u+4v, {u, -24, 24}, {v, -20, 20}, Contours -> {1,2,3}]

• I don't think the problem you have is finding a representation of your wishes in Mathematica. What you seem to want is expressed so fuzzily that most probably you didn't really think about the problem itself. I suggest you try to come up with a better description of your problem. One thing to note is that your function is not invertible. For any given y there's an infinite amount of u and v values that yield this y value. So that's one reason (apart from incorrect syntax) your InverseFunction doesn't work. In the last code box you could put the values in a list and use e.g. aa={3,7,9}. Jul 8, 2015 at 14:24
• Is ContourPlot what you want? (The inverse function does not exist mathematically, since y is not one-to-one, so that cannot be what you're after.) Why not just go through some of the docs for ContourPlot and substitute your u+4v, {u, -24, 24}, {v, -20, 20} for the functions there? If you start with ContourPlot[u+4v, {u, -24, 24}, {v, -20, 20}], you can put your mouse over a contour line and it will tell you the value of the contour (that could go in your aa for instance). Jul 8, 2015 at 16:53

Using the default contours in ContourPlot you will see that your function ranges from about -100 to 100 within your PlotRange.
Manipulate[