I’m trying to set up an XY graph in labVIEW to display the desired position of our arm, relative to our joysticks. I have all the code to draw it, and it looks really cool.
However, I’d like to also have the actual position of the arm on top of it, in a different color. I can use the exact same code to draw it, but I don’t know how to get the second color on it. If there’s some way to make it transparent and hide the background, or just set each point to be a different color, that would be great.
I’ll attach what I have so far. If you can see any way to optimize it (it currently takes about a half millisecond) or make it simpler, that’s be great also.
I haven’t looked at your code but I’m assuming it works. Making a multiplot grpah in labview is pretty easy. All you need to do is bundle two or more single pot graphs. Just take the single plot XY graph (I’m not sure if it’s an array or bundle of the top of my head) that you were feeding directly in to the plot XY graph indicator, duplicate it changing values, ect, so it graphs what you want, and then bundle the two together. All you have to do then is feed this bundle in to the plot XY graph indicator.
As far as color changes and such go if on the front panel you right click on the XY graph and select preferences there are a bunch of options you can mess with there.
If you programmatically want to set two different colors, you can set the Active Plot property to the 0 or 1 plot index, and then set the color. You can also just do this interactively with the graph itself. Show the plot legend and click on a plot to change style, show points, change colors, etc.
Hmm, I think you’re telling me how to change the color of the points, which I figured out already. I really want to have some points be one color, while, at the same time, have other points be a different color on the same graph (or two graphs but one with a transparent background).
What exactly does the active plot property do? Should I use it for this application?
Each plot has a line and point color. A graph can have as many plots as you like, so the typical pattern is to separate the points into different arrays based on whatever the color represents. Then set the colors on the plot and put a different array to each plot.
It would sometimes be nice to be able to change the properties of a specific point on a plot, but the LV graphs were designed way more for performance than presentation flexibility.