1
$\begingroup$

In plotting a 3d vector fields using VectorPlot3D[] with one domain length longer than the others, the vector shapes (both head and tube) flatten to account for the longer length domain. This can make the plot look pretty ugly.

VectorPlot3D[{x, y, z}, {x, -1, 5}, {y, -1, 1}, {z, -1, 1}, 
 VectorPoints -> 3, VectorAspectRatio -> .2] 

enter image description here

It makes sense why they are being flattened since the domain length in the x-dimensions is 6 whereas the others are 2. I would like them not to appear flattened. Is there a way to normalize all the vector shapes so this doesn't happen?

Note - Interesting that neither the head nor stem flatten in 2-dimensional vector fields when using VectorPlot[]

$\endgroup$
5
  • $\begingroup$ A related question. $\endgroup$ Commented Jul 1, 2022 at 10:34
  • $\begingroup$ Seems have been fixed in 13.1 version. $\endgroup$
    – cvgmt
    Commented Jul 1, 2022 at 10:49
  • $\begingroup$ @cvgmt Possibly, but I just tried the code in the wolfram cloud which is running 13.1 (as stated at the bottom of Steven Wolfram's blog June 29th press release) and doesn't seem to be fixed there. Can anyone confirm whether or not the issue has been fixed in the 13.1 desktop version? $\endgroup$
    – B flat
    Commented Jul 1, 2022 at 11:09
  • 1
    $\begingroup$ I confirm that it have been fixed in 13.1. The www.wolframcloud.com maybe use another 3D render method so it is difference with the result of Win + 13.1. $\endgroup$
    – cvgmt
    Commented Jul 1, 2022 at 11:28
  • $\begingroup$ Great! Time to upgrade. ; ) $\endgroup$
    – B flat
    Commented Jul 1, 2022 at 11:41

1 Answer 1

1
$\begingroup$

Per cvgmt, version 13.1 fixes my issue. However, for those interested, here is a solution that works in previous versions by scaling the vectors using a replacement rule.

VectorPlot3D[{x, y, z}, {x, -1, 5}, {y, -1, 1}, {z, -1, 1}, 
  ImageSize -> Large, VectorAspectRatio -> .2, VectorPoints -> 5] /. 
 a_Arrow :> Scale[a, {1, 1/3, 1/3}]

enter image description here Thanks to "J. M.'s slightly less busy" for the reference.

$\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.