LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
X.

Implement Symlog scales

Status: New

Graphs allow displaying data in linear or log scale.

This doesn't go without glitches, so my first suggestion would be fix all the annoying bugs which exist.

But a common way to get motivated to fix a bug being to implement a few feature, here is a unique opportunity:

 

Implement symmetric log scales (aka symlog scale) on all Graphs

 

What is a symlog scale, you will ask?

It is a log scale accepting negative arguments.

 

If x > 0, then Log(x) is computed (and labeled "x", hence the log scale apparence).

if x < 0, -Log(-x) is computer and labeled "x"

 

To get a visual representation of what this all mean, Google "symlog scale" and you will most likely end up on this page from which I am linking this figure:

 

 

Of course this should work on both axes (or all 3 axes for a 3D Graph).

 

The benefit is that when a curve has negative values, using a log scale to represent the plot results in a clipped plot. All negative values are gone, leaving gaps in the plot. The only way to visualize them is to revert to a linear scale, which now clumps all small positive values to pretty much the same location on the axis.

4 Comments
dthor
Active Participant

>>  if x < 0, -Log(-x) is computed and labeled "x"

Do you mean "if x < 0, -Log(Abs(x)) is computed and labeled "-x"?

X.
Trusted Enthusiast
Trusted Enthusiast

No (although abs(x) = -x if x<0).

I mean what I wrote and the illustration makes clear what that means.

dthor
Active Participant

Oh, yes, I misread it. I think that using Abs(x) is more clear than '-x'.

X.
Trusted Enthusiast
Trusted Enthusiast

OK, here is the special (and identical) version for dthor:

if x<0, -Log(Abs(x)) is computed and labeled -Abs(x)

 

In fact, it is a bit more subtle than what is captured by this simple formula, since the scale is linear around 0.

 

The idea is that if you are interested in values between 10^-m to 10^M, (m & M >0) (irrespective of their sign), the axis comprises ticks for Log(Abs(x)) = -m, -m+1, ..., -2, -1, 0, 1, 2, ..., M on both side of the value 0.

 

These ticks would thus be labeled:

-10ˆM, -10ˆ(M-1),..., -10ˆ0, -10ˆ-1, -10ˆ-2, ..., -10^-m, 0, 10ˆ-m, 10^(-m+1), ..., 10^-1, 10ˆ0, 10ˆ1, ..., 10^M

 

Values in between -10ˆ-m and +10ˆm would be arranged linearly.

Details can be found on the pyplot documentation page.

 

I hope this clarify the purpose of a symlog scale.

In particular, it allows representing the value of the function at x = 0 while keeping the advantaged of a log scale.

 

Note that UI-wise, it would raise some interesting challenge in LabVIEW, since you would need to be able to adjust the 10ˆ-m values as well as the 10^M values independently.

One more reason to get excited as a developer to work on it!