# Need assistance with plotting Cell Center Points and Normals (ListPlot, ListVectorPlot)

The dat file contains data points for x,y coordinates and x,y coordinates of four normal vectors associated with these coordinates. I don't know if I have done this right, so I am trying to plot up my datapoints and the four normals associated with each datapoint. I should be able to plot the datapoints and the four normals emerging from the datapoints ( with the tail of each normal ending at appropriate datapoint)

I don´t really know how to scale my vector plots so the arrows will fit to the meshgrid and cell center points.

CellDataNormals =
Import["C:\\Users...\\CellCenters-and-Normals.dat", "Table",
"IgnoreEmptyLines" -> True];

CellCenterx = CellDataNormals[[All, 1]];
CellCentery = CellDataNormals[[All, 2]];
CellCenter = Transpose[{CellCenterx, CellCentery}];

NormalEastx = CellDataNormals[[All, 3]];
NormalEasty = CellDataNormals[[All, 4]];
NormalEast = Transpose[{NormalEastx, NormalEasty}];

NormalNorthx = CellDataNormals[[All, 5]];
NormalNorthy = CellDataNormals[[All, 6]];
NormalNorth = Transpose[{NormalNorthx, NormalNorthy}];

NormalWestx = CellDataNormals[[All, 7]];
NormalWesty = CellDataNormals[[All, 8]];
NormalWest = Transpose[{NormalWestx, NormalWesty}];

NormalSouthx = CellDataNormals[[All, 9]];
NormalSouthy = CellDataNormals[[All, 10]];
NormalSouth = Transpose[{NormalSouthx, NormalSouthy}];

CenterPoints =
ListPlot[CellCenter, PlotRange -> {{-11, 11}, {-11, 11}}];

NEast = ListVectorPlot[Transpose[{CellCenter, NormalEast}]];

NNorth = ListVectorPlot[Transpose[{CellCenter, NormalNorth}]];

NWest = ListVectorPlot[Transpose[{CellCenter, NormalWest}]];

NSouth = ListVectorPlot[Transpose[{CellCenter, NormalSouth}]];

Show[CenterPoints, NEast, NNorth, NWest, NSouth]


Is there a way I can scale all this and plot it on the same graph so that it looks prettier :) ? I don't really know how to scale the size of my datapoints and vector arrows.

-
Have you looked at things like VectorStyle -> {Red, Arrowheads[Tiny]} in the manual page for ListVectorPlot? Right now I don't know how to get four arrows at each point, for so many points, to look good. –  Michael E2 Mar 13 '13 at 23:46
Thank you for the comment Michael. Yes, I had looked at that. The Problem is also that ListVectorPlot only plots a few vectors, it doesn't plot all the vectors. –  l3win Mar 14 '13 at 0:04
Can I perhaps zoom in on some of the data points, shrink the normals alot and see how they are distrubuted? –  l3win Mar 14 '13 at 2:46

Perhaps the following will give you some ideas about how you could proceed.

Here's some random data that seems to be structured like yours, although the values may be far from realistic (sorry for not using yours):

data = With[{n = 25},
MapThread[Join, {RandomReal[{-10, 10}, {n, 2}], RandomReal[{-1, 1}, {n, 8}]}]];


This partitions each line of data into pairs (center, normal, normal, normal, normal):

centersNormals = Partition[#, 2] & /@ data;


You might get more control over the individual points with Graphics:

normalArrows[{ctr_List, normals__List}] := (* turns a line of data into four arrows *)
Arrow /@ ({ctr, ctr + #} & /@ {normals});
Graphics[{
Riffle[Hue /@ Range[0., 0.99, 1/4], (* shuffles colors between the groups of normals *)
Transpose[normalArrows /@ centersNormals]], (* groups all East normals, North normals etc. *)
Point[First /@ centersNormals] (* plots call center locations *)
}, Axes -> True]


You can use Select to choose a range of the data and zoom in on an area:

Manipulate[Module[{x0, y0, centersNormals},
{x0, y0} = location;
centersNormals = Partition[#, 2] & /@
Graphics[{

I take it that it's because you're running out of memory? Perhaps if you start with a small radius (try 1 instead of 10). I don't see where the code is a memory hog, except that dataZoom and centersNormals duplicate each other and part of data. I'll edit it. It's quick, but it might only help a little. –  Michael E2 Mar 14 '13 at 19:44