+ Reply to Thread
Results 1 to 4 of 4

How to define the X- and Y-axes ranges from a cell input ?

  1. #1
    Registered User
    Join Date
    05-21-2012
    Location
    Earth
    MS-Off Ver
    linux + python + numpy + pandas
    Posts
    18

    How to define the X- and Y-axes ranges from a cell input ?

    Hello,

    I have a scatter plot defined, where I have defined the scale bars and they are fixed. What I am now trying to do is to add a series, but where I can set the range of that series from outside the chart, i.e. by setting min max values, I hope the example below is somewhat clearer than my question:

    Altitude X Y
    0 500 700
    10 525 775
    15 550 850
    20 575 925
    25 600 1000
    32 625 1075
    38 650 1150
    44 675 1225
    50 700 1300
    56 725 1375
    62 750 1450
    68 775 1525
    74 800 1600
    80 825 1675
    86 850 1750
    92 875 1825
    98 900 1900
    104 925 1975
    110 950 2050
    116 975 2125
    122 1000 2200
    128 1025 2275
    134 1050 2350
    140 1075 2425


    So, I'd like to plot the values X and Y, but based on an altitude range from column Altitude.
    For example plot the data between 90 and 120 (as you can see those exact values don't exist in the data).
    Ideally I'd like to have two input boxes (Altitude Min and Altitude Max) that then define the range of data plotted.
    This way I could change the plot as a function of those input boxed and modify the chart as the data interpretation dictates.
    There is no need to changes the axes as these are determined separately. It's only about the data.

    I should say, I'm no programmer, just a user, I don't know how to use macros or vba or those fancy tools, and so any help would be more that welcome.

    Many thanks for your time in reading this, and even more thanks if you can help me.

    Rob

  2. #2
    Registered User
    Join Date
    05-21-2012
    Location
    Earth
    MS-Off Ver
    linux + python + numpy + pandas
    Posts
    18

    Re: How to define the X- and Y-axes ranges from a cell input ?

    Well perhaps not the most elegant solution, but I think I've found a way. Still if anyone has a better suggestion I'd be happy to hear it.
    The way I've done this is:
    add 3 columns:
    Altitude X Y AND X' Y'
    0 500 700 '=AND(Altitude>MIN,Altitude<MAX) =IF(AND=TRUE,X,"") =IF(AND=TRUE,Y,"")

    Then I define the Min and Max, point the chart to X' and Y', and the trick is done.

    not very elegant I concede, but it's doing the trick.

    Rob

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,438

    Re: How to define the X- and Y-axes ranges from a cell input ?

    In principle that is the approach you should take.

    I have a slightly different formula and the non plot values is NA() rather than "", as "" gets treated as text and text is treated as zero in charts.
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  4. #4
    Registered User
    Join Date
    05-21-2012
    Location
    Earth
    MS-Off Ver
    linux + python + numpy + pandas
    Posts
    18

    Re: How to define the X- and Y-axes ranges from a cell input ?

    Quote Originally Posted by Andy Pope View Post
    In principle that is the approach you should take.

    I have a slightly different formula and the non plot values is NA() rather than "", as "" gets treated as text and text is treated as zero in charts.
    Many thanks Andy,

    indeed with the "" I had issues in the plots, so I replaced by -999.25 (arbitrary number...), I'll try your solution, much better than the arb number.

    Thank you very much indeed, and glad to hear that my approach was a good way to do it.

    seems to be working fine for me right now.

    Rob

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1