Quiver plots in Gizmo
neutron
Has anyone here ever made 3-dimensional "quiver" plots with Gizmo? Surely this is possible? I have data consisting of 6 waves: 3 for (x,y,z) and 3 for the x, y, z components of the vector at each of these positions (see attached file). I can scatter plot the positions using the XYZToXYZTriplet, but I've been unable to figure out how to add the vectors to these positions. Looking at the Menu->Example Experiments->Visualization->Advanced->Scatter Arrows has not helped.
Thanks for any feedback!
If I understand you correctly, you have a set of XYZ points at which you want to plot 3D vectors. If the first 3 columns of your data represent the points at which the vectors are drawn the last 3 columns should represent the vector in some way which is not obvious to me: are you basically drawing a vector from the first triplet to the second triplet?
In general you can use Gizmo's scatter object to draw a 3D scatter of some marker. Markers can be arbitrarily complex and in particular they can take the shape of an arrow. The arrows in the example are in fact group object which is why the example sits under the "Advanced" category. If you double-click on icon of group0 in the Gizmo Info window it will open to reveal that it consists of two cylinders (one is the body of the arrow and the other is its cone head), together with translations, scaling and colors to make it look as it does. You can modify all these parameters to make the arrow have the shape and color of your choice.
To assign this group object (group0) as the object to be drawn at each scatter point, you double click on scatter0 icon in the Gizmo Info window. In the dialog you will find that Marker Shape is "Fixed" and that it uses an "Object". Under the marker shape popup menu you find an Object popup menu from which group0 is selected.
The settings discussed so far should give you a single size arrow drawn at each scatter point. The next variation is again in the scatter dialog where under Marker Size you have a wave specifying the size of each marker. This is again a triplet wave (3 columns) that in this case applies isotropic scaling on a marker by marker basis. makerSizeWave must have the same number of rows as the number of markers displayed.
If you stopped at this point you would have a scatter of arrows that have different sizes but all arrows are pointing in the same direction. The next step is to rotate these arrows. If you return to the scatter dialog you will find (at the bottom of the dialog) the marker rotation controls where the rotation is specified by a rotation wave called "rotWave". If you inspect rotWave you will find that it has 4 columns where the first corresponds to a rotation angle (in degrees) and the last 3 columns specify the axis about which the arrow is rotated.
I hope this explains to you how the example is constructed so now lets look at your application. If you could express your vectors using 3 waves for origin, scale and rotation you could use a modified version of this example to display your data. Note that in order to obtain the rotation axis you start with the fact that the default arrow is drawn in the +z direction so the rotation axis is the cross-product of that with the desired orientation.
Depending on the specifics of your application, and in particular the density of the data, it may not make sense to use this approach. For example, if you have a large data set it might be better to draw simple lines to represent the vectors.
If you have any questions feel free to contact me directly at support@wavemetrics.com.
A.G.
WaveMetrics, Inc.
March 21, 2012 at 10:42 am - Permalink
Thank you for the reply -- I haven't yet tried out your suggestion, but I wanted to say that I have seen your reply and will try to follow it.
As for your question:
The last 3 columns are the magnitudes of the vectors. So, if we look at the first line in the data file, the 6 columns are:
Column 0 | X =10.741
Column 1 | Y = 0.007
Column 2 | Z = 1.01
Column 3 | x-component of the field at (X, Y, Z) = -6.326
Column 4 | y-component of the field at (X, Y, Z) = 5.778
Column 5 | z-component of the field at (X, Y, Z) = -2.099
How large? I have about 4000 points which is not a lot. I hope this makes sense... Thanks again, and I hope to be back with an update soon-ish.
March 23, 2012 at 01:59 am - Permalink
I suspect that it would be better if you scaled your vectors. The graph itself has a scale implied by the distribution of the XYZ data. For the purpose of the display you need to make sure that your vectors (a) point in the correct direction and (b) have a scaled magnitude. To compute that efficiently extract the last 3 columns into a triplet wave and use MatrixOP to compute a 1D scaling wave that will give you the relative magnitudes and a triplet wave that will give you a unit vector in the desired direction.
If you are going to display 4000 such vectors in a single plot you might want to choose a simpler representation for each marker.
A.G.
WaveMetrics, Inc.
March 23, 2012 at 01:08 pm - Permalink
Thank you for all your help.
March 29, 2012 at 08:01 am - Permalink