SetAxis side effects

Hi,

I'd like to know if I can get manually the same axis ticks than by using SetAxis/N=2/A=2 $axis.

In the following example I can get the same axis ranges, but not the same ticks.

Function DoStuff()

    Redimension/N=(3) data

    Make/O data = {0, 3000, 0}
   
    Display data

    SetAxis/A=2/N=2 left
    DoUpdate
    GetAxis left

    Display data
    SetAxis left, V_min, V_max
End


To answer the obvious question why I want to use that. I have a graph showing live acquisition data and want to adapt the axis scaling only every x seconds to prevent a flickering image. To achieve that I set the axis to auto scaling, read the axis range back, and then set the axis range manually. This works except that the number of axis ticks changes unexpectedly.

My data has basically an unknown range so all hardcoded solutions don't work.
AxisInfo should return the necessary information in the "recreation" group (If I remember correctly -- It returns a lot!).
HJ

Update: I checked it and this returns (almost) identical strings for both graphs. Once, I used AI to get the nTicks parameter. But here it is "5" in both cases...
Thanks HJDrescher!

I also already checked the window recreation macro and that looks exactly like you expect.
In the string returned by AxisInfo, you will find a SETAXISCMD:SetAxis/A=2/N=2 left;

You have two choices: extract the command string and use Execute on the string, or extract the command string, and then parse it to discover the settings of the flags.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
I looked through my code and found a comment that I had a similar issue: Synchronization of (vertical) axis of an unknown range in ~20 windows.
I ended up calculating my own ranges and ticks (not as nice as by the /A flag I admit).
Unfortunately, the AxisInfo-string does not work, see the update in my previous post.

Would it be possible to include a new group in the AxisInfo-string, e.g., "TICKsetting: canonic(x)=0;...." ?
HJ
My question is not about how to call SetAxis or to extract the flags used. My question is how can I manually get same axis ticks which SetAxis/A=2/N=2 creates.
You want manual tick specification matching the automatic ticks on a given axis?

Update: The nticks setting is included in the AxisInfo string, so my guess is that you want manual tick spec.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
"We" would like the manual tick specifications of an automatically set axis returned to use it in further code.
The nTick paramter does not work since it is identical for two axis with the same range but different ticks. Actually, all relevant parameters are identical (I did a diff of the AxisInfo strings).

Btw. thomas_braun and myself are not direct colleagues. Must be a German thing to keep everything consistent ;-)
HJ
Well, we certainly have the underlying technology available, as you can see from the Set to Auto Values button in the Modify Axis dialog. We would have to hook it up to some sort of command, maybe ModifyGraph manTicks = 1 would do.
Quote:
Btw. thomas_braun and myself are not direct colleagues. Must be a German thing to keep everything consistent ;-)

We do get some very exacting bug reports from our German customers!

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
johnweeks wrote:
Well, we certainly have the underlying technology available, as you can see from the Set to Auto Values button in the Modify Axis dialog. We would have to hook it up to some sort of command, maybe ModifyGraph manTicks = 1 would do.


Nope that will not do for this specific case. If I use "Computed Manual Ticks" on my example graph I get as starting values the standard ticks every 1000, and not the every 500 as SetAxis/A=2/N=2 left creates them.
Oh, my. I don't know exactly what is going on, but it looks to me like SetAxis/A/N=2 left is computing the "approximately" number of ticks before expanding the axis range. That might be a bug, or it might be, um, a feature :)

There have been times that I have wanted to get the tick interval from an axis (I am the author of Transform Axis package) but right now is a bad time for us to go mucking with new features. We're trying desperately to get Igor 7 released!

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Oh, my. I don't know exactly what is going on, but it looks to me like SetAxis/A/N=2 left is computing the "approximately" number of ticks before expanding the axis range. That might be a bug, or it might be, um, a feature :)

There have been times that I have wanted to get the tick interval from an axis (I am the author of Transform Axis package) but right now is a bad time for us to go mucking with new features. We're trying desperately to get Igor 7 released!

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
I also sort of solved it manually already; put this issue on the 'special feature list' ;-)

Go for IgorPro 7 !
HJ