Circle Plot

Hi all,
I am trying to make a quite simple program, where I want to plot a simple circle, using parametric equations.
The equations I am using are:
X=Xc + Ro cos (theta)
Y=Yc + Ro sin (theta)
where Xc and Yc are the centre points of the circle and Ro its radius.
I need to use a tool like "Simulate Signal" or something like this to generate the signal that will plot the graph (or not)?
If so, this signal will be my theta variable, which I need to constraint it, between 0 and 2 (PI). Is it possible?
Thanks,
FGoulao
Solved!
Go to Solution.

ToeCutter wrote:
Those solutions are very elegant if you are familiar with complex numbers, however they add confusion for those not.
The alternative is just to bundle the x,y values from the sine and cosine functions into the (non-complex) form compatible with an x-y graph input.
Learning complex numbers might actually  be easier than learning two different trigonometric functions as well as cluster bundle operations.
(... as long as we stick to the basic things as described in this thread.
It gets a bit more complicated if we e.g. multiply a complex number with a complex number of (1,theta), which corresponds to a rotation in the complex plane. Multiplying by a complex number of (scale,theta) does a scaling and rotation in one step. Very useful. ).
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • In numbers, using a scatter graph, the points come up as circles. Is there a way of changing this so they are crosses like a standard scatter plot?

    I have looked into the settings of the graph but I cant find anything to change this.

    That's not good!  I can't reproduce that problem here. Are you syncing via iCloud with iOS and perhaps opened it there too? And are you sure you're opening the same document? Maybe you have one with the same name in two different places?
    Maybe you will have luck with this:
    If Revert To doesn't work and there's nothing in Time Machine with the chart, you may have to set up the chart again  and, just to be sure, File>Save before you close the document.
    SG

  • How can I change the Y-axis (circular) grid spacing, in Polar Plot VI?

    When using Polar Plot VI, I need more control over the plotting parameters. This means tweaking the sub-VIs in various ways. What I need to do most is make the polar magnitude axis less busy, i.e. only draw circles every 10 instead of every 5 divisions, when using a range of 0 (outermost) to -80 (innermost).
    The magic 'magnitude axis subdivisions' variable seems to be generated in Calc Scale Specs sub-VI, and output as an array of clusters, but I can't quite see how it's created and from what.
    Please can anyone help me gain control over the number of magnitude division circles generated?
    Many thanks!

    I think if you go inside the Calc Increment.vi and modify the Increment output terminal it might change what you want to see. Try putting a multiply by 5 or ten into the case structure for when the log is false.
    Attachments:
    polar plot calc increment.jpg ‏90 KB
    modify calc increment.jpg ‏104 KB

  • How to create a circle with the origin not at (0,0)

    I want to create a circle but the origin is not at (0,0).
    I have the following data;
    - point coordinate (X1,Y1)
    - radius of the circle
    Also, I want to create a line between the origin and the point (X1,Y1).
    Kindly show me how can I do this. Thank you very much. 

    The accuracy of the GPS Receiver is +/- 0.5 meter. Its a Novatel product (Flex Pak). I am getting the string data from the GPS receiver. I took the Longtitude data as for my X and Latitude data for my Y. I took the Longtitude and Latitude data from the center of post for my reference calculation only to get the true value of X and Y at the end of the boom. I call the X and Y value at the end of the boom as dynamic because it always give me the value wherever the boom goes. Please see the attached sample VI's.
    At one point , I actually measured, using a tape measure,  the distance from the end of the boom to the center of post and i am getting the correct radius. But when I rotate the boom on the other side it will give me a different radius. And looking at this radius value, while rotating the boom, I can judge that my point of origin is not (0,0).
    At this point I have no idea how to get the correct origin. Kindly teach me if you have idea on this.
    Do you think the way I calculated for the true value of X and Y is still correct? Is my reference too far?
    Thank you very much.
    Attachments:
    plotting xy graph 1.vi ‏22 KB
    dynamic xy calculation.vi ‏28 KB
    dynamic radius calculation 1.vi ‏15 KB

  • Charts: how do I determine when the mouse is in the plot area

    I'm trying to implement logic that will do the following:
    Panning plot within plot display area by clicking and dragging mouse
    If the user clicks and drags in the chart plot area (the region where the chart plot actually displays, not including the axes, legends, titles, etc.), I want to be able to provide the effect of panning the plot (e.g. similar to grabbing and dragging a map in Google maps) within the plot display. This makes the most sense, of course, if the user has zoomed in to some level and the entire plot is no longer fully visible within the display.
    Zooming on a plot
    If the user places the mouse somewhere in the chart plot area and uses their mouse wheel, I want to be able to provide the effect of zooming in and out of the plot. The plot area itself must remain at its original size, just the representation of the plot needs to simulate the effect of being zoomed in or out on.
    Thoughts, suggestions, ...
    To make the zoom and pan effect, my thought was to adjust the axes bounds as appropriate to simulate these effects. The trick for some of what I'm planning on doing is finding out where the mouse is in the plot area (not the whole chart) so that I can find the x,y offsets from the plot origin (which appears to be in the upper left - at the chart level anyway). For panning, I don't think I care what the offset is, just that it's within the plot. For zooming, I may need to know where the mouse is in the plot so that the zooming could be centered on that location in the plot. This makes me think that it would also be helpful to find out how to translate the mouse x,y pixel position to a corresponding x,y value in the plot data domain.
    I've been experimenting with attaching event handlers to detect various mouse actions and what information can be gleaned from these events. So far I have not found anything that allows me to determine the bounds of the plot region in the overall chart. I can get the mouse x,y position, but I don't know where it is in relation to the plot area bounds. I don't want to initiate a pan of a plot if the user happens to drag their mouse somewhere outside the plot area (i.e. over an axis, legend, etc.). Also, it would not make sense to start a zoom on the chart unless the mouse is over the plot.
    Please let me know if this seems to be a reasonable approach, and if not, please suggest any ideas for alternatives. Any help, ideas and suggestions regarding how to solve these issues and/or determine this information would be welcome.

    I experimented a bit and it seems the plot-content is the Group containing, well, the content of the plot. So in a line chart it's the smallest rectangle containing all the lines and the graphic at the data point (little circles, by default). What you probably need instead is the chart-plot-background.
    Here's a quick example of a panning chart. There are probably better ways to manage the mouse dragging (it behaves somewhat badly if you drag out of the plot area and then back in, for example) but it gives you the basic idea. My original idea of adding a mouse directly to the plot area failed as the event doesn't get propagated to the plot region if you click on part of the plot content (a line, for example).
    import java.util.Random;
    import javafx.application.Application;
    import javafx.beans.property.DoubleProperty;
    import javafx.beans.property.SimpleDoubleProperty;
    import javafx.collections.FXCollections;
    import javafx.collections.ObservableList;
    import javafx.event.EventHandler;
    import javafx.geometry.Point2D;
    import javafx.scene.Scene;
    import javafx.scene.chart.LineChart;
    import javafx.scene.chart.NumberAxis;
    import javafx.scene.chart.XYChart.Data;
    import javafx.scene.chart.XYChart.Series;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.layout.BorderPane;
    import javafx.scene.layout.Region;
    import javafx.stage.Stage;
    public class PanningChart extends Application {
      @Override
      public void start(Stage primaryStage) {
        final NumberAxis xaxis = new NumberAxis("x", 0, 10, 1);
        final NumberAxis yaxis = new NumberAxis("y", 0, 100, 10);
        final LineChart<Number, Number> chart = new LineChart<>(xaxis, yaxis);
        chart.setAnimated(false);
        chart.setData(createData());
        final Region plotArea = (Region) chart.lookup(".chart-plot-background");
        final DoubleProperty lastMouseX = new SimpleDoubleProperty();
        final DoubleProperty lastMouseY = new SimpleDoubleProperty();
        chart.setOnMousePressed(new EventHandler<MouseEvent>() {
          @Override
          public void handle(MouseEvent event) {
            final double x = event.getX();
            final double y = event.getY();
            if (plotArea.getBoundsInParent().contains(new Point2D(x, y))) {
              lastMouseX.set(x);
              lastMouseY.set(y);
        chart.setOnMouseDragged(new EventHandler<MouseEvent>() {
          @Override
          public void handle(MouseEvent event) {
            final double x = event.getX();
            final double y = event.getY();
            if (plotArea.getBoundsInParent().contains(new Point2D(x, y))) {
              moveAxis(xaxis, x, lastMouseX);
              moveAxis(yaxis, y, lastMouseY);
        final BorderPane root = new BorderPane();
        root.setCenter(chart);
        primaryStage.setScene(new Scene(root, 600, 400));
        primaryStage.show();
      private void moveAxis(NumberAxis axis, double mouseLocation,
          DoubleProperty lastMouseLocation) {
        double scale = axis.getScale();
        double delta = (mouseLocation - lastMouseLocation.get()) / scale;
        axis.setLowerBound(axis.getLowerBound() - delta);
        axis.setUpperBound(axis.getUpperBound() - delta);
        lastMouseLocation.set(mouseLocation);
      private ObservableList<Series<Number, Number>> createData() {
        final ObservableList<Data<Number, Number>> data = FXCollections
            .observableArrayList();
        final Random rng = new Random();
        for (int x = 0; x <= 10; x++) {
          data.add(new Data<Number, Number>(x, rng.nextDouble() * 100));
        return FXCollections.singletonObservableList(new Series<Number, Number>(data));
      public static void main(String[] args) {
        launch(args);
    998038 wrote:On a slightly different (but related) subject, where can I find an up-to-date source of information that describes the IDs and class names that JavaFX uses? I assume the ".plot-content" is pertaining to the ID of the chart plot area (or plot "child" of the chart?). Where can I find the names of the various objects that can be "looked up"?I generally try to avoid lookups as they feel a bit fragile. However occasionally there seems to be no other way, as in this case. The [url http://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html]CSS reference guide documents the css class substructure of each Node type.

  • XY graph : Plot point by point

    hi my intention is to plot in a XY graph point by point. Meaning for eg: I want to plot a scatter plot.
    First I check if the array element satisfies a certain condition (let's say if it lies between 1 to 5) if So I want to plot in red color, else I want to check another condition (let's say lies between 5 to 10) and then plot in blue color and so on.
    First I check for the condition and link it to a case structure such that each case structure will contain the  corresponding plot color but it doesnt seem to be working.
    Kindly guide me with this.
    thanks!!
    Solved!
    Go to Solution.

    Hi Chathuri,
    If you want to plot a scatter plot, you can do this by editing the properties of the XY graph.  Righ-click on the X-Y Graph object and click on Properties.This will bring up the property viewer. If you then go to the Plots tab, you should see a screen similar to the one shown as an attachement. The fourth column from the left sets the display type and if you click the top diagram, you will display individual data points. I have circled this in the attached diagram. You will also need to set the tick markers to display.  You can do this if you set the third column from the left. 
    Hope this helps,
    Andrew McLennan
    Applications Engineer
    National Instruments
    Attachments:
    XYProperties.JPG ‏45 KB

  • 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

  • How do I add a benchmark time to a scatter plot in Numbers

    I am working with a data set that includes a group of people that arrive at a location in a time range. I have these plotted on a scatter chart but I want to show a benchmark line and then how far off we are on that benchmark.
    How d I do this?

    If you want to plot another line on the chart, create two X,Y data points for the line in another set of columns in your table and plot it as a second series.  For example, if your original X data is in column B and Y data in column C, use column D and E for these other two points.  After you have those two points, click on your chart. A blue box will surround the data you have plotted in columns B&C. At the bottom right corner is a little circle. Drag it to the right until the box covers your new data in columns D&E.  The default is X-Y pairs so the box should have an X over columns B and D and a Y over columns C and E. Your chart should show a second series.
    If you want to get sophisticated, you can use formulas to make the data points for the benchmark.  For instance, you could use MIN(B) and MAX(B) to generate the min and max X values so the benchmark line dynamically adjusts to your other X data.

  • Scatter Plot Problem!!

    Hello everyone,
    I am quite new at Labview and I have a question regarding plotting 2d-array in a scatter plot.
    I would like to plot my data as a scatter plot, which I have done with the Waveform graph, and now I would like to find out the area with the highest density in the scatter plot
    and mark the area with a circle...is it possible in Labview to realize this?? I would be very thankful for every tips!
    Thank You
    Best Regards 
    Yun

    Yes it is possible.  You said you are using a waveform graph, wouldn't an XY graph be a better choice?  I don't know the data you are getting so a waveform graph might be the right tool here.
    In either case you'll need to define a length of X that you want to find the denses amount of points.  So say X=1 so then you will find all the points between 0 and 1 and count them, then 0.1 to 1.1 and count them, then 0.2 to 1.2 for the length of X on your graph.  Doing this in a For loop will make it easy, and then your output will be an array of counts for each section.  Find the maximum using the Array Max & Min function.  
    Then you can highlight the graph using property nodes.  You can use a cursor, or annotation, or a custom picture.  The easiest would probably be an Annotation and in the Example finder there is one called "Graph Annotations" that find the minimum, maximum, and average values for a graph and put an overlay on the graph.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Line of best fit in scatter plots

    when making a line of best fit ( in this case a curve of best fit) how do I extend the curve beyond my data so that I can extrapolate information? Can I do this or will I have to do it manually? (print it out and draw it myself)

    If you graph your data you can allow Numbers to plot a best fit AND show the equation it used (which will depend on the type of fit you selected).
    Here I plotted some data where I introduced random noise (so it won't be "perfect") then had Numbers provide the best fit.:
    The bluse graph is the original data.  The Green is a prediction based on the coefficients from Numbers.
    Once you graph the original data click on the graph, and then click a second time on one of the points in the graph to highlight the series:
    Once you have the series highlighted you can use the Chart Inspector to turn on the Trendline.
    I selected Polynomial because (1) It fit best and (2) the equation I used to make my made-up data was actually a polynomial.  Check the "Show Equation" box to see the coefficients.  Now take these coefficients and place then in cells of your table that has the original data (or some other table).
    Now add a new column to your data (I called mine Ypredicated or Yextrapolated):
    Now add a fomula to use the coefficients which will produce a 2nd graph you may extend beyond the data set:
    C2=$E$6*A2*A2+$E$7*A2+$E$8
    select C2 and fill down as needed (make sure the references to the coefficients are absolute... hence the "$" before the cell row and column names in the formula)
    Finally add the extrapolated curve to your graph to see if it fits:
    click on the graph
    1) click the little cog at the top of the X column and select "Share X values"
    <can't include screen shot right now... not sure why>
    2) then expand the graph data set by clicking and holding the little circle at the bottom right of the highlighted area, and drag to the right so the new predicted column is included.
    <can't include screen shot right now... not sure why>

  • How do I get the numbers ipad app to plot a graph of dates against values, where the most recent date is on the right of the graph, but the most recent date is at the top rather than bottom of the rows in the table?

    How do I get the numbers ipad app to plot a graph of dates against values, where the most recent date is on the right of the graph, but the most recent date is at the top rather than bottom of the rows in the table?
    Also how can it be a line graph without plotting a circle at each value?
    Thanks this is very frustrating

    Make a copy of the table and produce your Line chart or Bar chart from the copy. Sort the copy into the order you want to see in your chart.
    Alternately you could use a Scatter Chart...
    Jerry

  • How can I change the plotting options in an xy-graph?

    I am trying to plot an xy-graph, such that the data points are plotted as circles and connected by lines that stay horizontal at the level of the data point and then go up vertically at the next datapoint. In the properties menu for xy-graphs this options is given. However, it is grayed out and I don't know how to activate it. Can anyone give me a clue as to why this is? I put a red rectangle around the options that I am referring to in the attached screenshot... Thank you!
    BTW: I am using LabVIEW 8.0.1
    Attachments:
    screenshot7.JPG ‏43 KB

    smercurio_fc wrote:
    I'm not sure why the Properties dialog does not allow you to select the Interpolation style.
    This is apparently a bug (verified for 8.0 and 8.2.1). It has been fixed in LabVIEW 8.5.1. Time to upgrade.
    (In any case, it is just a UI issue of the properties dialog box).
    One problem is the fact that you have little control over the circle size. You can increase the size by increasing the line width, which gets ugly quickly.
    If you want full control over the circles (color, size, linewidth), use the "plot images" overlay feature as in the attached example (bottom graph).
    Message Edited by altenbach on 06-21-2008 09:47 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    SpecialXYInterpolation.vi ‏28 KB
    SpecialInterpolation.png ‏31 KB

  • Plot offset in contour line plot

    Hello,
    I have a contour line plot like the the following:
    The circle's center is at x = 0 and y = 0.
    Now I'd like to move the plot with 2 offsets: x and y.
    The axis scaling may not change.
    But the plot circle's center should be moved a bit, so that it's for example at x = 0,25 and y = 0,4.
    How can I do that, so that the plot will be recalculated?
    I attached an example VI if you like to play around with it.
    It's based on the VI "Contour Line Plot" in the NI Example Finder.
    The values of the 2D arrays are given (measured). And after measuring these values the offset calculation should start based on these values.
    Regards
    Matthias
    Attachments:
    Contour Line Plot Test.vi ‏23 KB

    Please discard my previous post, I missed that you don't want x/y scale affected...  First  turn off Autoscale on both X & Y (right click no scale, you'll see options, I also turned off Loose fit but not sure if that's needed even though data are fractional) and then add offsets to data just before they enter Contour Line.
    -BTC
    New Controls & Indicators made using vector graphics & animations? Click below for Pebbles UI
    Attachments:
    Contour Line Plot Test2.vi ‏26 KB

  • Select a region in plot

    I may need to select a region in a plot as the attached screenshot.
    When selecting it, a yellow or other color frame may appear. It can be rectangular or circle.
    After the selection, the frame may disappear. And I may get the frame's position parameters.
    May I know how to do it, thanks. 
    Solved!
    Go to Solution.
    Attachments:
    SC.jpg ‏19 KB

    I just threw this together so there are a few kinks to iron out, but I think it should point you in the right direction.  It uses cursors and a background image, pull the handles (cursors) around to make a selection.  If you want the frame to disappear, or to select with just a frame, it is a simple tweak.
    Attachments:
    PlotSelection.vi ‏24 KB

  • Updating a single plot

    Hi,
    I have an XY graph with four plots. Three of these plots are related and the fourth is a circle around them. The circle's diameter is controlled by a control on the front panel. I want the XY graph to update whenever that value is changed, so I have used an event structure. I have not posted my code because this is all part of a much larger program so my vi would potentially make no sense. The problem I am having is that I need to update the circle (an array of points) without changing whatever values are being displayed in the other plots. How do I keep 3/4 of the plots with their current value while changing the 4th plot?
    Any assistance would be appreciated, thank you in advance.
    Jeff
    Using Labview 7 Express

    Thank you for the reply. I dont have a single array that represents the values on the xy chart, There are a number of arrays in different places of the vi that are passed into local variables representing the chart depending on user interaction with the program (I have a large event structure). So it is impossible for me to simply replace one of the arrays while it is passed into the xy chart, although I agree that would normally be the easiest way. Whenever I am changing the value of the chart, I bundle 4 clusters (each is a cluster of two doubles) into a cluster array, which i send into the xy chart. So, I tried to do something where I created a local variable and used it to read the array of clusters currently being displayed on the chart, and then unbundled this into its seperate clusters (I would then replace the relevant cluster). However, for some reason the array of clusters being read from the chart only has a size of 1 (instead of the expected size of 4), so obviously it is impossible for me to replace the relevant subset. I had thought of the possibility where I could create 3 seperate indicators, and each one would represent the current value of each of the elements in the cluster array (except for the element that is going to be replaced (the circle)), but this is a very messy way of doing it, and I believe that there must be a more efficient way of doing this, since it would be impossibly messy if I had any more plots!
    Does anyone know a more efficient way to do this?
    Jeff
    Using Labview 7 Express

Maybe you are looking for