8
$\begingroup$

Bug introduced in 13.0, persisting through 13.1.


I am plotting a vector field data where the background color indicates the vector orientation. I use ColorFunction -> Function[{x, y, vx, vy, n}, Hue[ArcTan[vx, vy]/(2 π), 0.8]] to get the rainbow-like color. Working with MMA Version 13.0.1 on a mac in case it matters.

However, a black vertical line in the middle appears out of thin air. How to get rid of it?

If we commented out MaxRecursion, it could disappear. But I do need high enough MaxRecursion in order to get accurate plots in most cases.

enter image description here

data = {{{{-0.26`, -0.04`}, {0.7251542862020461`, 
      0.6885864224647483`}}, {{-0.26`, 
      0.004444444444444438`}, {0.8121180248865612`, 
      0.5834931993214237`}}, {{-0.26`, 
      0.04888888888888888`}, {0.8811364875617238`, 
      0.4728620203477842`}}, {{-0.26`, 
      0.0933333333333333`}, {0.9227870341189213`, 
      0.3853103809424353`}}, {{-0.26`, 
      0.13777777777777775`}, {0.9387404583547154`, 
      0.3446249437402623`}}, {{-0.26`, 
      0.1822222222222222`}, {0.9399044920889795`, 
      0.3414374697524531`}}, {{-0.26`, 
      0.2266666666666666`}, {0.9359387379799902`, 
      0.3521628582750081`}}, {{-0.26`, 
      0.2711111111111111`}, {0.9320161622080637`, 
      0.36241671233947315`}}, {{-0.26`, 
      0.31555555555555553`}, {0.9298547993488173`, 
      0.367926693959504`}}, {{-0.26`, 0.36`}, {0.9295066796287508`, 
      0.3688052772474045`}}}, {{{-0.20222222222222225`, -0.04`}, \
{0.8556862281880812`, 0.5174950037336158`}}, {{-0.20222222222222225`, 
      0.004444444444444438`}, {0.9366382828719669`, 
      0.3502980546030101`}}, {{-0.20222222222222225`, 
      0.04888888888888888`}, {0.9978730037786964`, 
      0.06518794619929208`}}, {{-0.20222222222222225`, 
      0.0933333333333333`}, {0.9737646644203485`, \
-0.2275574176473401`}}, {{-0.20222222222222225`, 
      0.13777777777777775`}, {0.9736609224239935`, \
-0.22800089505187915`}}, {{-0.20222222222222225`, 
      0.1822222222222222`}, {0.9994612127543253`, \
-0.03282200785529828`}}, {{-0.20222222222222225`, 
      0.2266666666666666`}, {0.9921701970481471`, 
      0.1248931546940847`}}, {{-0.20222222222222225`, 
      0.2711111111111111`}, {0.9780096688347512`, 
      0.20855955424228417`}}, {{-0.20222222222222225`, 
      0.31555555555555553`}, {0.9684918800506811`, 
      0.249045133009857`}}, {{-0.20222222222222225`, 
      0.36`}, {0.9635117236666386`, 
      0.26766613225610514`}}}, {{{-0.14444444444444446`, -0.04`}, \
{0.9285595029972205`, 0.3711835791000931`}}, {{-0.14444444444444446`, 
      0.004444444444444438`}, {0.9745915358918044`, 
      0.22398959388340717`}}, {{-0.14444444444444446`, 
      0.04888888888888888`}, {0.9466968491577266`, \
-0.3221258694902238`}}, {{-0.14444444444444446`, 
      0.0933333333333333`}, {-0.14406357977553372`, \
-0.9895684337034293`}}, {{-0.14444444444444446`, 
      0.13777777777777775`}, {-0.38683304517344397`, \
-0.9221497682924613`}}, {{-0.14444444444444446`, 
      0.1822222222222222`}, {0.06675217080553657`, \
-0.9977695864741262`}}, {{-0.14444444444444446`, 
      0.2266666666666666`}, {0.9356622664583724`, \
-0.3528967598689195`}}, {{-0.14444444444444446`, 
      0.2711111111111111`}, {0.9997553207759659`, 
      0.022120094487719903`}}, {{-0.14444444444444446`, 
      0.31555555555555553`}, {0.9914970015769683`, 
      0.1301295349406951`}}, {{-0.14444444444444446`, 
      0.36`}, {0.9854302489652773`, 
      0.17008005298750184`}}}, {{{-0.08666666666666667`, -0.04`}, \
{0.9686134796871743`, 0.24857177427918867`}}, {{-0.08666666666666667`,
       0.004444444444444438`}, {0.9821468295473782`, 
      0.18811593555579756`}}, {{-0.08666666666666667`, 
      0.04888888888888888`}, {0.999564444643616`, \
-0.029511370762798382`}}, {{-0.08666666666666667`, 
      0.0933333333333333`}, {-0.6306572010306724`, \
-0.7760615277077959`}}, {{-0.08666666666666667`, 
      0.13777777777777775`}, {-0.8639920532258941`, \
-0.503505443826086`}}, {{-0.08666666666666667`, 
      0.1822222222222222`}, {-0.854387321708981`, \
-0.5196367043454054`}}, {{-0.08666666666666667`, 
      0.2266666666666666`}, {-0.4647503397636045`, \
-0.8854417664022938`}}, {{-0.08666666666666667`, 
      0.2711111111111111`}, {0.9834815922465346`, \
-0.18100817029134625`}}, {{-0.08666666666666667`, 
      0.31555555555555553`}, {0.9993561016559114`, 
      0.03588010706644777`}}, {{-0.08666666666666667`, 
      0.36`}, {0.996200250424407`, 
      0.08709225599528819`}}}, {{{-0.02888888888888891`, -0.04`}, \
{0.9960399744529618`, 0.08890651996194232`}}, {{-0.02888888888888891`,
       0.004444444444444438`}, {0.9973486974476692`, 
      0.07277070632773598`}}, {{-0.02888888888888891`, 
      0.04888888888888888`}, {0.9996134862888723`, 
      0.027800683973717478`}}, {{-0.02888888888888891`, 
      0.0933333333333333`}, {-0.8541802659537857`, \
-0.5199769930055754`}}, {{-0.02888888888888891`, 
      0.13777777777777775`}, {-0.9855679393258248`, \
-0.16928035022721158`}}, {{-0.02888888888888891`, 
      0.1822222222222222`}, {-0.9874106472894941`, \
-0.15817779116975342`}}, {{-0.02888888888888891`, 
      0.2266666666666666`}, {-0.9744549840336947`, \
-0.22458291139775438`}}, {{-0.02888888888888891`, 
      0.2711111111111111`}, {0.9758236585083735`, \
-0.21855934547699685`}}, {{-0.02888888888888891`, 
      0.31555555555555553`}, {0.9999993818193678`, \
-0.0011119176597457494`}}, {{-0.02888888888888891`, 
      0.36`}, {0.9996786054596054`, 
      0.025351248220522333`}}}, {{{0.028888888888888853`, -0.04`}, \
{0.9960399744529619`, -0.08890651996194215`}}, \
{{0.028888888888888853`, 
      0.004444444444444438`}, {0.9973486974476691`, \
-0.07277070632773605`}}, {{0.028888888888888853`, 
      0.04888888888888888`}, {0.9996134862888723`, \
-0.027800683973717474`}}, {{0.028888888888888853`, 
      0.0933333333333333`}, {-0.854180265953787`, 
      0.519976993005573`}}, {{0.028888888888888853`, 
      0.13777777777777775`}, {-0.9855679393258248`, 
      0.16928035022721144`}}, {{0.028888888888888853`, 
      0.1822222222222222`}, {-0.9874106472894941`, 
      0.15817779116975347`}}, {{0.028888888888888853`, 
      0.2266666666666666`}, {-0.974454984033695`, 
      0.22458291139775366`}}, {{0.028888888888888853`, 
      0.2711111111111111`}, {0.9758236585083737`, 
      0.2185593454769964`}}, {{0.028888888888888853`, 
      0.31555555555555553`}, {0.999999381819368`, 
      0.0011119176597455553`}}, {{0.028888888888888853`, 
      0.36`}, {0.9996786054596054`, -0.02535124822052211`}}}, \
{{{0.08666666666666667`, -0.04`}, {0.9686134796871744`, \
-0.24857177427918864`}}, {{0.08666666666666667`, 
      0.004444444444444438`}, {0.9821468295473783`, \
-0.18811593555579761`}}, {{0.08666666666666667`, 
      0.04888888888888888`}, {0.9995644446436162`, 
      0.029511370762798177`}}, {{0.08666666666666667`, 
      0.0933333333333333`}, {-0.6306572010306719`, 
      0.7760615277077964`}}, {{0.08666666666666667`, 
      0.13777777777777775`}, {-0.8639920532258941`, 
      0.5035054438260858`}}, {{0.08666666666666667`, 
      0.1822222222222222`}, {-0.854387321708981`, 
      0.5196367043454054`}}, {{0.08666666666666667`, 
      0.2266666666666666`}, {-0.4647503397636051`, 
      0.8854417664022933`}}, {{0.08666666666666667`, 
      0.2711111111111111`}, {0.9834815922465344`, 
      0.18100817029134664`}}, {{0.08666666666666667`, 
      0.31555555555555553`}, {0.9993561016559114`, \
-0.0358801070664478`}}, {{0.08666666666666667`, 
      0.36`}, {0.996200250424407`, -0.0870922559952882`}}}, \
{{{0.14444444444444443`, -0.04`}, {0.9285595029972206`, \
-0.3711835791000928`}}, {{0.14444444444444443`, 
      0.004444444444444438`}, {0.9745915358918045`, \
-0.22398959388340747`}}, {{0.14444444444444443`, 
      0.04888888888888888`}, {0.9466968491577264`, 
      0.3221258694902242`}}, {{0.14444444444444443`, 
      0.0933333333333333`}, {-0.14406357977553294`, 
      0.9895684337034295`}}, {{0.14444444444444443`, 
      0.13777777777777775`}, {-0.38683304517344347`, 
      0.9221497682924616`}}, {{0.14444444444444443`, 
      0.1822222222222222`}, {0.0667521708055345`, 
      0.9977695864741261`}}, {{0.14444444444444443`, 
      0.2266666666666666`}, {0.9356622664583722`, 
      0.3528967598689197`}}, {{0.14444444444444443`, 
      0.2711111111111111`}, {0.999755320775966`, \
-0.022120094487719722`}}, {{0.14444444444444443`, 
      0.31555555555555553`}, {0.9914970015769683`, \
-0.13012953494069493`}}, {{0.14444444444444443`, 
      0.36`}, {0.9854302489652774`, -0.17008005298750178`}}}, \
{{{0.2022222222222222`, -0.04`}, {0.8556862281880813`, \
-0.5174950037336157`}}, {{0.2022222222222222`, 
      0.004444444444444438`}, {0.936638282871967`, \
-0.3502980546030096`}}, {{0.2022222222222222`, 
      0.04888888888888888`}, {0.9978730037786964`, \
-0.06518794619929158`}}, {{0.2022222222222222`, 
      0.0933333333333333`}, {0.9737646644203483`, 
      0.22755741764734116`}}, {{0.2022222222222222`, 
      0.13777777777777775`}, {0.9736609224239934`, 
      0.22800089505188031`}}, {{0.2022222222222222`, 
      0.1822222222222222`}, {0.9994612127543253`, 
      0.03282200785529918`}}, {{0.2022222222222222`, 
      0.2266666666666666`}, {0.9921701970481471`, \
-0.12489315469408459`}}, {{0.2022222222222222`, 
      0.2711111111111111`}, {0.9780096688347513`, \
-0.20855955424228392`}}, {{0.2022222222222222`, 
      0.31555555555555553`}, {0.9684918800506811`, \
-0.24904513300985678`}}, {{0.2022222222222222`, 
      0.36`}, {0.9635117236666388`, -0.26766613225610497`}}}, \
{{{0.26`, -0.04`}, {0.725154286202046`, -0.6885864224647483`}}, \
{{0.26`, 
      0.004444444444444438`}, {0.812118024886561`, \
-0.5834931993214238`}}, {{0.26`, 
      0.04888888888888888`}, {0.8811364875617238`, \
-0.4728620203477841`}}, {{0.26`, 
      0.0933333333333333`}, {0.9227870341189213`, \
-0.38531038094243536`}}, {{0.26`, 
      0.13777777777777775`}, {0.9387404583547154`, \
-0.3446249437402622`}}, {{0.26`, 
      0.1822222222222222`}, {0.9399044920889795`, \
-0.34143746975245315`}}, {{0.26`, 
      0.2266666666666666`}, {0.9359387379799902`, \
-0.3521628582750082`}}, {{0.26`, 
      0.2711111111111111`}, {0.9320161622080637`, \
-0.36241671233947326`}}, {{0.26`, 
      0.31555555555555553`}, {0.9298547993488174`, \
-0.36792669395950395`}}, {{0.26`, 
      0.36`}, {0.9295066796287508`, -0.36880527724740436`}}}};

ListVectorDensityPlot[data, MaxRecursion -> 4, VectorStyle -> Gray, 
 VectorColorFunction -> None, ColorFunctionScaling -> False, 
 ColorFunction -> 
  Function[{x, y, vx, vy, n}, Hue[ArcTan[vx, vy]/(2 \[Pi]), 0.8]], 
 ImageSize -> Medium]
$\endgroup$
5
  • $\begingroup$ Your code runs fine on v12.2.0 Win7-x64. Try Exclusions->None to see if it makes a difference. Include the output of $Version to your post. $\endgroup$
    – Syed
    Sep 3, 2022 at 7:38
  • $\begingroup$ @Syed Exclusions not a valid option of ListVectorDensityPlot. Working with V13.0.1. $\endgroup$
    – xiaohuamao
    Sep 3, 2022 at 8:40
  • $\begingroup$ On 13.1 version, only when MaxRecursion->0 work. $\endgroup$
    – cvgmt
    Sep 3, 2022 at 9:07
  • $\begingroup$ No black line in v12.3.1, win10. Please report this to WRI. $\endgroup$
    – xzczd
    Sep 3, 2022 at 12:59
  • $\begingroup$ I confirm that the bug is absent in version 12.3.1 on Windows 10, but is present in version 13.1.0. $\endgroup$ Sep 5, 2022 at 3:50

1 Answer 1

7
$\begingroup$

Setting InterpolationOrder to a even number circumvents the issue:

ListVectorDensityPlot[data, MaxRecursion -> 4, VectorStyle -> Gray, 
 VectorColorFunction -> None, ColorFunctionScaling -> False, 
 ColorFunction -> Function[{x, y, vx, vy, n}, Hue[ArcTan[vx, vy]/(2 π), 0.8]], 
 ImageSize -> Medium, PlotRange -> All, InterpolationOrder -> 2]

I'm not sure why, though.

enter image description here

$\endgroup$
1
  • $\begingroup$ Thank you for the workaround! $\endgroup$
    – xiaohuamao
    Sep 4, 2022 at 3:33

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.