Xy plot properties

Hi There,
I'm relatively new to Labview. I am trying to create an intensity versus position plot. I have a linear actuator moving a laser source toward a detector, as the source get closer to the detector, the detected intensity will rise. So I'm am trying to plot the relationship.
What I need help is how to set the XY plot such that it will only show positive position and intensities regions, and how to keep previous ploted points on the graph as I move the laser source to the detector so I could save an intensity vs position profile.
Thanks a lot
Brian

There are a couple of ways of doing this:
First, if you know the number of points that are going to be displayed beforehand (even approximately) you can pre-initialize an array of that size and pass it into a shift register. As you acquire new data points, insert them into that array and display it accordingly.
The second method, which is much less efficient (causes frequent memory reallocation) requires you to use the Build Array.vi in order to add a new point to your array every time it is acquired.
See the attached example of both of these methods. You will obviously have to modify the code to fit your situation, as I dont know many of the specifics of your application. There are almost definately better ways of implementing what I did, but this is the quick and dirty way. In the event this is not what you wanted, at least it draws a cool shape.
Jeff
Using Labview 7 Express
Attachments:
XY Example.vi ‏66 KB

Similar Messages

  • Problems with XY Graph "forgetting" plot properties

    I am having trouble with an XT Graph in my loop.
    The graph has 10 plots which at any time can have anything from 0 to ~1000 points, often some plots will have significantly less ploints than others. There is a user selectable option to display all points or just the most recent set.
    My problem is that I want the graph to reflect the input data by plotting a single point at the time of an update, so I have a string of points rather than a line.
    When I right click the graph and go into properties, I change the point style to solid circle and turn off line interpolation. I then click save these values as default, and save the vi.
    However, once I run the vi, the graph always reverts plots 1 to 9 (not plot 0, this stays as I want it) to have no points displayed and line interpolation on.
    Has anyone had this problem before? Ho did you fix it?
    I know it can be fixed, as I had this probelm a few months ago on a similar vi and after weeks of struggle I solved it, however I just cannot remember how I did it.
    Thank you for any help, at the moment I can't post any code. Note that the data the graph shows is all perfectly fine, just the plot properties are being forgotten.
    Solved!
    Go to Solution.

    HI DarraghCorrigan,
    In relation to the problem expressed in your initial post:
    "once I run the vi, the graph always reverts plots 1 to 9 (not plot 0, this stays as I want it) to have no points displayed and line interpolation on"
    This is due to a bug in the LabVIEW software whereby any changes that are made to the plot properties (e.g. to change the colour of a plot) will not be retained, except in plot 0 which is unaffected. Our R&D department are currently investigating this problem so that it can be fixed in future version of the software. The recommended workaround for this problem is to pragmatically set the plot settings at the beginning of the code using property nodes.
    As I understand it, this is not the main problem that you are experiencing. If you set up the properties for a plot (using some of the described property nodes) which is subsequently removed or rewritten on an XY Graph, my understanding is that there is no way that LabVIEW can remember and retain these properties.
    As you rightly suggested, one way of conveniently overcoming this problem would be to set default plot properties so that when you remove/rewrite a plot and then add it again, it will always default to those properties. Unfortunately, it is not currently possible to do this though it has been recommended as a product suggestion so it is a feature that is under consideration for implementation in future releases of LabVIEW.
    I think the issue you need to be addressing is the fact that you are at some point resetting the graph by sending an empty array to it such that all of your properties are lost. If you can find and remove this section in your code, you should be able to overcome your problem.
    I hope this helps.
    Best Regards,
    Christian Hartshorne
    NIUK

  • 3D graph plot properties - cannot be changed

    Hi all,
    I still cannot change the plot properties of the 3D graph.  I open the Plot Properties tab up and it gets stuck on the first page.
    This means that I cannot release any VIs which use the 3D graph - a big problem.
    Has anyone else experience this?  What do you suggest to fix it.
    Thanks,
    Battler.

    I have experienced exactly the same behavior (can not change 3D graph plot properties) with 3D plots (scatter and surface) in LabVIEW 2011.  The 3D plot properties page works correctly at first but then fails to switch pages after larger data sets have been loaded to the graph.  For example, my scatter graph contains 13 plots, each with 320 points of data.  Once the page "gets stuck" it is stuck for all 3D graphs until the offending graph is deleted and re-created.  To reproduce this issue create at least one 3D plot with a large number of plots in it.
    On a related note, if there was a programmatic method for deleting plots from a 3D graph then it's possible that this issue could be worked around.

  • 3D Plot Properties Axis Format Property update bug

    Tested in LV 2011, Windows XP.
    If you try to change an axis format property (say Digits of Precision) and switch to another axis using the pull-down list box, the property is not updated, even though it is also not applied to the new axis.
    In other words: the default precision is 2 and I want to change it to 1 for the X and Y axes.
    I select the X axis, change the Digits value to 1. This applies it to axis 1. Good.
    I now select the Y axis: the Digits value does NOT change (it stays 1) but the Y axis precision does NOT change either (it stays 2). Not good.
    You have to actually edit the Digits field an press enter to update the value ON THE GRAPH.
    There might be some similar bugs in other properties.

    Hi X.!
    Thanks for posting your find. I would love to take a look at this behavior. There are multiple 3D graph property dialogs depending on your implementation. I've looked at three examples and they each have a slightly different menu options under format properties. Can you point to or post an example that duplicates the behavior?
    Best Regards,
    Andrew S
    Application Engineering Specialist
    National Instruments

  • How do you change multiple plot properties programatically?

    How would you programatically change the color and line size of different plots? I know you create a property node but when I do that I don't seem to be able to specify which plot I want to change.
    For example: plot 1 is green w/ dotted line, plot 2 is red with solid line.
    I want to programatically change say plot 1 to a blue solid line and plot 2 to a yellow line.
    There is a "plot name" property but no matter what name I specify it changes all the plots.

    First, you have to use the "Active plot" property, as in the attached example...
    CC
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    MultiPlot colors.vi ‏49 KB

  • In the properties window from a CWGraph you can set the style (bar, line, multicolor). How can you do this programmaticly?

    I can't find the style property in my object inspector(Delphi). With style, I want to set the graphic type. For example: simple, bar or multicolor. In the help from the CWGraph object I can not find anything about it. I have solved the problem now by exporting the desired graph and then import it if I create a new object Dynamicly. Does anyone have an answer?

    You set the style for each individual CWPlot, not the graph itself. Each plot can have its own style, the graph style sheet is just there for quick changes of common plot styles. You would change the LineStyle, PointStyle, Colors, etc of each plot to do this programmatically. For example, to pick a bar style for a plot you would:
    CWGraph1.Plots(1).LineStyle = cwLineStepXY
    CWGraph1.Plots(1).FillToBase = True
    CWGraph1.Plots(1).PointStyle = cwPointNone
    This would create a plot that steps and is filled to base with no points shown (bars). If you want to see how the graph styles change the plots, pick a graph style in the property pages, then look at the plot page and see how the plot properties changed.
    Best Regards,
    Chris Matthews
    Measurement Studio Suppo
    rt Manager

  • LabVIEW 2009 3D Plot has no Loose Fit property and Axis AutoScale does not function at run time ?

    I cannot find a Loose Fit property for the new 3D plots (waterfall, ribbon) in LV 2009.  As a result, my data range of 1402 to 1407 ends up on a Z axis range of 1400 to 1500 and looks like a flat line.
    The Z Active Axis properties Range Maximum and Range Minimum can be used to set the range but the Z Axis Autoscale property had to be changed to False using either the front panel Plot Properties at edit time or using the Range Auto Scale property at run time on the block diagram.  It could not be changed at run time by popping up on either the plot border or on the Color Palette.
    In edit mode, R-clicking on the Color Palette's AutoScale Z did not make that property toggle or stick and did not change its function.
    At run time, there are two AutoScale Z selections shown.  One along with the X and Y scales and another by itselfat the bottom.  Again, clicking the one that is part of the X and Y axis did not make its setting stick and did not have an effect.  What does happen though is that the other AutoScale Z shown at the bottom of the Color Pallete popup does toggle its state.  But clicking on the AutoScale Z shown at the bottom does not toggle its state.
    The grey border region of the plot area contains at run time, popup setting for X,Y and Z AutoScale that likewise have no effect.
    Or am I missingsomething ?
    Message Edited by SteveP on 08-15-2009 07:55 PM
    Attachments:
    LV 2009 3D Plot Axis Autoscale.vi ‏18 KB

    Steve,
    you should be able to successfully change the scales based on the min and max values as long as you explicitly turn off autoscale. In your program, I just right-clicked the  Range Auto Scale property selected "change to write", then made a control so that I could set the value myself. Clean up the broken wires, and the program runs like it's supposed to - resetting it's scale range: 
    is this the result you wanted? 
    Misha

  • Plot colors mismatched with legend

    Does any happen to know why colors on a graph would not match the colors indicated in the legend?
    I am trying to use a property node to set the color and name for each set of data which is displayed. The colors and names are displayed properly in the legend, but the color of the plot itself does not follow.
    Attachments:
    View_Collected_Data.vi ‏132 KB
    data.txt ‏6 KB

    The loop knows how many times to go due to a feature of LV called auto-indexing. If you pass in an array and let it autoindex on the boarder, the loop will automatically pull out the next value in the array with each iteration--AND set the number of time to loop before stopping. Compared to the hoops C makes you jump through to use arrays, this is indeed Very Cool...
    Note that if you wire both the N terminal on a FOR loop, and autoindex an incoming array, the loop will iterate the smaller of the two sizes. For example, if you wire 5 to N and pass in an array with three elements, the loop will only go three times.
    Finally, always remember that a FOR loop can iterate zero times. In that case any outputs coming directly from the loop will be
    the default value for the datatype. Arrays will be empty, numbers will be zero'd and (this is a biggie) references numbers will be invalid(!).
    In the case of your code, I modified the logic such that it generates an array of indexes that has one element for each signal selected. This array drives the loop that sets the plot properties. Note that if the operator selects more than 5 signals the higher-numbered plots will be undefined in terms of color and label because you only specify 5 colors in an array. (Input an array of 10 items and an array of 5 items and the loop only goes 5 times.)
    Note that, although it's not used here, auto indexing also works with outputs. In that case though, the loop will automatically collect an array of the output values--one element per iteration.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Xy graph active plot property settings not working

    I set the xy graph plot properties manually and they appear to work. However, when I try to set them in the program they revert to the manual settings. What's going on?
    PaulG.
    "I enjoy talking to you. Your mind appeals to me. It resembles my own mind except that you happen to be insane." -- George Orwell
    Solved!
    Go to Solution.

    I went to the graph and made plot legend visible and extended it from one plot to 3. That's all I did. Now it appears to be working properly. It's been a long while since I had to get really fancy with a graph but I don't remember having to do this. My memories of  graph properties were that they were a little more dynamic. 
    PaulG.
    "I enjoy talking to you. Your mind appeals to me. It resembles my own mind except that you happen to be insane." -- George Orwell

  • Legend Plots Shown change details

    I today noticed LV 8.5 has changed the XY Graph "Legend Plots Shown"; it now reads in its description that is no longer supported and that Legend : Number of Rows has taken its place. There were several forums discussing an error 1077 when not setting Legend: Plots Shown before changing Plot properties using Active Plot (i.e. this forum). Where I had used this property before, it seems I can take it out without the error 1077 being thrown. It seems I do not need to set the Legend: Number of Rows OR Legend: Plots Shown.
    I was wondering if anyone could expound on why the change was made, and whether I have to worry about this error again (i.e. can I take out the Property Node as it seems?).
    Michael

    Michadl,
    I can't answer your question specifically, but here's how I set the number of plots and their names in the legend of my graphs from control inputs:
    Message Edited by Bill@NGC on 02-09-2008 01:50 PM
    “A child of five could understand this. Send someone to fetch a child of five.”
    ― Groucho Marx
    Attachments:
    plotattributes.png ‏10 KB
    waveformgraph.png ‏45 KB

  • Problem with colour used in plot legend

    Hi I have problem setting the colour for lines at Plot 0 and 15
    Here's attached. I am using LV 7.1 Not sure if it carries bug
    regards
    Clement
    Attachments:
    plotlegend.vi ‏27 KB

    Hi Clement,
    Did this occur after you had been using the plot and changing properties programatically?  Do you have ideas on how you arrived at this?  It looks like all the plot properties are set up the same.
    Regards,
    Clint M
    National Instruments

  • Size of plot legend graphics

    After trying to resize the plot legend of a waveform graph with the mouse, the small graphics showing the color and other plot properties suddenly got much longer, and the plot text was no longer left aligned. Tried to modify the legend programatically with a property node, setting ActPlot, LegWidth etc, but it doesn`t work the way I expected. The attached picture show an example of the problem. I want to resize the legend so it get a width the same as the outer bounds of the graph, the text should be left aligned, and the graphics stay small and right aligned. I`m using LV 2009.
    Spoiler (Highlight to read)
    Attachments:
    graph-legend.JPG ‏66 KB

    Gunnar,
    You can basically get the sizes and alignations correct by customizing the Plot Legend. Select first the waveform graph itself -> Edit: Customize Control. After that select the first row (See Picture) from the Plot Legend and do the same -> Edit: Customize Control. Now you can type in the long plot name and move the graphics part to the right. Press "Apply changes" often to check if the Legend and its elements are in right place. Finally replace the original control with the customized control.
    I hope this helps. A bit tricky to explain, but by playing with the customizing tool I'm sure you will get the idea soon.
    Cheers,
    Cerati
    P.S. I noticed that it is in fact easier to write the plot names first directly to the legend and then use the customizing tool for the plot row to move the graphics to the right.
    Attachments:
    Customize plot legend.jpg ‏73 KB

  • Refresh graph properties (colors...) when front panel not opened

    I have a problem with setting the plot properties of a multiple xy-graph.
    I first pass the data (n plots, number variable) to the graph control, THEN I set the according properties like color, line style etc. by a property node beginning with "active plot" followed by the properties. So when I set them, the xy-graph is already initialized with n plots.
    Afterwards, I take the graph picture and save it to a bitmap-file.
    That works fine as long as the front panel is opened or the number of plots and their attributes stays constant. But if the panel is closed (which is the default of that VI) and the number of plots changes, I get only as many plots plotted correctly as there are shown in the plot legend
    - regardless of if the legend is shown or not.
    I don't like the idea of having a huge legend on the panel which still might be too small sometimes or having the legend scaled by it's height-property in pixels.
    What I need is something like a .refresh-method that forces the graph to update even if the front panel is closed. Any idea how to do this?
    Cheers & thanks, Daniel

    The issue you are seeing is because LabVIEW doesn't update the controls/indicator of a front panel that is not open. This is done to save computer resources. The simple way around this is to use VI server to open the front panel for it to update and then close it again. You can use the VI property FP.position to move the window offscreen where it can't be seen and perform the open/close. This will get you the results you are after while still allowing the illusion of a closed front panel.

  • Multiple Plots & Scales On 1 Graph

    Hi
    In one waveform graph how we can plot two data with different y-axis i.e.. Multiple plots in one graph
    thanks

    Hi Husssey,
    "right-click" is your friend!
    - Right-click the Y axis and select "duplicate axis" to create an additional Y axis. Now right-click that new axis and select "swap side" for your convenience...
    - Show the plot properties. Right-click the plot and select your "Y axis" to attach the plot to...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • 3D Plot Color Ramp - Colors to Values

    Hi all,
    The Color Ramp for 3D plots only displays 3 values; not all values for every displayed color is shown (see below).
    The actual values associated with each color is available via the 3D Plot Properties dialog (during edit).
    How can I access the values for these colors programmatically such that I can display them to the user?
    Thanks,
    Battler.
    Solved!
    Go to Solution.

    Alisha P wrote:
    You're right that they don't match the values exactly. It also is completely dependent on how the values are set for your particular color ramp, especially whether or not they are evenly spaced. In your first post, you showed a picture with the colors distributed according to the default. The method I mentioned in the previous post gets pretty close to these values (really a little under each of them - has to do with how the default is distributed).
    You're also right that this isn't a very good solution. It's a work around to a functionality that I don't think exists. There are probably better work around options - that's just what I came up with.
    One question please Alisha.
    Are we to accept your work-around as the best answer NI can offer?
    I would think a CAR is called for to ensure R&D is at the very least aware of the issue.
    A little concerned this will get swept under the rug,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

Maybe you are looking for

  • Error While downloading Track in NWDS

    My system landscape has CMS and DTR on one server, CBS on other and SLD on the other machine. I could sucessfully create a track using CMS by importing the software component created in the SLD. But when i tried to import the track from Development C

  • Connecting my new ipod mini

    Hi everyone, I bought a new ipod mini on saturday and have been struggling to connect it to my pc. WHen I connect my ipod mini this is what happens: 1. The apple logo appears on my ipod, 2. A sad ipod face appears on my ipod, 3. The battery logo appe

  • Problem Outputting Data From Second Table Based On ID in FIrst Table

    Hi Everyone: I have been stuck for a couple of days on a couple of issues. Here is one: I have a COURSES table. I also have a COURSES Summary page that displays all of the courses and related info. When a user clicks on a specific course it takes the

  • How to speed up the query time after adding order by

    Hi, In Form 6.0 front-end and 8i server, I put an "order by date column desc" in Block Property and when I hit query button the screen will bring up the most current date data instead of oldest date data. The problem is slowing down the query time, b

  • Unable to raise Message from Sattelite System to support Desk

    Hi Experts, I am facing issue when i try to raise the message from sattelite system to support desk in solution manager 7.0.For this Below Checks i ahve already performed please suggest i am missing something. 1.RFC in Back Format. 2.addtional RFC au