05-10-2007 04:06 AM
I have a question with regard to intensity graphs. I can plot both a linear scale and a log scale in an intensity graph. The range of values is from 0 to 127. However, when using a logarithmic scale the size of the marker values is not uniform and it does not allow me to see values larger than 10. I mean the size of the following ranges:
0.001 to 0.01
0.01 to 0.1
0.1 to 1.0
and
1.0 to 10.0
is too big. Then, the space that is left for the remaining marker values is too small.
I want to resize the distance between each marker value so that it matches that that I have for the linear scale.
I have tried using the Uniform Marker Spacing option but it does not work. I also looked for information in the help file but so far I have not been able to find something that allows me so solve this problem.
I hope somebody can help me with this problem.
Roberto
05-10-2007 06:25 AM
05-10-2007 09:05 AM
Thank you for your quick reply Gerd
GerdW:
With regard to your questions:
1) what do you want to achieve?
I am using labview to see files that contain fluid velocity information. In some of my files the data can be visualized using a linear scale. However there are cases where the fluid velocity changes are large. i.e., near the wall of a pipe the velocity is much smaller than that at the center of the pipe. In cases like this having the opportunity to visualize the data using a log scale greatly improves the understanding of the flow.
2) Why can't you set the range from 1e-3 to 127?
I used a linear scale originally and set a property node to read the minimum and maximum values of the data to plot. It turns out that those values are 0 and 127 (when I am only using positive values). I added extra markers because I wanted to have 16 different colors in my graph.
Then I used a case structure to change to log scale in cases when it is desired to see the data in this type of scale.
The data looks like a log scale but it kept the range of the linear scale. So the first range that goes from 0 to 8 occupies a big portion of the scale. Because the values 0.001, 0.01 and 0.1 and 1.0 are contained in it. Then I tried using the Clusters that are shown below the graph and wiring them to a property node. The 1D cluster on the LHS is for the linear scale and the 1D cluster on the RHS is for the log scale. These clusters were only used when the ONLY POSITIVE VALUES option was selected. The cluster on the RHS had a range from 0.001 to 127. I stopped using it because
a) the scale looked like that of the log scale I am showing in this file, that is the range from 0.001 to 10 occupies most of the area of the color graph
b) somehow the cluster did not keep the values even though I saved my file so I had to input the values when I opened the file
3) Which LabView version do you use?
I am currently using version 8.2
4) Can you attach an example?
I am attaching the file I just mentioned and a test file.
05-10-2007 09:55 AM
We cannot really test your VI because of a missing subVI. I suggest that you
Some general comments.
05-10-2007 08:50 PM
We cannot really test your VI because of a missing subVI. I suggest that you
Thank you for your suggestions Altenbach, I followed steps 1 through 8 and saved the Vi as Log Color Scale Modified, which I am attaching.
Some general comments.
a) It is not a good idea to delete the label of the graph/chart and replace it with a diagram comment. Makes it difficult to associate property nodes (some of which now have a wrong label, confusing everyone).
b) One property node containing all properties is enough. Only the different values you write need to be inside the case structure.
c) You should ensure that the properties are only rewritten if they change, not at each iteration for the loop. They are expensive.
d) I have no Idea about the purpose of the while loop in the upper right case structure.
e) I am not sure why you use local variables for "# of profiles" and "array min/max". The wire is right there.
f) Instead of multiplying a local variable with a zero diagram constant, just wire the zero to the property node, eliminating the local.
g) etc...
h) Since the loop count is fully determined before the loop starts and there is no interactive stop button or error check for premature termination, you should use a FOR loop instead.
Also, I addressed your comments (a through h) and the Vi seems to be running faster and smoother. I will keep all of these points in mind for future reference.
For item h) I did try to use a for loop but the vi did not work, I am not sure why so I decided to leave the while loop for now and take care of this later.
Here is the Vi. Thanks again,
Roberto
05-11-2007 01:42 AM
05-11-2007 07:56 AM
Thanks a lot Altenbach,
This Vi looks very compact and efficient. I thik I will use the "Makervals[]" property node to set the color scale. I will most probably need to set them programatically because every file has a differrent number of channels and a different number of profiles to plot.
I have been trying to get set this option programatically so I will continue working on it.
Thanks again for your assistance,
Roberto
12-11-2014 07:04 AM
Hello,
I know that this post is old, but i really need to put the X and Y scale in Logarithm.
Anyone did That???
I have my .vi in attach. I want to have the scale of the XY graph in the intensity Graph.
It's possible? Someone has the solution for that?
12-11-2014 10:16 AM - edited 12-11-2014 10:18 AM
You got the graph to look quite nice. What I would do is just label the axis as Log(time) or Ln(Time)... (or whatever the units are) and set x0 and dx according to the scaling. (I probably would also use log10 instead of ln, etc.)
Workarounds with a real log axis scale would be to a bit clumsy with the current tools (e.g. hide the scale and overlay the scale of a hidden slider, for example. Or you could create a copy of the xy graph and place it in the background without data, then overlay the frameless intensity graph.
(Note that if we had this idea implemented, we could have arbitrary text or numbers for each marker and then all this would be quite simple to implement. Please vote for it! :D)
Anyway, I would recommend to use the "in place element structure" to do the 2D histogram, dramatically simplifies the code (see picture).