Axis scale for scatter plots

I'm trying to create a specialized scatter plot, which functions similar to Excel's scatter plot. I'm having problems determining what the min and max values should be for the axes. I would like the program to determine from the input data what the initial min and max values should be on the x- and y-axis, the user can adjust later.
So, I don't want the program to just look at the maximum value imported and round up. For instance, data = {523.7, 514.4, 271.8, 128.5}. The max value is 523.7, round up to 524. Instead, I would like to program to make 600 the largest value on the axis, because that makes it nice round number for the user to view the dataset.
Then, I thought it really depends on the range of the data. For instance, data = {523.4, 523.8, 523.2, 522.8, 523.9}. Here, the range is very small, so it doesn't make sense to have 600 the largest value on the scale. The largest value should be 524 or 525, and the small value on the axis scale should be 521 or 522.
Has anyone else ever worked with this problem, or have a good solution? I would really appreciate it, I've spend way too many days working on this.
Thank you,
Joe

This is off the top of my head and based on a slight variation of your data.
data: 52.34, 52.38, 52.32, 52.28, 52.39
min=52.28 max=52.39 range=0.11
Looking at the range we see it is "on the order of" 0.1. Ie, it is closer to the next lower power of 10 (0.1) than it is to the next higher one (1.0). So we round min down to the next lowest multiple of 0.1 (52.2) and round max up (52.4). 52.2 and 52.4 can serve as the nice numbers.
The range is just a little bigger than a power of 10, so it might be a good idea to check what happens when it's a little less.
data: 135 226 141 143 etc
min=135 max=226 range=91
range is on the order of 100, and the nice numbers are 100 and 300.
As a variation on this strategy if we always find the power of 10 below the range (10 in the second example) we get a tighter fit but the numbers are slightly less nice - 130 and 220.
(I'm pretty sure I've seen - and used! - some java software from the Internet somewhere to find the best scale for axes, so it might pay to look around)
Had to edit my second example and, while I was waiting, found what I have used for this sort of thing: http://geosoft.no/software/index.html (The NiceNumbers class - it finds numbers along a range suitable for major and minor "ticks" but, if memory serves me correctly it extends the range so that the ends are nice too.)

Similar Messages

  • Polynomial fitting for scatter plot

    Hi all, 
    I was wondering if there is any way to generate a polynomial fit to a scatter plot just like in excel. The data I am trying to fit has several y values for each x value. 
    Thanks
    Krish
    Solved!
    Go to Solution.

    Well, my "solution" above is a bit misleading, because the polynomial fit of course does NOT depend on the x ordering. If the x-values are scranbled as in your case, a maybe better solution would be to simply create a linear x-ramp over the data range and use polynomial evaluation to calculate a smooth best fit line. This has also the advantage tha a smooth curve is generated even if the data points are sometimes far apart.
    Here is one possible modification to show the technique.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Scatterplot_fitting_MODCA2.vi ‏13 KB

  • How to change the Y-axis scale for 100% stacked column to percentage ?

    Hi,
    I add a 100% stacked column chart to a report in Crystal Report for Enterprise. As default, the Y-axis scale shows value from 0 to 1 and the data labels display absoluted data value. Now I want the Y-axis scale to show value from 0% to 100% and the data labels to display percentage value.
    Please tell me which option of the chart to adjust ?
    Thanks
    Mau Vu Huu
    The default is like screenshot below:
    I want it to display as screenshot below:
    thanks
    Mau Vu Huu

    Looks like a bug in CR for Enterprise.
    The same chart shows a scale from 0% to 100% in the CR 2011 designer whereas CR for Enterprise seems to show a number range from 0 to 1.
    Here's a workaround:
    1) Insert a Crosstab. 'Column' should be the field you wish to show on the 'X-axis'. 'Row' should be the field that you wish to stack up on the bars. Summary should be the measure field
    2) Next, right-click one of the summary cells on the Crosstab > Select Format Total > Total > Check 'Show as Percentage of' > Grand Total > Row
    3) Right-click the Crosstab > Select Create Chart from Crosstab Data
    4) Suppress the section that holds the Crosstab
    5) Right-click the chart > Edit Chart Type > Choose 'Stacked Column'
    6) Highlight one of the numbers of the Y-axis > Select Format Total (Y) axis > Format > Currency > Choose 'Fixed' under 'Symbol Format' > Replace '$' under Symbol to '%' > Change Symbol Position to '-123$'.
    -Abhilash

  • 2 x axis scale parallely intensity plot

    hi everybody ,
                          i need to plot a intensity graph which contains 2 x -axis. upper one and lower one it is possible.
    Indrajit
    | [email protected] | [email protected] .

    hi kelvin
                    thanks for your information . but is not working, can you do one thing you just send me a vi which is having a intensity graph with 2 x axis...................otherwise send me the image how i want to do it.plz
    waiting for ur reply
    Indrajit
    | [email protected] | [email protected] .

  • Different positions of time steps on Time scale for multiple plots of same signals

    Hi,
       I am facing a strange behavior of graphs of time-domain signals in "Data View". I am using DSA devices to acquire signals. I am plotting three analog voltage inputs (attached to Ch0, Ch1 and Ch2 of same DSA device). The vertical scales of these three signals should be same and follow the maximum signal level. So I plot these three signals on one "Display" in "Data View" and duplicate three such displays. For first "Display1" I change interpolation such that only first signal (Ch0) is visible. On the second "Display 2" I change interpolation such that only 2nd signal(Ch1) is visible. Similarly third signal(Ch2) is displayed on third "Display 3". Now for these three displays, the time scale is not the same. The starting point is 0 and is aligned among these three displays. The end points of time axes are different. For example these are 989.966m, 990.391m and 1.00034 for 102400 points acquired at sampling rate of 102400  Samples / second. Similarly the major grid lines are also not aligned among these three graphs when we move towards end of time scale.
        I have tried changing "Time Stamp Type" to "Relative to Ch0" for all three displays but this problem remains same. I tried my best to work around it but could not succeed. I tried to save the signals and then plot after reloading while taking same time information from column 1. This solved the problem of time axes but now auto-scale stops working on vertical scales whenever signal amplitudes goes down (The scale does not follow decreasing amplitude of signal but remains fixed).
       Can anyone help me in this matter? I shall be very thankful for an earlier response.

    Hi Vivek
       I need to align time values in all the displays (in Data view). The time values should already be aligned since I am using DSA PCI-4474 which is a simultaneous sampling digitizer.
        I explored it in detail. If I add displays in Data Views while there is no data acquired and save the project then it works fine. However if I save the project after acquiring data and doing some zoon In/ zoom out etc. then I face this problem. Please let me know if there is a way to avoid it.
    Moreover I need a confirmation from you on my following application development:
    I have a simple application of showing 12 analog signals on 12 different graphs placed vertically in aligned position. I have to develop a user interface so that if user wants to display signal no. 1, 4 and 6 out of total 12 signals, he should make selection using check boxes and click a re-draw button. It should result in these three signals displayed as separate graphs aligned vertically and adjusted to fit window size of Data View. Similarly later user can change his selection of displaying signals (from same acquired data) say 1, 3, 5, 6, 8, 9, 11 & 12 and click Redraw button. It should result in clearing of Data view (or opening a new Data View tab i.e Data View 1) showing all these signals as separate graphs which are aligned vertically and resized to fit the window.
    Can I achieve this user interface design using Signal Express only (without using Lab view)?
    Regards
    Mnuet

  • Continuous Scatter Plot Comparison for Satellite Observation

    I am working on writing a java plug-in to analyze a scatter plot generated from satellite data(semi-major axis vs inclination). I have been looking at algorithms to do so and found DFS(Depth First Search) and BFS(Breath First Search). The point behind the code is to find out what is normal movement for the satellite and catch abnormal movement. The only problem is I don't have much experience with using algorithms so I was hoping maybe someone can help me get started. Thanks\
    Edited by: ncr7 on Jul 10, 2009 10:08 AM

    Hi Stuart
    Maybe this helps you.
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...
    Attachments:
    Plots.vi ‏65 KB

  • Relative Time Scale for X-Axis when creating a Line Graph in CS3?

    Is there a way to get the APPROPRIATE RELATIVE scale for the X-Axis (Category) when you're using dates?
    Example:
    If this is my data set:
                        Group A          Group B
    01/03/99                1                5
    01/04/99                11                3
    01/05/99                6                12
    11/27/07                63                54
    If I plot this in Xcel, by default, each date (x-axis) will be spaced the same distance apart. However, there is a checkbox to "time-scale" the X-Axis which will place the dates relative to one another. In other words, if we're talking about a bar graph, the first three bars would be close together on the left side of the chart, and the 4th bar would be waaaaaay on the right side of the graph.
    So, below, if 'x' is a bar, I keep getting this in CS3:
    x     x     x     x
    I want to get this:
    x x x             x
    Get it?

    Is there a way to get the APPROPRIATE RELATIVE scale for the X-Axis (Category) when you're using dates?
    Example:
    If this is my data set:
                        Group A          Group B
    01/03/99                1                5
    01/04/99                11                3
    01/05/99                6                12
    11/27/07                63                54
    If I plot this in Xcel, by default, each date (x-axis) will be spaced the same distance apart. However, there is a checkbox to "time-scale" the X-Axis which will place the dates relative to one another. In other words, if we're talking about a bar graph, the first three bars would be close together on the left side of the chart, and the 4th bar would be waaaaaay on the right side of the graph.
    So, below, if 'x' is a bar, I keep getting this in CS3:
    x     x     x     x
    I want to get this:
    x x x             x
    Get it?

  • Line / scatter plot axis problems

    I'm trying to create a graph to show the percentage of revenue that is generated by some percentage of classes offered, a la an 80-20 graph. Sample XML:
    <DATA>
    <RevenueByClass>
    <REVENUEBYCLASS_ROW>
    <CLASS_NUMBER>1</CLASS_NUMBER>
    <PERCENT_OF_CLASSES>.24</PERCENT_OF_CLASSES>
    <PERCENTAGE>4.67</PERCENTAGE>
    </REVENUEBYCLASS_ROW>
    <REVENUEBYCLASS_ROW>
    <CLASS_NUMBER>2</CLASS_NUMBER>
    <PERCENT_OF_CLASSES>.48</PERCENT_OF_CLASSES>
    <PERCENTAGE>6.83</PERCENTAGE>
    </REVENUEBYCLASS_ROW>
    </RevenueByClass>
    </DATA>
    Ideally, I want a line graph (which I can make without any trouble) with PERCENT_OF_CLASSES showing up on the X-axis and PERCENTAGE on the Y-axis. My problem is that, because it's a line graph, BI Beans treats the X-axis as ordinal rather than a data axis, so the axis labels are completely haywire. I would like a way to change the line graph so that the axis labels are the same as the Y-axis, preferably every 10% or 20%. Skipping doesn't work, because the total number of classes can vary so the exact percentages can vary as well.
    If there is no way to do that, I could try to make it as a scatter plot; however, it's not built into the wizard and I've had little success trying to build it by hand. Any help would be greatly appreciated.

    Unfortunately it seems that while most chart types can cope with data in rows, 'scatter' needs data to be in columns. If you create a table the transpose of how you described it, then click Listings and command-click 200, you should be able to create the correct scatter chart. Note that you'll probably then want to click the numbers on the x-axis of the chart (e.g. 80) until a narrow box appears which contains just those numbers. Then, in the chart inspector 'Axis' dialogue enter the value 50 in 'Value Axis Format':'Minimum', and maybe chnge the number of steps to suit (here 3). You might want to repeat this for the y-axis with different values.
    Craig.

  • Xy scatter plot with 2 y axis how to?

    I am interested in an making an XY scatter plot with time points as
    the x axis, and with 2 different y axis.
    As I mentioned, the x axis
    will have the different time in min., that the data was collected, and
    the 1 y axis would contain a particular measurement of the sample, and
    the other (2nd) y axis would contain a different type of measurement
    of the same sample. The problem is that I can't see how to do a 2 y
    axis XY scatter plot.
    best regards
    Peter Valencic

    Hi Peter,
    This is one of the most requested features for the JFreeChart project. It hasn't been added yet, but it is very near the top of the to-do list.
    Regards,
    Dave Gilbert
    JFreeChart Project Leader
    P.S. For anyone who is interested in JFreeChart, the link is:
    http://www.object-refinery.com/jfreechart/index.html

  • Specified a 3D scale for each axis

    Hi,
    I'm plotting a 3D graph but i don't want to use the autoscale function. I would rather specified my maximum value of scale for each axis.
    How can can i achieve this?
    Thanks.
    GERARD Florian.

    Oops, forgot the attachment, Here you go
    -Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA
    Attachments:
    Axis Maximum.jpg ‏17 KB

  • SQL-Developer  4.0.0.13.80 Bug? No negative values for axis scale accepted

    I reported this problem already for the versions EA1 and EA2 of SQL-Developer 4 (4.0EA1 No negative values for axis scales in diagrams) but it still exists in 4.0.0.13.80:  Even if it is now possible to define the minimum and maximum values for the y-axis of a diagram, I found no way to enter negative values for the minimum value. Neither -100 nor (100) is accepted. The value always switches to 0. I have a report which shows values from -97 to 387. Automatic scaling sets the y-axis from -200 to 500 but I would prefer a scale from -100 to 400. How is this possible?
    btw.: the German translation for "scale" in the diagram settings is bad. It is translated with "Nachkommastellen" but it should be "Skalierung".

    In 4.0EA2 this topic is still not fixed.

  • How do you make a horizontal average line in a scatter plot?

    In any version of Numbers, is there a way to make a horizontal average trendline?  Not a "moving average", but one line that is the average that goes through the data points on a scatter plot.

    sflakg wrote:
    hit a few roadblocks. 
    I tried:
    1. using the crop tool to make the canvas bigger with a transparent background.
    2. Used lasso tool over people in group shot (total of 5) and saved the selection
    3. Tried content aware scale to raise the image, but it keeps stretching out the people. 
    Any thoughts on what else I could try?
    Rather than trying to stretch it taller, try to squeeze it horizontally.  There are methods for telling it what to protect in the image if it gets touchy.
    Another possibility is to use Content Aware Fill to make up part at the top and bottom, without any stretching.
    -Noel

  • Highlighting a single data point in a scatter plot - Numbers'09

    Is there a way to highlight a single data point on a scatter plot in Numbers'09 (or point to it using a line from each respective coordinate on the x & y axis).
    I don't think it matters but the data point i am looking to highlight is the [highest y value/2]... and of course its respective x coordinate once you plug the y value into the equation ( y = f(x) ) and solve for x.

    Here is my own tip :
    As you see, I use two sets of values.
    In the second one I define only the yValue of the data point which must be "highlighted".
    Yvan KOENIG (VALLAURIS, France) jeudi 10 février 2011 20:49:32

  • Swap X and Y in a Scatter Plot

    Seems like this should have a simple answer. I have a table of data, and I'd like to generate a scatter plot of two columns. The plot comes out fine, but I want to "swap" the X and Y axis in the resulting chart.
    Is there a simple way to do this? I can't find anything in the chart popup-menu, the inspector, or the application menus.
    Cheers
    Mike

    Michael,
    This is a user to user forum, and I'll admit that I don't have a great grip on Numbers Charts, so I may be missing something myself. However, I don't know of an easy way to swap the axes either. What I would do is to create an auxiliary column that repeats the X data in a column just to the right of the Y data. Then I would create a new chart that plots the second and third columns, effectively reversing the axes. The third column can be hidden. Of course you could also just reverse your x and y columns before plotting, but that might be more disruptive to your overall table organization.
    Jerry
    Update:
    I believe that, after some experimentation, I have a better method for you. Highlight the X Range only and create a Scatter Chart. The Chart will be blank since you have not yet supplied a Y range. Then highlight your Y range and drag it to the blank chart. A new Y series will be inserted.
    Hope this works for you.
    Jerry
    Message was edited by: Jerrold Green1

  • Plotting Data Incorrectly in a Scatter Plot

    I am trying to plot a graph using a scatter plot in Numbers, and all of the data points are correct except for one. If you look at the data, you can see that the point that is at .00360 on the y axis(the highest point on the graph) is supposed to have an x value of .001 but instead it is too far to the right (closer to .1). This is throwing off my graph and I really need to get this fixed. Below are the links to the data table and the graph. Thanks for any help!
    http://img686.imageshack.us/img686/7/picture3wc.png
    http://img20.imageshack.us/img20/2035/picture4pe.png

    Hi Tom,
    I tried recreating your table and chart, typing in the numbers rather than having any of them calculated, and manually assigning min and max values to both axes to match yours.
    The chart came out with all data points where expected.
    I did notice another difference in the curve though—where yours shows three data points forming a concave-toward-the-origin section (at the leftmost portion that is correctly plotted), mine shows four data points. That led me to count the points and find that there is one point—(0.139,0.00309)—missing from your chart.
    While I don't see from doing this what may be wrong with your chart, it did bring a workaround to mind that should get you a useable chart before your deadline.
    Insert a new (plain) table into your document and resize it to the minimum needed to hold the two columns of data.
    Select the cells containing the X axis data and Copy.
    Click on cell A1 of the new table and go Edit > Paste Values.
    Repeat for the Y axis data, placing it in column B of the new table.
    Select the data block in the new table then insert a scatter chart.
    If you still get the error, manually edit the data in the cells causing the error.
    That should get you through the short term. I think someone may have to look at the actual file to solve the underlying problem.
    Regards,
    Barry

Maybe you are looking for