Color Traces in Waterfall Plot

Hello:

I am able to prepare a waterfall plot with my data. My data has Z-values (intensity) that are a function of x-axis (positions) that are unevenly spaced and y-axis (time) that is evenly spaced (10 min intervals). So the waterfall shows a series of traces from a 2D matrix wave where I have y-scaling set but no x-scaling set (but for x, I can plot against another wave since for each trace the series of unevenly spaced values of position are the same).

My trouble is that I would like to color certain traces in this waterfall plot differently (in groupings for the y-axis). For example, the first 20 traces (in time) are purple, the second 20 traces are black, etc. Is there a good way to do this?

I am open to suggestions such as Gizmo, however, I have not found an option in Gizmo where I can plot against unevenly spaced x-values which is bothersome.

Thank you very much for your time in responding to my issue. I really appreciate it.


Morgan
The attached experiment provides, I think, a solution for what you are asking for.

The graph Graph1 shows a waterfall plot with groups of traces with the same color. This was created by running the Demo function - see the procedure window in the experiment.

This graph uses a color index wave to control the color of each point on each trace of the waterfall plot. The color index point has the same dimensions as the matrix used to create the waterfall plot. Each element of the color index wave contains an index used to choose a value from the built-in Rainbow256 color table.

The Demo function creates the color index wave and sets its values to get the desired effect. The "ModifyGraph zColor" command applies the color index wave to the waterfall plot.

The function MapColumnToRainbow256ColorIndex determines the color for each trace in the waterfall plot. Keep in mind that a trace in the waterfall plot corresponds to a column of the underlying matrix.

The Rainbow256 Color Table plot was used just to figure out what index gives what color using the Rainbow256 color table.

Morgan Waterfall Plot.pxp (149.11 KB)
Wow! Thank you so much! I learned about color tables too! I really can't express how great it is to come here and have your problems solved on this forum. Perfect response! Thanks!

It isn't actually necessary to have a full matrix for the color wave for a waterfall plot. You can make a 1D wave with a point for each column in your waterfall data matrix, and use it to color each line with a single color. Using the matrix for color allows you to color the waterfall plot point-by-point.

So in Howard's example experiment file, there are six columns in the waterfall data, so you would need a color index wave with six points. I have attached a modified version of his experiment file with this method of specifying the colors. It has a wave called colorIndex that chooses colors, and a three-column wave with four rows called ColorForColumns that defines four colors. The values in the colorIndex wave are in the range 0,3 to specify rows from the ColorForColumns wave.

I used the Color Wave Editor package (Data menu->Packages->Color Wave Editor) to prepare the ColorForColumns wave.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Morgan Waterfall Plot 2.pxp (59.89 KB)

In reply to by johnweeks

Loading your version of the experiment crashes my Igor 8 instance, actually...

 

Ps. wow it seems I became an archeologist with this post! ;) 

[Admin Edit: Removed Diagnostics.zip]

That's quite some excavation. ;) Were you looking for something specific about waterfall plots? Btw, I can open it without a crash in Igor 8 build 37948 on windows, but some code runs forever in the background. But anyway, it would be more effective if you'd send crash info directly to the support (I guess there will be no more updates for Igor 8 unless something really problematic turns up, though).

In reply to by chozo

I was looking to make each "trace" of the waterfall a different color. I know I can use f(z) but that just gives the magnitude and I want to differentiate each line with a solid color to make it easier to distinguish when they overlap. 

As for the crash, I'm running the 34722 build. I will update and try again. 

In reply to by tony

tony wrote:

If you simply want to assign different colors to traces in a non-systematic fashion, try graph -> packages -> make traces different

 

The waterfall has no separate traces, hence the quotation marks. It plots from a matrix. This package doesn't work with waterfall. 

 

@Chozo:

Where did you get your build of Igor? I have just reinstalled with freshly downloaded Igor8 installer but I still have build 34722...

 

 

In reply to by Jakub

Ah, yes, I was thinking about fake waterfalls.

try

duplicate waterfall waterfallcolor

waterfallcolor = q

ModifyGraph zColor(waterfall)={waterfallcolor,*,*,Spectrum,0}

where 'Spectrum' is substituted with the color table of your choice.

My suggestion is much more wasteful than the 'correct' method given in the ancient history buried in this thread, but it worked for me without having to think about it. FWIW, Igor9 also crashed after opening and playing with the file Morgan Waterfall Plot 2.pxp.

I can reproduce a crash (macOS) or hang (Windows) using The Morgan Waterfall Plot 2.pxp experiment that John previously attached. I'll investigate and report this internally.

Note: I removed the Diagnostics.zip file that Jakub previously uploaded. I didn't unzip it but if there was a minidump inside there's a small chance that the minidump contains data from memory that Jakub would not want distributed.

In reply to by tony

tony wrote:

Ah, yes, I was thinking about fake waterfalls.

try

duplicate waterfall waterfallcolor

waterfallcolor = q

ModifyGraph zColor(waterfall)={waterfallcolor,*,*,Spectrum,0}

where 'Spectrum' is substituted with the color table of your choice.

 

Thanks, that works! 

 

aclight wrote:

I can reproduce a crash (macOS) or hang (Windows) using The Morgan Waterfall Plot 2.pxp experiment that John previously attached. I'll investigate and report this internally.

Note: I removed the Diagnostics.zip file that Jakub previously uploaded. I didn't unzip it but if there was a minidump inside there's a small chance that the minidump contains data from memory that Jakub would not want distributed.

 

Huh, I did not think about posting a dump implication... Thank you for the quick action! 

 

So it seems archeology is sometimes useful to unearth ancient...bugs ;) 

 

 

I would recommend using Gizmo for any waterfall graph. You can find an example in IP9 File Menu->Example Experiments->Visualization->Waterfall. 

 

A.G.

In reply to by JimProuty

JimProuty wrote:

Tonight's Nightly Build (Build #38461 or later) will have a fix for this problem.

https://www.wavemetrics.net/Downloads/latest9/

Sorry for the trouble.

--Jim

 

Hello Jim  :)

Is it possible to get the update in IGOR8 as well? It is a bug after all... I have now no means to upgrade IGOR to version 9 as I cannot reimburse buying licence by CC anymore...Company policy has changed...

 Kind regards,

 

Jakub

In reply to by Jakub

Jakub wrote:

Is it possible to get the update in IGOR8 as well? It is a bug after all... I have now no means to upgrade IGOR to version 9 as I cannot reimburse buying licence by CC anymore...Company policy has changed...

Sorry, we are no longer maintaining IP8. Depending on when you purchased IP8 it's possible that you're eligible for a free upgrade to IP9. Otherwise we may be able to provide a quote so you can purchase with a PO, or refer you to a reseller if necessary. Feel free to contact sales@wavemetrics.com for help.