I have a 2D wave (y_2D) where rows are scaled according to the calculated x-values and the different columns are for different data sets (all with the same x-scaling), and I like to plot each column against the same x-scale in the same plot... I'm having some problems getting this to work - this is what I have:
function plot2Dwave(w)wave w // contains traces to be plotted in columns variableivariable nCols = DimSize(w,1)Displayfor(i=0; i<nCols; i+=1)appendtograph w[][i]endforend
function plot2Dwave(w)wave w // contains traces to be plotted in columns variableivariable nCols = DimSize(w,1)Displayfor(i=0; i<nCols; i+=1)appendtograph w[][i]endforend
That works - thank you so much!!!
If it isn't too complicated/too much of a trouble, do you mind explaining why my code above is illogical/doesn't work, please?
for(aa = 0; aa < num_cols; aa += 1)
y_1D[] = y_2D[p][aa]appendtograph y_1D
endfor
this overwrites y_1D each time the loop runs. You should end up with num_col traces on the graph which are all on top of each other and have the values of the last column of your 2D wave.
June 23, 2017 at 02:24 am - Permalink
June 23, 2017 at 02:28 am - Permalink
That works - thank you so much!!!
If it isn't too complicated/too much of a trouble, do you mind explaining why my code above is illogical/doesn't work, please?
June 23, 2017 at 02:32 am - Permalink
this overwrites y_1D each time the loop runs. You should end up with num_col traces on the graph which are all on top of each other and have the values of the last column of your 2D wave.
June 23, 2017 at 03:36 am - Permalink