Map mouse coordinate​s to XY graph coordinate​s (SI units on Graph)

Hi Folks:
I have used this invoke node method for quite awhile.  Now trying to use it on XY graph where SI units are used on X-axis.  Now I always get 0 for the X graph coordinate. Run the attached and you will see this. Anyway I can get this to work properly as I need to have the SI units.
Thanks,
Don
Attachments:
test - map panel coordinates (SI units).vi ‏30 KB

See the coercion dots? Your xy cluster indicator is in the wrong representation (both values are I32, suitable for pixel coordinates, but inadequate for your scales).
Delete the xy indicator and right-click on the property node xy output and select "create indicator". Now all's well.
(Or you could just change both indicators inside the cluster to DBL representation)
Message Edited by altenbach on 08-02-2007 09:05 AM
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • How can I transform a 3D world coordinate to a 2D device coordinate?

    I have been working with Java 3D for a few months and I can create a scene graph and display it. Now, I want to transform a 3D world coordinate to a 2D device coordinate. I don't want to draw the 3D point in the scene, I just want to know what the 2D coordinates would be. Does anyone know what sequence of transformations must be made to do this?

    Thank you for your reply. I used your code and it solved most of my problems. However, I can't get it to apply a perspective projection to the point in question.
    I took the following line of code from your response above.
    view.getCanvas(0).getPixelLocationFromImagePlate(somePointInNode, awtPoint);From your code, and the javadoc that I've read, it appears that it should perform a perspective projection, but in my case it doesn't.
    I have included output from my program below. I wrote a program that displays the x, y, and z axes on a Canvas3D. The viewpoint is looking down the z-axis with the positive x-axis pointing to the right and the positive y-axis pointing up. I then used your code to compute 2D points at the origin and along each of the three axes (calls 1-4 in my output). On the Canvas3D, the origin and the point along the positive z-axis are at two distinct locations, as one would expect of a perspective projection. However, when I compute the 2D location using your code, the 2D points are identical, as one would expect of a parallel projection. My view's projection policy is PERSPECTIVE_PROJECTION, but as my output below shows, the transformation from somePointInNode to awtPoint in calls 1 and 4 appears to be created as if it is a parallel projection. It is as if the z component is ignored. Why? Am I doing something wrong?
    My output:
    projection policy = perspective projection
    call 1:
    somePointInNode
    origin: x=0.12699998915195465 y=0.15931445360183716 z=0.0
    awtPoint
    x=445.999961562044 y=435.4999675525455
    call 2:
    somePointInNode
    x-axis: x=0.2528710961341858 y=0.15931445360183716 z=0.0
    awtPoint
    x=891.9999469321543 y=435.4999675525455
    call 3:
    somePointInNode
    y-axis: x=0.12699998915195465 y=0.2851855605840683 z=0.0
    awtPoint
    x=445.999961562044 y=-10.500017817564867
    call 4:
    somePointInNode
    z-axis: x=0.12699998915195465 y=0.15931445360183716 z=0.12587110698223114
    awtPoint
    x=445.999961562044 y=435.4999675525455

  • Importing Graph Class/help implement a weighted graph class

    Is there a way to import a graph structure into my java program so that I do not need to write my own graph class?
    If not, does anyone have a graph class that I can use? I've been trying to implement this program for the past few days..
    I'm having trouble implementing a weighted graph class. This is what I have so far:
    import java.util.ArrayList;
    import java.util.Queue;
    import java.util.*;
    public class Graph<T>
         private ArrayList<Vertex> vertices;
         int size = -1;
         public Graph() throws BadInputException
              ReadFile source = new ReadFile("inputgraph.txt");
              size = source.getNumberOfWebpages();
              System.out.println(size);
              vertices = new ArrayList<Vertex>();
         public int bfs(int start, int end) //breadth first search
              Queue<Integer> queue = new LinkedList<Integer>();
              if(start == -1 || end == -1)
                   return -1;
              if(start == end)
                   return 0;
              int[] d = new int[size];
              System.out.println(size + "vertices size");
              for(int i = 0; i < d.length; i++)
                   d[i] = -1;
              System.out.println(start + " START GRAPH");
              d[start] = 0;
              queue.add(start);
              while(!queue.isEmpty())
                   int r = queue.remove();
                   if(r == end)
                        return d[r];
                   for(EdgeNode ptr = vertices.get(r).head; ptr != null; ptr = ptr.next)
                        int neighbor = ptr.dest;
                        if(d[neighbor] == -1)
                             queue.add(neighbor);
                             d[neighbor] = d[r] + 1;
                             if(neighbor == end)
                                  return d[neighbor];
              return d[end];
         public boolean addEdge(int start, int end)
              Vertex v = new Vertex();
              v = vertices.get(start);
              EdgeNode temp = v.head;
              EdgeNode newnode = new EdgeNode(end, temp);
              v.head = newnode;
              return true;
         public void setRank(int vertex, double rank) //set the weights
              vertices.get(vertex).pageRank = rank;
         public double getRank(int vertex)
              return vertices.get(vertex).pageRank;
    If anyone could help. It would be greatly appreciated
    Edited by: brones on May 3, 2008 12:33 PM

    brones wrote:
    along with the rest of my code, I'm not sure how to implement it as a weighted graphA single list is not the proper way of representing a graph. An easy way to implement a graph is to "map" keys, the source-vertex, to values, which is a collection of edges that run from your source-vertex to your destination-vertex. Here's a little demo:
    import java.util.*;
    public class TestGraph {
        public static void main(String[] args) {
            WeightedGraph<String, Integer> graph = new WeightedGraph<String, Integer>();
            graph.add("New York", "Washington", 230);
            graph.add("New York", "Boston", 215);
            graph.add("Washington", "Pittsburgh", 250);
            graph.add("Pittsburgh", "Washington", 250);
            graph.add("Pittsburgh", "New York", 370);
            graph.add("New York", "Pittsburgh", 370);
            System.out.println("New York's edges:\n"+graph.getEdgesFrom("New York"));
            System.out.println("\nThe entire graph:\n"+graph);
    class WeightedGraph<V extends Comparable<V>, W extends Number> {
        private Map<V, List<Edge<V, W>>> adjacencyMap;
        public WeightedGraph() {
            adjacencyMap = new TreeMap<V, List<Edge<V, W>>>();
        public void add(V from, V to, W weight) {
            ensureExistenceOf(from);
            ensureExistenceOf(to);
            getEdgesFrom(from).add(new Edge<V, W>(to, weight));
        private void ensureExistenceOf(V vertex) {
            if(!adjacencyMap.containsKey(vertex)) {
                adjacencyMap.put(vertex, new ArrayList<Edge<V, W>>());
        public List<Edge<V, W>> getEdgesFrom(V from) {
            return adjacencyMap.get(from);
        // other methods
        public String toString() {
            if(adjacencyMap.isEmpty()) return "<empty graph>";
            StringBuilder b = new StringBuilder();
            for(V vertex: adjacencyMap.keySet()) {
                b.append(vertex+" -> "+getEdgesFrom(vertex)+"\n");
            return b.toString();
    class Edge<V, W extends Number> {
        private V toVertex;
        private W weight;
        public Edge(V toVertex, W weight) {
            this.toVertex = toVertex;
            this.weight = weight;
        // other methods
        public String toString() {
            return "{"+weight+" : "+toVertex+"}";
    }Note that I didn't comment it, so you will need to study it a bit before you can use it. If you have further question, feel free to ask them. However, if I feel that you did not take the time to study this example, I won't feel compelled to assist you any further (sorry to be so blunt).
    Good luck.

  • Annotation​'s "D1","D2",​... to be added to graph when points are added to graph....

    hi ...
    Good morning...
    Text labels "p1","p2" , & so on ... should be named for points added to the graph for plot 1 only not all plots...  .
    As in the graph when a particular point is ploted we can right click on graph & add annotation ... to mark tht point ...
    but if we dont want user to do it manually.. & as the points will be  ploted in graph tht  points should be labeled  p1,p2,.respectively..... then how to go about it ...
    I tried checking in property node .. annotation list is thr ... but all i want is just the point name to b changed for each point not other properties...
    I am Using LABview 8.0
    Waiting in anticipation ...
    Regards
    Yogan

    Hi yogan,
    In order to do this you can read the AnntList property which will output an array of clusters. You can then modify just the Name value in a cluster and write it back to the AnntList property.  There is an example that ships with LabVIEW that demonstrates programmatically editing annotations.  You can find this in LabVIEW by going to the Help menu, and clicking on Find Examples.  Then browse to Fundamentals >> Graphs and Charts >> Programmatically Annotate a Graph.vi.  Specifically, pay attention to the "Avg" Value Change event in the Event Structure.  This shows how to modify the name of an annotation.
    I hope this helps!
    Brian A.
    National Instruments
    Applications Engineer

  • Problem: mapping mouse co-ordinates to a list of nodes in a graph.

    Hi.
    I have an undirected graph containing many nodes, some represent squares/tiles and some represent rooms in a board-game called Cluedo.
    Each node has an ID: -
    Rooms are called by the room name. -> Kitchen/Lounge
    Squares are called by the concatenated x/y position. -> A1/A2/K20
    I have created an algorithm to find the shortest path between two nodes in the graph.
    The problem I'm faced with is finding a way to map co-ordinates on the image file to these IDs. I have seen an implementation of a similar idea with an invisible image acting as a "colour-mask", so when the click hits the graphical map a function works out the colour of that pixel on the "colour-mask" and then uses a look-up table to find out which ID that is associated to.
    The problem with the above is that a Cluedo board has about 22x22 tiles and several rooms (each room would occupy several tiles in an undefined shape.)
    I've provided two example map files:
    http://www.dcs.qmul.ac.uk/~ade1/map.gif
    http://www.dcs.qmul.ac.uk/~ade1/map2.gif
    Does anyone have a suggestion of how I could solve this problem using what's available to me with Java?
    I'd appreciate any suggestions,
    Alexander Ellis

    Create a two-dimensional array that maps from grid coordinates to node/room objects.
    NodeOrRoom[][] grid = new NodeOrRoom[22][22];
    grid[0][0] = kitchen;
    grid[1][0] = kitchen;
    nodeLookup(int pixelTop, int pixelLeft) {
      return grid[pixelTop / gridCellHeight][pixelLeft / gridCellWidth];
    }Matthew

  • Coordinate system translation from screen coordinates to stage coordinates

    I realize this is not truly a LabVIEW question, but I'm hoping for suggestions.
    I have a digitized image of a sample on a 3 axis stage. The user selects "paths" for a drill to take along the surface of the sample. On the image, 3 reference points are identified. The stage posititions (x, y, and z) corresponding to these points are then identified.
    I need to now convert the coordinates of the paths to the stage coordinate system. Are there any LabVIEW vi's that are suited to this need? I have IMAQ vi's but not very experience with these yet. Suggestions much appreciated
    Tim

    Hello Shan:
    Were almost have the same problem but mine is for a AOI handler with a robot arm which I need to pick (x,y) pairs along the work envelope. Anyway, for the most math part it will involve are coordinate transformation from a "mouse coordinates" to "real world coordinates" and your image processing textbook (I use McGrawHill Computer Graphics by Hill) will outline both the code and the math but LabVIEW will not have a facility to do with an actual VI instead you have to use the array manipulations and treat them coordinates as matrix elements. There is a Math VI and G-Math VI or a MatLAB call you can use for coordinate matrix manipulations as long as you have the math quite figured out in paper already.
    Bernardino Jerez Buenaobra
    Senior Test and Systems Development Engineer
    Test and Systems Development Group
    Integrated Microelectronics Inc.- Philippines
    Telephone:+632772-4941-43
    Fax/Data: +632772-4944
    URL: http://www.imiphil.com/our_location.html
    email: [email protected]

  • After Effects coordinate system vs. Maya coordinate system

    Does anyone have any insight on the math behind the two different cooridinate systems and how the work? I can import a Maya camera with nulls (well actually solids which function as nulls) and parent object to them and everything works fine, but if I copy and paste position/anchor data, everything goes haywire. Also, with effects like particular, I can parent the emitter to the nulls imported from Maya and everything works fine, even if I animate the null, but effects like particles bouncing off the floor, etc., don't work, and I imagine that it has something to do with different world spaces. If anyone has any insight or references, it would be much appreciated. thanks!

    1) I have baked the camera in Maya, and everything lines up nicely, as long as I parent the position of 3d layers in After Effects to one of the nulls that I imported from Maya. If I copy the position and/or anchor data from one of the nulls to a 3d object, it doesn't work. For example, the center of Maya's world is 0,0,0 as postion. the null I imported at 0,0,0 shows the position in After Effects as 0,0,0, but if I copy that position directly to an After Effects 3d layer, it doesn't line up. If I use an expression to tie the postion of the After effects Layer to the Postion of the null from at 0,0,0 it works out. I figured it was that two programs calculate cooridnates differently. For example, isn't AE Y switched +/- from most other programs? and new objects created at the center of AE's 3d world usually come in with positive values on the x,y axis' and only the z at 0. Correct me if I'm wrong.
    2) I did create a floor layer in AE, I know that AE layers won't interact with Maya layers. I've set the bounce up a million times, and it didn't work right with the camera I exported from Maya. I tied the emitter postion in Particular to the position of a null I created in Maya, shows up in the right spot, looks great. I created a 3d solid and tied it's postition to the 0,0,0 null I exported from Maya. It looks like it is in the right spot and travels with the camera correctly, but the particles don't bounce (yes the blue postion arrow is up). I thought maybe it had something to do with my 1st question, i.e. tieing the postion of the floor layer to the null with Maya's 0,0,0 position isn't actually bellow the emitter in AE. or something...
    Does that make more sense what i am asking? I'm just trying to see the limits/differences in how the two programs interact.

  • ALV Graphs: How to set line type graph as default graph

    Hi All,
    I need to develop a line graph. The fields on the X-axis will change dynamically. Some times they may be 10 field and some times they may be more than 100 fields. I tried with Function Module GFW_PRES_SHOW_MULT. But I can only display maximum 32 fields. Can anyone tell me exact program which helps me to full fill my requirement. It will be a great help if you could told how do display line type graph as default graph in ALV.  In REUSE_ALV_GRID_DISPLAY there is a Exporting parameter MT_CHART_TYPES but this help you only to enter description for X-axis and Y-axis.
    Many thanks in advance.

    I would call GRAPH_MATRIX_2D with options depending on representation you wish
    look at the program GRBUSG_1 to see how to use it
    there you have some options to display bar chart, but you could use other values (complete list of options is available in documentation of function module GRAPH_MATRIX_2D - click on parameter OPTS in help display to see full explanation)
    exemple:
    P2TYPE = LN to display lines

  • Loose graph axis with cursor in 3d graph

    I added a cursor to a 3d contour plot, which gives location and z value.  have displayed as xy projection.  when I am moving the cursor, I loose the x and y axis, and the contours become dots.  
    kind of annoying.  any properties I can change? 

    Hello Ennis,
    I don't know if there is a property that can accomplish what you want.  I have been playing around with the 3D graphs for quite awhile.  I'll keep looking and let you know if I find anything out.
    Regards,
    Jon S.
    National Instruments
    LabVIEW R&D

  • Show 2 line graphs together in Line bar combo graph

    Hi,
    I am currently working on to show data for 2 years (which will be selected through prompt), month on month basis in Line-Bar Combo Graph.
    I could achieve to show 2 years of data month on month basis in Bar Diagram, but the same is not happening for Line diagram.
    In Line Diagram, values for 2 years are joined and shown as a single line, where as I want to see 2 separate lines for the years selected.
    Kindly have a look at the link below:
    !http://i42.tinypic.com/cuek8.jpg!
    Any suggestions?
    Regards,
    Jitendra

    Hi,
    I am putting up the snapshot of what I have done,
    !http://i42.tinypic.com/2j8jkx.jpg!
    As you can see in the image, I have
    1. Utilization Rate &
    2. Attendance Booking
    as my fact.
    I can arrange the Attendance booking (Bar Diagram), as Month-on-Month basis for any 2 years.
    My aim is to plot Utilization Rate, in the Line Diagram. Currently it's been shown as One Single Line, I want to see 2 different line for the 2 years selected.
    Kindly help.
    Regards,
    Jitendra

  • Graph connectivity problem-adjacency list-connected graph-Theta complexity

    I am stuck up on this problem:
    I want to find an algorithm of Theta(n+m) complexity, which will examine
    if a non-directed graph is connected (synectic).
    We assume that the representation of the graph has been made with an
    adjacency list with n vertices and m edges.
    Thanks in advance.

    A BFS or DFS from any node in your graph should be T(n+m) in case of an adjacency list (instead of a adjacency matrix). When the search is finished, compare the number of visited nodes to the total number of nodes in the graph. If they're not equal, the graph is not connected.

  • Exporting Graphs to PDF file renders no graphs

    Hi I am trying to export a table and a graph from a dashboard to a PDF however, when I export the Dashboard page only the table will show up and I lose the graph. I am running IE9 and my OBIEE version is 11.1.1.6.8. Is this a bug or am i doing something incorrectly?

    Unfortunalty I work for an organization that only supports the IE9 internet explorer. Would like to know if this is bug that will be patched for IE9 or is there any known workarounds.

  • How to plot waterfall graph in vb6.Attach​ed sample graph for your reference.

    Thanks John for your answer. Attached file the sample graph what i really want to plot it.Any body can help me.Thanks.
    Attachments:
    waterfall.gif ‏81 KB

    Hello asrol,
    Please try to post replies under the same thread so that it is easier for everyone to keep track of your issue. Thanks!
    Original thread: How to plot waterfall graph in vb6 from offline data
    John B.
    Applications Engineer
    National Instruments

  • Does the new Map app under iOS6 not offer driving directions in the United Arab Emirates?

    When I want the app to give me driving directions between two locations in Dubai, the app displays "Directions Not Avaiulable".
    I sued the Google Maps app a lot under iOS5 for driving directions. Now I am literally often lost ....

    Hi,
    You are here on a user-to-user message board and not in contact with apple representatives. If you have complains to do I suggest you do so through the feedback tool on apple.com
    Regards

  • Graphe XY : représentation de plusieurs graphes selon choix de l'utilisateur / put severals graph with user selection

    Bonjour,
    Je dispose d'un cluster contenant 11 tableaux de données et je souhaite les afficher sur un graphe XY, selon un choix de l'utilisateur. Afficher que certain graphe, tous, aucun. Je pars dans l'idée de faire tous les cas et d'en suite sélectionner le choix correspondant et j'aimerais savoir s'il existe un choix plus judicieux ?
    Cordialement,
    Jérôme LIBBRECHT
    Dear,
    I have a cluster with 11 DataTable and I want to put them to a graph XY only if the user choose them. I think I'll do whole cases but I want to know if there is a better solution.
    Best regards,
    Jérôme LIBBRECHT
    Jérôme LIBBRECHT

Maybe you are looking for