Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

This question already has an answer here:

f[k_] = {{-0.001 - 2 I k, 1, -0.001, -0.501}, {0.001, -0.5 - I k, 0.001, 0.001},
         {-0.001, -0.501, -0.001 + 2 I k, 1.}, {0.001, 0.001, 0.001, -0.5 + I k}};

x[k_] = Re[Eigenvalues[f[k]][[3]]];
Plot[x[k], {k, -1, 1}]
ParametricPlot[{k, x[k]}, {k, -1, 1}]

Why does Plot give a result, but ParametricPlot does not? Both functions are supposed to give the graph of the function x[k]. I don't understand why ParametricPlot returns nothing. Please help me to get the difference.

share|improve this question
    
It's because the aspectratio is bad in parametricplot –  Coolwater Jan 28 at 20:32
1  
    
@Sjoerd It seems to me this may be considered a duplicate. Any reason you did not vote to close it as such? –  Mr.Wizard Jan 29 at 0:04
    
@Mr.Wizard I wasn't near my PC, so I couldn't check what "Why does Plot give a result, but ParametricPlot does not?" entailed. I assumed it would be like the linked question, but wasn't sure. Will vote to close now. –  Sjoerd C. de Vries Jan 29 at 17:56
add comment

marked as duplicate by Sjoerd C. de Vries, bobthechemist, Michael E2, rm -rf Jan 29 at 20:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

up vote 3 down vote accepted
Plot[x[k], {k, -1, 1}]

Mathematica graphics

For the ParametricPlot you need to alter the Options to reproduce the plot.

ParametricPlot[{k, x[k]}, {k, -1, 1}, AspectRatio -> 1/2]

You can find out the default AspectRatio for Plot by doing:

Options[Plot, AspectRatio]

{AspectRatio -> 1/GoldenRatio}

Mathematica graphics

OR more elegantly as suggested by Belisarius

p = Plot[x[k], {k, -1, 1}];
ParametricPlot[{k, x[k]}, {k, -1, 1}, Evaluate[AbsoluteOptions[p]]]
share|improve this answer
    
p = Plot[x[k], {k, -1, 1}]; ParametricPlot[{k, x[k]}, {k, -1, 1}, Evaluate[AbsoluteOptions[p]]] –  belisarius Jan 28 at 20:35
    
@Belisarius. Nice –  RunnyKine Jan 28 at 20:37
add comment

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