Hello I'm trying to manually clip the scale of the colors for the streamlines in StreamPlot. The problem is that at the origin the velocity goes to infinity and that throws off any attempt to rescaling. I've already tried modifying the RegionFunction... to no avail.
This is the default output:
StreamPlot[{-(y/(2 \[Pi] (x^2 + y^2))), x/(2 \[Pi] (x^2 + y^2))}, {x, -3, 3}, {y, -3, 3}, PlotLegends -> Automatic]
I have managed to somewhat achieve a working example:
StreamPlot[{-(y/(2 \[Pi] (x^2+y^2))),x/(2 \[Pi] (x^2+y^2))},{x,-3,3},{y,-3,3},RegionFunction->Function[{x,y,vx,vy,n},x^2 +y^2>0.1],PlotLegends->Automatic,StreamColorFunction->(ColorData["Rainbow"][Rescale[Norm[{#3,#4}],{0,0.00005}]]&),StreamColorFunctionScaling->False]
However I still had to fiddle with the Rescale values, 0.00005 is somewhat arbitrary and it does not tell me what is the actual value assigned to red or above. The plotlegend (ColorBar) then has to be inserted manually and I don't know how to do that. What I would like is a simple command to say: "Set Color Range to -> {vmin,vmax}" in this case the values I'm interested are {0,0.35} and then display the color bar with correct values as well. Thank you!