This is a follow-up question to this one.

Here is a MWE showing the problem:



scale only axis,
separate axis lines,
every outer x axis line/.append style={black},
every x tick label/.append style={font=\color{black}},
every outer y axis line/.append style={black},
every y tick label/.append style={font=\color{black}},
axis background/.style={fill=white}
point meta={sqrt((\thisrow{u})^2+(\thisrow{v})^2)},
every arrow/.append style={-{Straight Barb[scale length={max(0.01,\pgfplotspointmetatransformed/1000)},scale width={0.5*max(0.01,\pgfplotspointmetatransformed/1000)}]}}}
table[row sep=crcr]{
x   y   u   v\\
0   0   0.45    0.45\\
1   0   -0.45   0.45\\

And here is the output: Output of MWE The problem is that the arrowheads are extremely small!

  • Change max(0.01, ... to max(10, ...
    – Jake
    Jul 7, 2015 at 18:12
  • Thanks @Jake that does work. So since both vectors are the same length \pgfplotspointmetatransformed defaults to 0?
    – OSE
    Jul 7, 2015 at 18:14
  • It looks like adding point meta min=0 makes sure that \pgfplotspointmetatransformed isn't 0 when the arrow length is non-zero. To get reasonable sized arrows I still need to add a scaling factor on the computed length though.
    – OSE
    Jul 7, 2015 at 18:23
  • In your real code (I assume this is just a simplified example), do you want the arrowheads to all have the same size, or do they depend on the vector length?
    – Jake
    Jul 7, 2015 at 19:10
  • Yes this is just a simplified example. I would like them to have a size proportional to the vector length, similar to the default output of MATLAB's quiver function.
    – OSE
    Jul 7, 2015 at 19:16


Your Answer

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

Browse other questions tagged or ask your own question.