NetTalk Central

Author Topic: InsightGraphing Auto Scale Y axis  (Read 6852 times)

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
InsightGraphing Auto Scale Y axis
« on: December 01, 2013, 12:37:03 AM »
Hi

I have an InsightGraph in a NT program on which I currently autoscale the Y-axis.  See the attached doc.

In the doc the graphs show what the auto scale works out as the acceleration increases and sometimes the graph itself gets quite cramped.

I can work out the actual minimum and maximum accelerations as I generate the plotting points and I would like to set the lowest acceleration on the graph as say 0.2 lower than the actual minimum acceleration and the highest acceleration on the graph as say 0.2 higher than the actual maximum acceleration.

This would ensure that the graph was neatly contained within the Y-axis rather than being squashed or truncated as it sometimes is now.  Is there an embed point where I could override the calculated values and what variables would I need to set - ThisGraph2.AutoScale = Scale:Low + Scale:High?

On the other hand there may be some way that I could achieve the effect in the template - but I couldn't get a good result despite many iterations of the parameters.

Thanks for any advice.

Keith

[attachment deleted by admin]
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: InsightGraphing Auto Scale Y axis
« Reply #1 on: December 01, 2013, 09:52:05 PM »
Hi Keith,

I think you might need to post an example app. I'm especially not sure how you are getting the bottom 3 graphs.

cheers
Bruce

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: InsightGraphing Auto Scale Y axis
« Reply #2 on: December 02, 2013, 01:04:45 AM »
Hi Bruce

All of the graphs are produced from the same server app (with the Insight Prompts as shown in the doc).  The different graphs are just the result of a user making choices for power and grip (grip determines max acceleration).  So as Grip increases so does the max acceleration achievable for the same power.

The problem is that the auto scale logic when presented with some values for the Y axis doesn't make choices that frame the graph nicely.  For example for graphs 2 and 3 the auto scale adds no headroom whereas for graph 1 it does.

If you still need an app I can do it for you - let me know.

Cheers

Keith
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: InsightGraphing Auto Scale Y axis
« Reply #3 on: December 02, 2013, 08:00:18 AM »
yes

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: InsightGraphing Auto Scale Y axis
« Reply #4 on: December 02, 2013, 02:07:29 PM »
Hi Bruce

Here is an app (TestScale.app) which draws four graphs (derived from my GoCars application).  They look a little different from those I showed in the document but are framed vis a vis the Y axis in the same way.

The Excel workbook they come from is TestScale.xlsx

Each graph has a routine which opens the workbook and gets the appropriate values.  The time values (X axis) are in column 1 and the acceleration values (Y axis) are in columns 2,3,4,5 - one for each graph.

In the GoCars application these values are generated as the user makes changes to the input parameters.

There is a file Control.tps which has a record containing the location of the workbook and the name of the file (c:\TestScale\TestScale.xlsx).  If you can't unzip this folder into c:\TestScale then wherever you put it you'll have to edit the tps file to change the name of the location.

Sorry about all the instructions and not making this more seamless.

Looking forward to your conclusions.

Keith

[attachment deleted by admin]
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: InsightGraphing Auto Scale Y axis
« Reply #5 on: December 03, 2013, 12:47:56 AM »
I don't have EasyExcel here - can you maybe update the example to exclude that, and re-post please?

cheers
Bruce

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: InsightGraphing Auto Scale Y axis
« Reply #6 on: December 03, 2013, 01:08:23 AM »
Hi Bruce

Doesn't it run?  The exl8x.dll was included in the zip file.

Keith
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: InsightGraphing Auto Scale Y axis
« Reply #7 on: December 03, 2013, 03:50:57 AM »
running is not helpful - I have to compile the code in order to debug what's going on.

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: InsightGraphing Auto Scale Y axis
« Reply #8 on: December 03, 2013, 01:20:41 PM »
Hi Bruce

I have removed EasyExcel and replaced the data in the workbook with a tps file.  You should be able to compile it now.

You will notice that the second graph is blank  >:( and after spending half an hour on trying to get it to display properly I gave up (need to do something else).  Anyway, the three remaining graphs give the idea.

Thanks for all your assistance.

Keith

PS I now note that I am not a Newbie but I still feel like one!



[attachment deleted by admin]
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: InsightGraphing Auto Scale Y axis
« Reply #9 on: December 11, 2013, 03:04:00 PM »
Hi

I have fixed the problem with the display of the test graphs and am uploading a new version of the TestScale application.

Thanks for your help

Keith

[attachment deleted by admin]
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: InsightGraphing Auto Scale Y axis
« Reply #10 on: January 20, 2014, 10:45:47 PM »
sorry it took so long Keith. Fix is in build 2.13 of Insight.

cheers
Bruce
« Last Edit: January 20, 2014, 10:49:09 PM by Bruce »

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: InsightGraphing Auto Scale Y axis
« Reply #11 on: January 27, 2014, 06:21:21 PM »
Hi Bruce

I have installed IG V2.13 and re-run my TestScale program and don't see much difference.  The graphs are still hitting the end of the Y scale.  I have attached a doc with screen shots.

If you compile the app in my previous upload you should get the same result.  Execution is via: http://127.0.0.1:8090/playpen

Thanks

Keith

[attachment deleted by admin]
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: InsightGraphing Auto Scale Y axis
« Reply #12 on: January 28, 2014, 01:54:20 AM »
the graphs are allowed to hit the top of the y-scale, if indeed that's where the data is. for example, in your last graph if the may Y-Value is 0.70 then th graph is correct.

Of course you may _want_ "whitespace" at the top of the graph, but that's a separate question.

cheers
Bruce

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: InsightGraphing Auto Scale Y axis
« Reply #13 on: January 28, 2014, 08:14:51 PM »
Hi Bruce

The issue has always been 'whitespace' or, 'framing the graph'.

If you can guarantee that a graph is always generated between known values then you can use min and max on the axis to provide nice whitespace.

However, if this is not the case then you have to rely on auto scale to set the actual min and max.

I wondered whether there was some way for the programmer to provide axis min and axis max at run time or if IG could be tweaked to always provide whitespace. A simple algorithm might work say setting axismax = datamax + (2% of datamax-datamin) and axismin = datamin - (2% of datamax-datamin)

Cheers

Keith
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27

Keith

  • Sr. Member
  • ****
  • Posts: 306
    • View Profile
    • Email
Re: InsightGraphing Auto Scale Y axis
« Reply #14 on: February 03, 2014, 01:20:20 AM »
Hi Bruce

Further to my last post - the comments that I have received are all now positive about the way the graphs are framed and  I am agreeing so ignore my last questions.

Cheers and thanks

Keith
Clarion 10.0.0 build 12799
NetTalk 9.31
StringTheory 2.65
InsightGraphing 2.27