LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Showing a single complete plot symbol in a plot legend, e.g. for scatter plots

I would like a plot legend to show a single plot symbol for each data set in a scatter plot. It appears that a complete symbol is only seen if the legend is sized to show at least 3 symbols, and only if the line width is not too large. Furthermore, the layout is according to the classic "zig-zag" pattern.

Is there any way to show the first symbol both correctly centered (vertically) in the legend, as well as not cut off? Second, is there any way to disable the "zig-zag" pattern, and thus have all points in a given legend appear on a straight horizontal axis? This is particularly useful for generating publication quality figures.

Thanks, Lyle
0 Kudos
Message 1 of 10
(4,719 Views)
I know of no way of changing the little graphic that appears in the legend that depicts the graph. I assume that's what you're referring to:



I suppose a workaround is to draw your own legend using a picture control.


Message Edited by smercurio_fc on 06-11-2008 10:17 AM
Message 2 of 10
(4,699 Views)
Attached is an example (LabVIEW 8.2) of how you could draw your own legend using a picture indicator. Probably not the most efficient method, but it's meant for demonstation.
0 Kudos
Message 3 of 10
(4,694 Views)
You are correct that I was referring to the graphic that appears in the legend that depicts the graph. Unfortunately, I still haven't installed 8.2 (if ain't broke, don't fix it...), so I cannot see your demo. But the picture strategy seems plausible (if unfortunate).

Thanks,

Lyle
0 Kudos
Message 4 of 10
(4,689 Views)
What version do you have? VIs can be back-saved. Here is a picture of the code:

Message 5 of 10
(4,686 Views)
7.1
0 Kudos
Message 6 of 10
(4,682 Views)
Unfortunately, I can't backsave to 8.2, as that requires having 8.0. The figure I posted shows the code, which is pretty simple, and all those functions exist in 7.1 so it would be pretty easy to recreate the VI if you decided to pursue this method.
0 Kudos
Message 7 of 10
(4,674 Views)

smercurio's suggestion to use a picture control is the way to go if you REALLY need to change from zig-zag to straight. In fact you can build on that idea by using an invoke node "get image" of an off-screen gragh with its legend showing then pull out the portion that shows the legend. Still using the picture functions over-lay the zig-zag with your straight line version and then update you picture. Of course this means you will have to code up all of the plot property functionality yourself.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 10
(4,671 Views)
Frankly, all of this hacking (in addition to other "features" with controls etc) to make truly presentation (or publication) quality figures with LV  makes me suspect I am missing some key point (especially given the extraordinary power of LV).

Thus, I find that one can generate figures that are *very* close to professional, yet a few details seem elusive. As but one example, I have never seen a graph in a journal article with a legend that imparts any geometry (such as the "zig-zag") other than a straight line. How can this be considered a "feature"?

Any philosophical/practical observations welcome.

Lyle
0 Kudos
Message 9 of 10
(4,663 Views)

The zig-zag pattern has the advantage that it shows you what your plot will look like when toggling the various options (e.g. antialiasing, point styles, fills, etc.)

There are VIs in the picture palettes for creating graphs in picture controls. They include code for creating legends.


___________________
Try to take over the world!
Message 10 of 10
(4,635 Views)