1
$\begingroup$

I have a user-defined vector par={b,d}. Also, I have a user-defined function f(b,d). What I would like to do is to plot the expression f(b,d)=0 and label the axes with the corresponding names of the parameters. Up until now, I have tried this:

ContourPlot[f[b,d] == 0, {par[[1]], 0, 4}, {par[[2]], 0, 6}, 
  FrameLabel -> {ToString[par[[1]]], ToString[par[[2]]]}]

but I am getting the following error:

Error Message

$\endgroup$
1
$\begingroup$

Use Evaluate.

par = {b, d};
f[x_, y_] = x^2 + y^2 - 1;
ContourPlot[
 f[b, d] == 0, {par[[1]], 0, 4} // Evaluate, {par[[2]], 0, 6} // 
  Evaluate, FrameLabel -> {ToString[par[[1]]], ToString[par[[2]]]}]
$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.