Autoscale XY Graph with 2 plots

I have a graph with 2 different plots on the same Y axis. If I turn off the "visible" property on one of these plots (so I have only one plot visible), the autoscale Y continue to take both plots into account, thus creating a very too large scale for the visible plot. Is there a way to autoscale only one plot while another is hidden but associated with the same scale?

You have several possibilities, for example:
* instead of setting the property to invisible, temporarily replace one graph with empty data. (see attached sample code).
* Don't use autoscale, but use ArrayMinMax on the visible y values, the set the yrange.minimum and yrange.maximum accordingly.
*switch the second plot to a second y scale while invisible and back to scale 1 when visible again.
* any other variation of the above.
LabVIEW Champion . Do more with less code and in less time .
Attachments:
HideXYPlots.vi ‏51 KB

Similar Messages

  • Xy graph with dynamic number of plots

    I've got an XY Graph with some dynamic number of plots to graph. Once I know this number, I change the LegPlots property and plot the data from an array containing all the plots. The data is displayed correctly, but I get overlapping colors. Say I'm only trying to graph 3 plots. I get three lines (good) but then the three lines have 29 colors (bad), as if it's plotting all possible plots at the data points of the three. The legend updates to only show three (good), but am I missing something else? Does the LegPlot property not govern that, but only governs the legend itself?

    If the problem is the code then I'll take a look at my mess of wire, I just wanted to see if it was the LegPlots property first.
    Here's what it looks like, just in case
    Attachments:
    toomanycolors1.JPG ‏25 KB

  • LabVIEW crashes when you run a VI that contains a mixed signal graph with a multi-plot cursor.

    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,
    Darren

    Darren:
    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

  • Problem With Plotting a graph

    Hi,
    I need help plotting a graph.
    The situation is .... I have data of speed against time. Data is like this : a truck runs at some speed until 10 o clock. Now the driver changes time of the speed vs. time tracking device back to 9 o clock. Now if I plot this data it becomes a invalid graph as between 9 - 10 I will be having two values for the speed.
    I thought of a solution that when ever a time change occurs I will drop the speed to 0 and again start plotting the graph with next point on the scale of x axis with the new set time ...... Is this possible ? 
    Please help.
    Thanks and regards
    Anirudh

    Hi,
    Here is a photo of what I want to do with the graph.
    Here as the values that i am mappinng on x axis are repeated the graph is not one to one. Now to make it look like a one to one i want to drop it zero at the first 6. the restart the scale after 6 as 5 and continue mapping. Is this possible ?? ?? 
    Thanks and Regards,
    Anirudh.
    Attachments:
    tr1.JPG ‏113 KB

  • Plot 4 Graphs with only 2 legends

    Hi!
    I have a graph in which I want to put 4 plots of defined color and line width, but in the Legend I want to show only 2 of them.
    I tried to define the plots and scaled the Legend with the mouse to the wanted first 2 plots. Unfortunately this setting isn't saved, when I close and reopen the vi.
    Next try was to define the plots at the start with property nodes. But when I set "Legend: Plots Shown" to 2, it's not possible to setup the third plot.
    Anybody an idea for a solution?
    Thank you in Advance.
       Hendrik alias XS-er
    PS: I'm using LabView 8.0
    Message Edited by XS-er on 05-17-2006 02:39 AM

    Graphs only save settings for the plots they have default data for at the time of saving.  So, if the default data for the graph has four traces, it will save info for four traces.  If it only has one trace, it will save info for one trace.  If you need to save data for plots, a more robust solution is to set the values using property nodes on the graph in the initialization section of your code.  That way you won't lose them.  Note that you cannot set properties on a trace which does not exist.  You will need to preload your graph with the number of traces you are using (I think you can use zero length traces).  If you stop using one of the traces, you can lose the information at run time.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • Stacked Bar Graph with a line plotting count

    Hi everyone
    I am facing a problem with plotting a stacked bar graph with a line or dot for count.
    I have 2 y axes and one x-axes.
    Can anyone help out with suggestions as to how to do this in 9i Reports.
    Thanks
    Neelima

    The graph wizard in Reports 9i allows you to create a dual Y combination graph - is this not sufficient for your needs, or am I missing something?
    Danny

  • Is it possible to make a graph with drag and drop plots and use it as a control?

    I am trying to make a graph with multippel plots to use as a control, the plots should be drag and drop. Is this possible in LV 7.0 or do i have to use c++ or WB?

    I second Doc-Doc comment. I am not sure what you are asking.
    The attached is an example I found on the NI web-site some time ago. I cannot find the link again so here is a ZIP of what I found in a temp folder on my machine.
    Trying to help,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    WF_SketchPad.ZIP ‏67 KB

  • Reeal-time 3D graph with multiple plots

    Hello,
    I realise this is a very complicated question and I would appreciate any healp anyone could give. I am trying to:
    1- draw a 3D graph with three plots (plots are from coordinates read from XL)
    2- do it in real time, so that only one point from each plot shows at a time (the previous points disappear)
    Can anyone help me out? I looked at Sarah's advice and I got as far as the program that I have attached. I have also attached an XL sheet with random values (actually I didn't have any luck attaching two files).
    I would appreciate any response!
    Thank-you,
    Confused
    Attachments:
    3D graph.vi ‏127 KB

    IBAHKA wrote:
    Could you look at this new and improved (yet not perfect program) and help me out?
    Issues:
    Why do the axis all change and why aren't the points drawn all at once? ALso, is it possible to retain in memory and plot more than one point from each plot at once?
    The axis are changing because you didn't ask for constant scales. Just right-click on the 3D graph indicator and go to CWGraph3D/Properties... There a pop-up window will give you access to a number of settings. Explore. You will find how to allow the user to pan/zoom/rotate the graph, and to disable autoscaling...
    The points are not drawn all at once because you pass them one at a time!!! To plot several points at once, you have to build an array with the proper number of points (initialise first) then you can rotate the array after plotting, and replace the first point at the next iteration.
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • Plot excel data onto X-Y graph with time stamp

    Dear all, I have the same set of data but it is saved in excel format instead of text file now. However i think the column data are separated by tab, i have tried to write some codes but it dont seem to plot out the graph properly. I have no problem ploting out data in text file but not this excel file. Can anyone help out to plot this graph with timestamp?
    Attachments:
    test4.txt ‏1 KB

    I still don't understand your comment 'I have no problem ploting out data in text file'. The Read From Spreadsheet by default uses a tab separator so you should have no problem reading the file. Post the code you have already written so someone can see where your problem is.

  • I would like to know how i can create a bell graph with out using sub VIs, the data that i created consists in 500 readings with values of 0 to 100, i calculated the mean value and standard diviation. I hope some one can help me

    I would like to know how i can create a bell graph with out using sub VIs, the data that i created consists in 500 readings with values of 0 to 100, i calculated the mean value and standard diviation. I hope some one can help me

    Here's a quick example I threw together that generates a sort-of-bell-curve shaped data distribution, then performs the binning and plotting.
    -Kevin P.
    Message Edited by Kevin Price on 12-01-2006 02:42 PM
    Attachments:
    Binning example.vi ‏51 KB
    Binning example.png ‏12 KB

  • XY Graph with two Y inputs

    I need to know how to graph a XY graph with two values of Y. I need to it to compare to different angles and I also would like to make them graph different colors. Currently i have an XY graph with one Y input using the XY Graph express VI. I found out how to set up for two simultaneous plots by editing the properties for the graph but I don't know how I can input another Y value to plot using the XY Graph express VI.
    Thank You,
    Phil

    I never use the express functons but I think what will work is to use the merge signal function. Try merging the two x inputs together and merging the two y inputs together. I made a modification to the shipping example called Lissajous.vi  to try a quick test.
    Attachments:
    lissajous_mod.JPG ‏54 KB

  • 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.

  • Exporting from a 2D line graph with .jpeg extension

    Is there any way to export from an ordinary 2D line graph with .jpeg extension so that with using this image i will improve my result of exporting excel.
    e.g. i have found and example and added a button as you will see when you run this code.I will click this button and it will export this line graph with extension .jpeg so that i will see it as an ordinary image at my home directory.
    Thanks for any helpful comment
    Regars,
    Serhat
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    * @author led1433
    import java.awt.*;
    import java.awt.font.*;
    import java.awt.geom.*;
    import javax.swing.*;
    public class LineGraph
        public static void main(String[] args)
            int x1 = 1000,y1 = 0;
            JFrame f = new JFrame();
            JButton exportToJPegButton = new JButton("EXPORT WITH JPEG");
            exportToJPegButton.setToolTipText("Exports Graph with extension *jpeg");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            exportToJPegButton.setSize(200,25);
            f.add(exportToJPegButton).setLocation(x1, y1);
            f.getContentPane().add(new GraphPanel());
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    class GraphPanel extends JPanel
        final int
            HPAD = 60,
            VPAD = 40;
        int[] data;
        Font font;
        public GraphPanel()
            data = new int[] {
                120, 190, 211, 75, 30, 290, 182, 65, 85, 120, 100, 101
            font = new Font("lucida sans regular", Font.PLAIN, 16);
            setBackground(Color.white);
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setFont(font);
            FontRenderContext frc = g2.getFontRenderContext();
            int w = getWidth();
            int h = getHeight();
            // scales
            float xInc = (w - HPAD - VPAD) / 11f;
            float yInc = (h - 2*VPAD) / 10f;
            int[] dataVals = getDataVals();
            float yScale = dataVals[2] / 10f;
            // ordinate
            g2.draw(new Line2D.Double(HPAD, VPAD, HPAD, h - VPAD));
            // tic marks
            float x1 = HPAD, y1 = VPAD, x2 = HPAD - 3, y2;
            for(int j = 0; j < 10; j++)
                g2.draw(new Line2D.Double(x1, y1, x2, y1));
                y1 += yInc;
            // labels
            String text; LineMetrics lm;
            float xs, ys, textWidth, height;
            for(int j = 0; j <= 10; j++)
                text = String.valueOf(dataVals[1] - (int)(j * yScale));
                textWidth = (float)font.getStringBounds(text, frc).getWidth();
                lm = font.getLineMetrics(text, frc);
                height = lm.getAscent();
                xs = HPAD - textWidth - 7;
                ys = VPAD + (j * yInc) + height/2;
                g2.drawString(text, xs, ys);
            // abcissa
            g2.draw(new Line2D.Double(HPAD, h - VPAD, w - VPAD, h - VPAD));
            // tic marks
            x1 = HPAD; y1 = h - VPAD; y2 = y1 + 3;
            for(int j = 0; j < 12; j++)
                g2.draw(new Line2D.Double(x1, y1, x1, y2));
                x1 += xInc;
            // labels
            ys = h - VPAD;
            for(int j = 0; j < 12; j++)
                text = String.valueOf(j + 1);
                textWidth = (float)font.getStringBounds(text, frc).getWidth();
                lm = font.getLineMetrics(text, frc);
                height = lm.getHeight();
                xs = HPAD + j * xInc - textWidth/2;
                g2.drawString(text, xs, ys + height);
            // plot data
            x1 = HPAD;
            yScale = (float)(h - 2*VPAD) / dataVals[2];
            for(int j = 0; j < data.length; j++)
                y1 = VPAD + (h - 2*VPAD) - (data[j] - dataVals[0]) * yScale;
                if(j > 0)
                    g2.draw(new Line2D.Double(x1, y1, x2, y2));
                x2 = x1;
                y2 = y1;
                x1 += xInc;
        private int[] getDataVals()
            int max = Integer.MIN_VALUE;
            int min = Integer.MAX_VALUE;
            for(int j = 0; j < data.length; j++)
                if(data[j] < min)
                    min = data[j];
                if(data[j] > max)
                    max = data[j];
            int span = max - min;
            return new int[] { min, max, span };
    }

    GraphPanel stays the same.
    public class JpegExport {
        public static void main(String[] args) {
            final GraphPanel graphPanel = new GraphPanel();
            JButton exportToJPegButton = new JButton("EXPORT WITH JPEG");
            exportToJPegButton.setToolTipText("Exports Graph with extension *jpeg");
            exportToJPegButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    exportToJpeg(graphPanel);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(exportToJPegButton, BorderLayout.NORTH);
            f.getContentPane().add(graphPanel, BorderLayout.CENTER);
            f.setSize(400, 400);
            f.setLocationRelativeTo(null);
            f.setVisible(true);
        private static void exportToJpeg(GraphPanel graphPanel) {
            try {
                int w = graphPanel.getWidth();
                int h = graphPanel.getHeight();
                BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
                Graphics2D g2 = image.createGraphics();
                graphPanel.paint(g2);
                g2.dispose();
                ImageIO.write(image, "jpeg", new File("export.jpg"));
            } catch (IOException e) {
                e.printStackTrace();
    }

  • Looking up the values in a waveform graph with a mouse click

    Hi,
    Does anyone know how to look up the values in a waveform graph with a mouse
    click but... without the cursor legend on, if i press in the waveform graph
    nothing happens, i must search my cursors and only then i can see the values
    of my signal data?! Isn't there any other way?
    Best regards,
    Thijs Boerée

    Dear Chad,
    I know of the function "bring cursor to center". I also figured out that
    when i use a property node of the cursor array of clusters, that i can see
    that some values change when i move the cursor (i can see the X and Y scale
    value change of the graph and also the values of the mouse pointer (in
    points due to screen resolution)) But in this cluster i can't set the mouse
    position. I allready made a VI where i can see the bounds of my
    waveformgraph and I have the Xscale (min and max) and the Yscale (min and
    max), with a linear fit i can translate my mouse position to X an Y scale
    values and when i click on my waveform graph the cursor go's to that
    position (property node of the cursor position), only disadvantage is that i
    only have the bounds of my plot area and not the position, i do have the
    position of my waveform graph but the plot area isn't allways in the center,
    if i could extract the position of the plot area i may find a solution to
    solve this problem.
    And to file a product question:
    I would like to see the function that with a mouse click a little menu
    appears and that there are options to for example set a marker on that data
    and when you right click on it, that there are options to remove it or to
    add comment, a 2D array could make a list of the different channels with
    it's markers (time stamps and comments).
    Best regards,
    And thank you for your help.
    Thijs Boer�e
    "Chad AE" schreef in bericht
    news:[email protected]...
    > Dear Thijs,
    >
    > Thank you for contacting National Instruments.
    >
    > To address your question, there is no direct VI, command, or property
    > node that will allow the cursor snap-to-mouse functionality.
    >
    > I notice a problem you may be occuring is trying to find where the
    > cursor is on the graph. If this is an issue, you can select Bring to
    > Center from the Formatting Ring on the Cursor Legend to move the
    > cursor to the center of the graph.
    >
    > Let me know if you have any further questions or if this does not
    > resolve your issue, as I would be happy to file a product suggestion
    > so that LabVIEW is improved in future versions.
    >
    > Thanks again and have a great day!
    >
    > Chad AE
    > Applications Engineer - National Instruments

  • Combine a Bar Graph with a Line Graph!

    Is it possible to combine a Bar Graph with a Line Graph because occasionally we wish to use both bars and lines on the same plot.
    If yes, could you please give us a sample rtf file?
    Thanks,
    -Ritu

    Hi Tim,
    To be more clear, I need to superimpose the two graphs.
    For example,the first one shows the budget for each month along with the actual expenditures as a bar graph. The other shows the cumulative budget, forecast and costs for the entire project as a series of lines. The first graph uses the scale on the left side of the graph and the second graph uses the scale on the right side.
    Thanks,
    -Ritu

Maybe you are looking for

  • Apply Style or Favorites options in Live Type?

    Hello, just trying to figure out live type, and I have a question. I am using it to create info graphics on a dvd presentation, and I am wondering: Do I have to manually format each different line of text, or is there a way that I can save a set of f

  • ITunes opening by itself

    As the title says, iTunes keeps opening itself at random times, and it's getting really annoying, is there a way to set iTunes not to open unless I want to open it?

  • Sophie's Choice - Bad Stills or Bad Video

    I created several projects in FCE 4.01 that I would like to burn to DVD (using iDVD). The projects consist of standard DV footage from my old Sony camcorder - mixed with .jpg files that I imported from a still camera. If I export the project from FCE

  • Unable to Register a Site

    I'm trying to register a site but I keep getting the error message: ... a test file could not be copied in the host directory... I'm using the same settings as in DW. It says the username and password are correct. I can upload files from DW. What cou

  • I can't open Bridge and Mini Bridge from Photoshop CS6 (64bit)

    I can't open Bridge CS6 64(Bit) and Mini Bridge from Photoshop CS6 (64bit), I get an error message (APPCRASH ). I can open only Bridge (32bit) as a stand alone program. Operating system Windows 7 (64bit).