PDA

View Full Version : WzTable export variables to WzPlot



SpinMan
01-19-2011, 08:13 AM
I understand how to select columnar data from WzTable. What I'd like to do is select two columns, ala Excel, and export them to WzPlot for plotting. When I click on File -> Export Selected Data, in the "Select the destination tool(s) section all I see is WzTable_0. How would i be able to activate WzPlot as an export destination?

rwagner
01-24-2011, 10:49 AM
Hi SpinMan,
Ok, so after selecting the two columns, you go to File->Export Selected Data.
You can deselect the WzTable_0 which is selected by default and make note of the variable name mentioned at the very top of the window. It's to the right of the label that says "Rename the subset of variable(s)". Press ok. This will create a new variable of the selected columns of your data. The problem is that it will be a one-dimensional variable. To resolve this, go to the wave prompt, and use the REFORM command.



WAVE> d = indgen(25,25)
WAVE> navigator
WAVE> ;I selected columns 1 and 2 and exported them as described above
WAVE> ;note that the variable name is d_sub
WAVE> info, d_sub
D_SUB INT = Array(50)
WAVE> ;Here you can see that they were exported into a 1D array
WAVE> print, d_sub
1 2 26 27 51 52 76 77 101
102 126 127 151 152 176 177 201 202
226 227 251 252 276 277 301 302 326
327 351 352 376 377 401 402 426 427
451 452 476 477 501 502 526 527 551
552 576 577 601 602
WAVE> ;So you can reform them to get a the 2D variable
WAVE> d2 = reform(d_sub, 2, 25)
WAVE> info, d2
D2 INT = Array(2, 25)
WAVE> pm, d2
1 26 51 76 101 126 151 176 201
226 251 276 301 326 351 376 401 426
451 476 501 526 551 576 601
2 27 52 77 102 127 152 177 202
227 252 277 302 327 352 377 402 427
452 477 502 527 552 577 602
WAVE> ;Now split the 2d array into two separate variables for plotting
WAVE> y1 = d2(0,*)
WAVE> y2 = d2(1,*)


Now you can update your WzVariables window and use WzPlot to plot y1 and y2 by highlighting them in the WzVariables list.

-Ryan

SpinMan
01-27-2011, 06:27 AM
Is there any way to get WzPlot to show below "WzTable_0?"

rwagner
01-27-2011, 10:57 AM
If WzPlot is open before you try to export your data it will show up there, but the only way to get WzPlot open is to have it plot something. So by exporting your data it will only plot a second line on the existing axes. Furthermore, you would only be able to export one column of data at a time for the reasons I mentioned above.