XY graph multi plot live points and colour control
Hi All,
I'm trying to do something that should be simple but is proving to be difficult so far. I have had a good look through previous topics and found things similar but not actually what I want.
In my experiment I scan intensity vs wavelength.
Ideally I want to be able to:
1) run a scan and see the points plotted live.
2) Then I want the plot to stay on the graph when I run the next scan, etc.
3) I'd like to do an arbitrary number of scans. e.g. To initiate a scan I press a button, an arbitrary number of times.
4) I want to make it so that the current scan is plotted live in one colour (red), and all the previous scans remain plotted in another colour (blue).
5) Sometimes I may want to clear the graph of all scans and begin again, without having to stop the VI.
Items 1-3 can be taken care of easily by placing the Build XY graph and XY graph object inside the for loop that runs the scan, and unticking 'Clear data on each call' in the propertes of Build graph. See first attached VI.
However, at the beginning of a scan it joins the last point of the previous scan to the first point of the next scan.
The difficult parts are 4 and 5.
For item 4 you need to build an array of plots, which is easy if you know the number of plots, but here the number is arbitrary. So how do I do that? I've had a go by trying to use Insert Array in different ways but I haven't worked it out. Then hopefully using the XY graph property nodes I can set the colours of the plots.
For part 5 it is not enough just to use the invoke node = reinitialize to default, and have a button that executes the node. This clears the graph but then when you run the next scan all the previous plots pop up again, indicating that the array that stores the plots is not actually cleared. The second attachment shows how I'm clearing the graph.
My biggest problem is item 4, and combining item 4 and 5 together.
Please help.
Solved!
Go to Solution.
Attachments:
Current method_Items 1-3.vi 18 KB
Item 5 idea_with no item 4.vi 18 KB
The key is understanding the data type. If you hover over the graph's terminal, you will see that multiple plots are simply an array of single plots. Once you know that, something like this quick modification is fairly easy to come up with. I also added events to make it more readable. Note that this isn't actually a good way of doing things (for instance, you can't abort the drawing in the middle), but it shows the graph concept. You might wish to look at some code like producer/consumer designs.
As for the colors, you're right that the properties can help you there. I will leave it to you to figure out the exact properties, but when you start a new plot, you will basically want to reset all the others to white and make the new one red.
Try to take over the world!
Attachments:
XY Chart.vi 17 KB
Similar Messages
-
Express XY Graph Multi-plot Cursor point
Hi,
In mixed signal graph >> Property >> Cursors Tab >> Enable Allow dragging here if we select Multi-plot, it will show X scale and all Y-scale value in Cursor legend.
How can I get these same options in Express XY Graph?
Sivaraj M.S
CLDYou need to use a property node and find the curser position and then plot those points in a seperate xy plot (only it will be one point instead of an array). You will still have to plot it as an array of one point.
Tim
Johnson Controls
Holland Michigan -
How do i get a xy graph to plot more points?
I'm using the Build xy graph express in Labview 7.0 and I was just wondering how one could increase the amount of points plotted on the graph. Right now, the graph will just plot up to 100 points and then go crazy and go back to 0. I would just like to know if there's any way to increase the amount of points that could be plotted on the graph.
An xy graph will plot exactly the number of points that are in the x and y array. That's assuming that you have the x scale set to autoscale. And, by default, each time the function is called, the graph will reset. You can select properties and change this. You don't mention where you're getting the data. Stick a probe on the input to the express VI and check the size. You can also provide some details on what you're doing or post your VI for someone to look at.
-
Mixed Graph - Multi Plot Cursor Problem
If I plot both Analog Waveform and Digital Waveform in a single Mixed Graph, and when I choose watch all plots in cursor legend, LabVIEW crashes with an error message.....
I have also attached the Print screen image of that Error
Attachments:
error.JPG 188 KBJared Boothe,
I found a solution to overcome that error.
Build all the array data at first and then generate digtal waveform in single instance.
ie., With number of numerical array data, build a 2D array of numerical data and make a transpose and then generate a waveform.
It generates number of digital waveform equal to that of the column size of 2D Array.
Do not build generated digital waveforms. This creates an error while using multi plot cursor--> watch--> All plots.
I have attached the modified, error free Vi with this message for your reference.
Regards,
Raja
Project Engineer
Soliton Technologies
www.solitontech.com
Attachments:
Mixed Graph Modified without Error.vi 25 KB -
Hi,
I'm experiencing a problem using a multi-plot xy graph. I have to display 2 plots together, and make them appear and disappear many times during the program running.
But when I close LV and restart it, the second plot (plot1) doesn't appear, and also I lose all the properties I've set for it (name, color,...). If I don't shut down LV everything works well.
What can I do?Stefano Moret wrote:
When you write about use property nodes, I'm using the "visible" one.
Your suggestion is to try also to set all the properties from there? Maybe it's a good idea, I'll try.
Here are some code snippets I used once to initialize the graph and later on change legend entries depending on user selection.
You can also change the way plots are represented during run time. You always have to start with ActPlot do selct one of the plots.
Good luck -
Hello,
I have a need to plot a curve on an X-Y graph which is Voltage (Vsd) vs Current (Isd). After the first plot, I need to set another voltage (Vg) to a new level and repeat the plot. I would like to do this without erasing the original plot so I can generate a family of curves. Currently, I am using one trace on the graph which traces to zero at the beginning of the next plot. I need to create an entirely new plot on the graph instead of the original going to zero at the beginning of each plot. I cannot plot all curves at the same time because the voltage (Vg) level will change with each curve. Any suggestions will be appreciated.
Thanks,
MarkMaybe I misunderstand the question...
Multiple plots on the XY-graph, means you need to put them in an array. If you don't have all the graphs at once, then you could simply build the array dynamically. I.e. you put the array in a shift register, and add elements (measurements) to it as you go.
See the attached vi for an example.
Attachments:
multi-XYgraph.vi 11 KB -
Path with anchor points and bezier control handles
I have a text, not converted to outline. Live text.
I am using IllCS4.
That is cool thing about hovering the cursor above the text and see hidden path and anchor points only when you hovering exactly above them. But I want them be visible permannently, while I am applying some envelop distort changes. Then I want to turn visibility off. And how to get permanent visiblity of bazier control handles at the same time?
I am lost.
TxYes, thank you,
that is great thing, but when I use it, I see outlines (like a wireframe) of image only.
Is there any way to see still image as it is and switch on visibility of object' path with all control points? -
I have recently purchased a Mac computer (updated to Maverick) to go with my Epson Stylus Photo RX500 printer which has given excellent service with my old Windows computer. However, when trying to print pictures or photos via Photoshop Elements 11, the best results I can get are using the Colour Management and Epson Colour controls in the printing options box.
My problem is that after printing the first photo or picture, when I come to print a second, both the Colour Management and Epson Colour Controls are greyed out and showing No Colour Management, The only way I can reset the controls is to shut down the printer and computer and restart.
Could there may be a setting somewhere that I need to adjust please? I have been in touch with Epson and they say that the Epson Colour controls are part of the Photoshop Elements software but a post on the Adobe forum brought no results and I am unable to contact Adobe.
<Edited by Host>Hello Garry. Thanks for the reply. I guess I should have used a different title from "How do I post a question?" That should come after trying to resolved the colour settings first. However, to answer your question, after experimenting with all the different settings in Photoshop Elements and Epson software, I now start with PSE11 Colour settings then click "no colour management" then after clicking Print, I choose "More Options/Colour Management/Colour Handling/Printer Manages Colour" then I choose "Page Setup/Layout/Colour Matching" which then shows Epson Colour Controls but I also choose "Layout/Colour Management" which then shows "Colour Controls/Mode" I then of course choose an Epson printer profile depending on the paper I am using. I get good results but as I said, the Colour Matching and Colour Controls are then greyed out. Hope that makes sense.
-
Multi plot graph - auxiliary curves
I am in trouble with a multi plot graph. There is a wave chart that I have to plot an auxiliary line when the user clicks on the graphic. I know how to get the initial point and the final point of the auxiliar line. But I don´t know how can I plot this line in the same graph.
Any ideas, sugestions or examples?
Thank you in advanceSpeaking only for myself, I am not sure about the nature of your request.
Could you please post some code showing an example of what you can do now and a jpg of what you desire.
This may help us help you.
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction -
Errors with multi-plot cursors on Mixed Signal graphs
Using a Mixed Signal graph, it seems that a multi-plot cursor does not snap correctly if XScale.Multiplier is not set to 1 - it seems to ignore it altogether. A single-plot cursor on the same graph does not have this problem. Am I missing something?
In the attached VI, XScale.Multipler = 0.1, and Cursor 1 (Single-Plot) shows the correct value, but Cursor 2 (Multi-plot) does not.
Attachments:
MixedSignalCursor.vi 14 KBHello,
The behavior I see is that the multi-plot cursor which is snapped to plot 0 seems to generally follow an "imaginary plot" which corresponds to a scaled version of plot 0, where the scale factor is the value wired to the XScale.Multiplier property. I don't think this is desired behavior so I have filed a corrective action request to R&D to have this addressed. I am sorry for the inconvenience - hopefully you can live with an X-scale multiplier of 1, or the single plot cursors for the time being. It also takes the offset property similarly, offsetting the "imaginary plot" by whatever value is set there.
In any event, if this poses a significant problem with additional contingencies, please let me know and I'll be sure to include any updated information in the corrective action request!
Thank you,
Best Regards,
JLS
Best,
JLS
Sixclear -
XY Graph, 2D Error Bar, Legend, Multi Plot Help? Please modify the VI
PLEASE READ THE ENTIRE POST and HELP!
Please help with this VI and make it an instructive example for me and other novices like me who come across this typical example.
A typical problem in plotting data is as follows: On the SAME plot (Y-axis = Amplitude vs. X-axis = Time), plot the curves Amp1, Amp2, Amp3, ... coming from sample1, sample2, sample3, ...
Furthermore, there is Error1, Error2, Error3, ... associated with Amp1, Amp2, Amp3,...., which also needs to be plotted. In order to distinguish between these curves, one may use different
colors and show a legend that reads Amp1 (say black), Amp2 (say red), and Amp3 (say green). The plot then becomes complete and conveys data very conveniently.
The attached VI makes an attempt to plot Amp1 and Amp2 using XY Graph and also 2D Error Bar plot (to show error bars). There is one slight problem. The legend does not show what it is supposed
to show. Can someone fix this? If I plot two curves, the legend should show Amp1 and Amp2, if I plot three curves, the legend should show Amp1, Amp2, Amp3, and so on.
I don't want to see the default Plot 0, Plot 1, or whatever. Also, it would be nice to dynamically control the symbol, color, curve style etc, as we keep adding more and more curves to the plot.
Once this problem is fixed, I know I can easily extend it to make it plot more than just two curves in a dynamic way. I could use for loops with shift registers, etc to plot any number of curves on a single plot.
Believe me, I have searched for other posts and cannot find a simple example like the one I have posted here. Many examples I found have confused me more than helped me.
I believe that if this problem is solved in a simple way, many others will find this example very instructive. So by helping me, you help many other people as well!
Thank you in advance. Please see the attached files (the VI, and an example data file that I just created)
Solved!
Go to Solution.
Attachments:
Multi_Plot_Legend_Error_Bar.vi 24 KB
data.txt 2 KBSome members have pointed out that this problem has already been resolved (see the link below).
http://forums.ni.com/t5/LabVIEW/Dinamically-handle-legend-names-using-property-nodes/td-p/1479572
I did verify that this works for XY Graph, but not for 2D Error Plot.
I need both legend and error bars. Shame on LabVIEW for not making such a basic plotting requirement easy and trasparent.
There are many clever people who can find work arounds, but that is a not a correct approach. -
Mixed Signal Graph: Cursor Position Property for Multi-Plot Cursor
I'm working 6 waveforms on 3 different plot areas in a mixed signal graph in LV2009. When I try to pull the Cursor.PosY property from my cursor (in which Watch All Plots is True, and is set to Multi-Plot in the graph properties), it returns the value of only the first plot in the cluster of waveforms fed into the graph. I've tried changing the active plot, active plot area, nothing changes. I am able to retrieve each value via the cursor legend, but I cannot pull each of those values into another portion of my program. Also, I noticed that when setting events in an event structure, any events relating to a cursor drag aren't present as they are in a waveform graph. My workaround is to create an indicator for the Cursor.PosX property and monitor when that value changes, but I feel there should be an easier way. Any help is appreciated.
Thank you in advance!Jeanius,
I am not quite sure why the cursor pos in the Wavegraph reference does not change when you change the active plot, but if you grab a reference to the specific cursor and then change the active plot things you receive the expected behavior.
Ben J.
National Instruments
Applications Engineer
Attachments:
MODDEDmixed graph cursor ex.vi 41 KB -
Hello, LV 8.2.1 notes indicates the following bug fix:
43SAIR2A Fixed an issue where LabVIEW crashes when you run a VI that contains a mixed signal graph with a multi-plot cursor.
I am running this version, and still have this behavior. Is there anything I may be missing, and/or certain circumstances that may still be causing this?
thanks in advance,
DarrenDarren:
I looked at the CAR ID that you mentioned and the issue has been resolved in LabVIEW 8.2.1. To verify something similar, I ran the attached VI and things worked just fine. Please feel free to send me the steps to follow to reproduce the issue you are running into in 8.2.1.
Regards,
Rudi N.
Attachments:
MixedGraphs.vi 15 KB -
Multi plot cursor in Mixed Graph
If Digital waveform and normal waveform graph is plotted in a mixed graph, and if I choose watch all plots(multi plot) in cursor, LabVIEW closes immediately with an error popup dialog
I have attached the print screen image of that error popup
Attachments:
error.JPG 188 KBHi Stephen,
I found a considerable solution to overcome that error.
Build all the array data at first and then generate digtal
waveform in single instance.
ie., With number of numerical array data, build a 2D array of
numerical data and make a transpose and then generate a waveform.
It generates number of digital waveform equal to that of the
column size of 2D Array.
Do not build generated digital waveforms. This creates an error
while using multi plot cursor--> watch--> All plots.
I have attached the modified, bug removed Vi with this message for
your reference.
Regards,
Raja
Project Engineer
Soliton Technologies
www.solitontech.com
Attachments:
Mixed Graph Modified without Error.vi 25 KB -
I am using an XY graph with 5 curves which belong to one of two y axes each. All curves share the same array of x values. I do not like the cursor legend so I want to read out the values of the one cursor programmatically. I can create a multi-plot cursor which watches all the 5 curves but I cannot find how I can read out the 5 corresponding y values of my cursor. Any help?
Thanks,
LX (using LV2014)Use the cursor index property value and wire that to an index array function for each y array.
Maybe you are looking for
-
ITunes not running on Windows XP
I've downloaded the latest version of iTunes. It worked the first few times I ran it, but then all of a sudden it refused to open when I clicked it. I get a message saying "iTunes has encountered a problem and needs to close. We are sorry for the inc
-
No connectivity to Itunes after downloading 7.0.1
"Itunes could not connect to the store" "Make sure your network connection is active and try again" I have been trying to connect for the last 3 hours. I connected once but was not able to listen to some of the songs. is this a QT problem too?
-
Purchased and downloaded an app.to IPhone 6, but it will not respond.
I purchased and downloaded an app to my IPhone and opened it, but it will not respond.
-
Pre-ordered an entire album, but was only refunded for one song
on 7/24/14 I pre-ordered TRXYE by Troye Sivan. I got an email saying that something happened and I was getting a refund. I was only refunded for one song. I got a refund for Happy Little Pill, but not the rest of the album. I payed $4.95 for the enti
-
Open Link in new window, when field or column type is of Hyperlink
Hi I have created a column by name Registration of 'Hyperlink or picture' type, and i want to open the link entered by the user in the new window as it is opening in the same window by default. Please help its a very major requirement. Thanks Paru