05-08-2015 02:02 PM - edited 05-08-2015 02:03 PM
Hi, I show some octave spectrum in an intensity chart. All is fine, but I can not label the y-axis ticks correct with the frequencies. The Y-axis shows only the index.
In the array left I show the correct text for the y-axis.
How can I replace the 0,1,..,10 with "31,5","63",..."16000" ?
Peter
I can not attach a vi? I get the errormessage:
Correct the highlighted errors and try again.
05-08-2015 02:21 PM
Quick answer to the error message, then (if I can figure it out) I may repost an answer to your question.
To put a VI into the forum, select some, or better yet, all of it on the Block Diagram, and from the Edit menu, save it as a Snippet. This is an image (.png) that (a) can be added to your post (there's an Insert Image icon on the Posting toolbar) and (b) can be saved (by us) onto a LabVIEW Block Diagram where it magically becomes LabVIEW code.
Bob Schor
05-08-2015 02:30 PM
You've done 90% of the work. What you want to do is to change the Y Scale Markers from 1 .. 10 to 31.5 .. 1600. Create a Property Node for the Chart, and wire the array of frequencies that you created on your VI into the YScale MarkerVals[] property. Run the VI and be pleased with the result.
Bob Schor
05-08-2015 04:04 PM - edited 05-08-2015 04:19 PM
Do you mean
But I get only:
I understand MarkerVals[], that at this values of the axis a marker should drawn. But the y axis range is from 0..10 (column index).
I need instead a property MarkerText[] (as string array) to assign the text for the markers.
--
vi attachment: there are many posts with vi files as attachments.
And if I want drag the snippet back to Labview in a block diagram I get only a text with the link.
And the Snippet Tool changed the Reference "intensity chart" to a control "Intensity Chart 2".
05-08-2015 04:29 PM
I don't get it -- I just did this (or thought I did), and it worked (or I thought it worked). Let me play a bit ...
BS
05-08-2015 04:51 PM
How embarrassing -- I must have gotten myself confused by the Frequencies display (and saw what I wanted to see). But you can Have Your Cake and Eat It, Too -- why not turn off the display of the Y Scale, and move the array indicator (which has the "correct" values) over on top of the graph? You might have to play a bit to scale it properly, but this shouldn't be too hard. Note that you can (probably -- I haven't tried) make the background transparent and play with other things so that it doesn't look like "Hey, there's an Array Indicator here ...").
Hmm, can't even figure out how to do that! But you can still place the Array on top of the Chart so you see its values instead of 1 .. 10.
BS
05-08-2015 05:30 PM
hm, I see that this very old problem (similar Allow text labels for graph scales! ) isn't solved in Labview. I have a similar chart in Matlab and there is no problem to set special text for the axis labels. But a Slide allow to set text for the labels. So I have to use:
05-08-2015 06:31 PM
Am excellent solution! I have two suggestions for improvements:
Did you notice my subtle proof that two = 3? Who says I can count?
Bob Schor