Create a 4D plot using Gizmo
kat_B
Thu, 03/29/2018 - 01:37 am
Hello, I have some data from flights that I wish to plot. I read through the section on multidimensional waves but I am not very skilled at programming so I wasn't able to gain much insight. I have 3 waves with the coordinates (longitude, latitude and altitude) and one more wave with my data (let' s say organics mass fraction) during the flight. All waves have the same amount of points. How can I plot my data in 4D, having points throughout the flight and color-code them depending on the mass fraction? I was able to do a 3D with the concatenate demand showing in x-y the longitude and latitude and z-axis altitude, but my data points were those of the altitude, I couldn't append my mass fraction wave...I could really appreciate any help.
ModifyGizmo
.Assuming you have a 1D wave "mass":
Instead of "Rainbow" you can use other color tables, see:
The resulting 2D wave "mass_C" can then be used to color code the scatter plot.
March 29, 2018 at 03:47 am - Permalink
1. Create a triplet wave that describes the aircraft path. This is accomplished by concatenating as follows:
2. If the data are sufficiently dense you can try plotting as a contiguous path. Otherwise use a scatter. To add a path use:
AppendToGizmo path=root:tripletPath
AppendtoGizmo axes=boxAxes
ModifyGizmo setDisplayList=0, object=path0
ModifyGizmo setDisplayList=1, object=axes0
To add a scatter use:
AppendToGizmo defaultScatter=root:tripletPath
At this point you have either a scatter or a path plot and you need to code the 4th dimension say massWave. If you are plotting a path use a colorscale to code this information. CharLie's response above shows you the general idea except that in the case of a path you would use e.g.,
ModifyGizmo ModifyObject=path0,objectType=path,property={ pathColorType,2}
ModifyGizmo ModifyObject=path0,objectType=path,property={ pathColorWave,root:massWave_C}
If you are using scatter you have two options. The first is identical to the above, i.e., color the scatter object. The second option is to use the massWave to create a scaling wave that would scale the size of the scatter marker to indicate the massWave data. The size wave is a 3-column wave (for scaling x, y and z directions) with a scale of 1 to draw the marker in the default size. Suppose you want the massWave to range from a scale of 0.5 to 1, i.e., half default size to full default marker size. In that case you would execute the following code:
Variable wmin=WaveMin(massWave)
Variable delta=wmax-wmin
Make/n=(DimSize(massWave,0),3) scatterScaleWave
scatterScaleWave=0.5+(massWave[p]-wmin)/(2*delta)
// apply to your scatter object:
ModifyGizmo ModifyObject=scatter0,objectType=scatter,property={ sizeType,1}
ModifyGizmo ModifyObject=scatter0,objectType=scatter,property={ sizeWave,root:scatterScaleWave}
At this point you may want to append a map at the bottom of the graph. You can find a full demo of this feature under File Menu->Example Experiments->Visualization->flightPathDemo.
I hope this helps,
A.G.
WaveMetrics, Inc.
March 29, 2018 at 11:17 am - Permalink
March 31, 2018 at 08:03 am - Permalink
Choose Gizmo Menu->Add Annotation... and in the dialog select ColorScale as the annotation type. Alternatively execute, e.g.,
April 2, 2018 at 10:11 am - Permalink
This operation is for graphs or layouts only....
Thank you for all your help.
April 22, 2018 at 03:12 am - Permalink
April 23, 2018 at 10:12 am - Permalink
April 30, 2018 at 01:04 am - Permalink
April 30, 2018 at 05:04 am - Permalink