# How can I keep Mathematica from interpolating extra field lines?

I have a fortran code that creates tables of vectors. One for the y-axis, one for the z-axis. The MMA code then takes these points, creates a point-by-point data list, flattens the resulting array, and finally plots the result using ListStreamPlot

*Import data and split into Bx and By arrays

FullData = Import["field-data-neatened.txt", "Table"];
FullData // TableForm


*Split into two separate arrays

NumRows = Length[FullData]/2;
BxData = FullData[[1 ;; NumRows]];
ByData = FullData[[NumRows + 1 ;; -1]];
NumRows
BxData // TableForm
ByData // TableForm


*Make mapping from (row,col) indices to (x,y) coordinates

PointCoordinates[{i_, j_}, {xMin_, xMax_, xSteps_}, {yMin_, yMax_,
ySteps_}] := Module[
{x, y},
x = xMin + (j - 1)*(xMax - xMin)/xSteps;
y = yMin + (ySteps + 1 - i)*(yMax - yMin)/ySteps;
{x, y}
];


*check of iterating over points and calculating their (x,y) coordinates

Block[
{
xMin = 0., xMax = 2., xSteps = 10,
yMin = 0., yMax = 2., ySteps = 10
},
Table[
PointCoordinates[{i, j}, {xMin, xMax, xSteps}, {yMin, yMax, ySteps}],
{i, 1, xSteps + 1}, {j, 1, ySteps + 1}]]


*Iterate over points The result of Table is a two-dimensional array {{ {P,V}, {P,V}, ...}}. ListStreamPlot wants a one-dimensional array { {P,V}, {P,V}, ...}. So we use Flatten[...,1] to flatten the array by one dimension.

PointDataList = Block[
{
xMin = 0., xMax = 2., xSteps = 10,
yMin = 0., yMax = 2., ySteps = 10
},
Flatten[
Table[
{
PointCoordinates[{i, j}, {xMin, xMax, xSteps}, {yMin, yMax,
ySteps}],
{BxData[[i, j]], ByData[[i, j]]}
},
{i, 1, xSteps + 1}, {j, 1, ySteps + 1}
],
1]]
PointDataList // Column
ListStreamPlot[PointDataList, StreamScale -> None]


And this is the graph that it produces:

http://picpaste.com/thumbs/SingleWireProblem.1371834611.png

As you can clearly see, Mathematica is trying to keep the even spacing between plotted lines as they spread out. This has a two-fold detrimental effect on our chart: 1) Flux density is misrepresented 2) Data resolution close to our charged surface isn't sufficient

Is there a way to keep Mathematica from doing this? This problem is going to have added levels of complexity as soon as we move past this plotting problem and we would like to avoid combining our table generation program and our plotting program to in order to compartmentalize any debugging problems we might have.

We have also tried using VectorPlot and plotted the elliptical integrals within Mathematica itself. The difficulty with that is it severely lengthens our computation time and doesn't seem to solve the problem regardless.

Ultimately we are trying to map magnetic field lines about a charged, rotating disk. The image I posted here is for a 1-dimensional wire wrapped into a loop.

Any thoughts?

-
None of the code before ListStreamPlot will be usable (hence relevant to the reader) unless you provide the data file field-data-neatened.txt somewhere. Also, the image link doesn't seem to work. –  Jens Jun 21 at 17:50
To get the streamline density to be proportional to the field strength everywhere is going to be very hard. It requires choosing the StreamPoints manually. I would instead suggest the easier way: use either ListLineIntegralConvolutionPlot or StreamDensityPlot where you can represent the field strength smoothly as a color shading. –  Jens Jun 21 at 17:53
Link to your graph is not working. You can reupload the image to imgur.com –  shrx Jun 21 at 18:13