From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Label Frequencies in Octave Intensity Chart

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.

IntensyChart.png

How can I replace the 0,1,..,10 with "31,5","63",..."16000" ?

 

Peter

 

I can not attach a vi? I get the errormessage:

 

0 Kudos
Message 1 of 8
(3,663 Views)

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

0 Kudos
Message 2 of 8
(3,657 Views)

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

0 Kudos
Message 3 of 8
(3,656 Views)

Do you mean

IntensityOctave.png

But I get only:

FP.png

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".

 

0 Kudos
Message 4 of 8
(3,634 Views)

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

0 Kudos
Message 5 of 8
(3,618 Views)

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

0 Kudos
Message 6 of 8
(3,612 Views)

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:

IntensSlide.png

IntensSlideFP.png

 

 

0 Kudos
Message 7 of 8
(3,602 Views)

Am excellent solution!  I have two suggestions for improvements:

  1. Instead of using a Reference to the Slide and wiring up the Property Node using the Reference, right-click the Slide control and choose Create Reference (which will automatically "link" to the Slide).
  2. Consider making the Slide an Indicator rather than a Control
  3. Select both the Slide Control and the Chart.  Now look at the Tool Bar on the Block Diagram, where the Align and Distribute tools are located.  The next one over (with a Yellow and Green curved arrow chasing each other) will give you the Group option.  If you choose this, your two Front Panel objects are "grouped", and when you move the Chart, the Scale will automatically follow.

Did you notice my subtle proof that two = 3?  Who says I can count?

 

Bob Schor

0 Kudos
Message 8 of 8
(3,583 Views)