3
$\begingroup$

This is a very weird question, I'm plotting impedance and admitance using parametric curves This is my code

parts[z_] := {Re[z], Im[z]};
func[f_] := 
  1/(470 - I/(\[Omega] c) /. c -> 680*10^-9 /. \[Omega] -> 2 f); 
ParametricPlot[{parts[func[f]]}, {f, 100, 10000}, 
 AspectRatio -> Automatic, PlotRange -> All, 
 AxesLabel -> {"Re", "Im"}, PlotLabel -> "Y", Frame -> None, 
 Axes -> True, AxesStyle -> Arrowheads[{0.0, 0.03}], 
 PlotLegends -> {"\!\(\*SubscriptBox[\(Y\), \(1\)]\)"}, 
 PlotStyle -> {Red, Blue, "", ""}, MeshFunctions -> {#3 &}, 
 Mesh -> {(Evaluate@
      Map[{#1, {Blue, PointSize[Large], 
          Text[Style[Row[{#1 "Hz"}], 12, 
            Black], (parts[(func[#])]), {-1.2, 0}]}} &, 
       Append[Table[1/(i + 1) 10000, {i, 11}], 10000]]) // N}, 
 ImageSize -> {425, Automatic}]

And what is the result? This:

The plot is incredibly small

if I try to resize I get some jittering, but sometimes I see this buggy parametricplot]

but then I get the first image again. What is going on?

$\endgroup$
2
  • 3
    $\begingroup$ "What is going on?" To find out, remove elements / options from your plot until you find out what was causing it. Please do this before asking (i.e. construct a minimal example). My bet is on AxesStyle -> Arrowheads[{0.0, 0.03}]. $\endgroup$
    – Szabolcs
    May 28, 2020 at 7:15
  • $\begingroup$ Yes, as @Szabolcs correctly guessed, everything seems to work fine when you remove that AxesStyle option. Something goes wrong with it and MMA puts in far too much image padding. Anyway, I assume that you intended your axes to terminate in an arrow? Take a look at this Q&A, or this one. $\endgroup$
    – MarcoB
    May 28, 2020 at 8:33

1 Answer 1

4
$\begingroup$

The margins of the plot are calculated assuming that the Arrowheads are given in plot coordinates. This is wrong because for drawing them Mathematica takes them as a fraction of the plot size. This is known issue for years, but your code is fine, you just have to tell Mathematica to keep those margins under control by adding the option

ImagePadding -> 30

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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