Is there an easy way to draw an object over the entire range of a graph axis with standoff enabled?

I am trying to draw a rectangle over a portion of a graph. Essentially I want to have different background colors over different ranges of the X-axis in order to delineate different data sources in a graph.

So in SetDrawEnv I set xcoord = bottom and use x values for left/right in DrawRect.

I would like to cover the full height of the plot area, so I use ycoord = prel and 0,1 for top, bottom.

Alas, with standoff enabled on the bottom axis, this only covers the real range of the plot, leaving the portion defined by the standoff clear. I can empirically approximate the desired behavior by extending the rectangle to slightly above 1.00, but it doesn't handle rescaling (e.g. for Layouts) very gracefully.

Is there a deterministic way of knowing the correct coordinate value to cover the full plot range with standoff enabled? Even if the graph is programmatically rescaled into a Layout?

-Andreas

 

 

 

For me, with Igor 8 I see your desired behaviour. I use User Back layer, draw with xcoord = bottom and ycoord = prel and 0,1, just as you describe. The rectangle fills to the axis regardless of the standoff setting.

Hi Tony.

I am on Igor 8.04 and I am definitely getting different results based on the standoff setting. See attached examples.

I normally use ProgBack, but I got the same result with UserBack.

The /E and /N flags for the vertical axis also don't seem to make a difference.

Do you see something different when you open the attached sample experiment?

 

-Andreas

 

The problem only happens with markers on the plot.

The bottom axis is shifting below the normal plot boundary (y=1, plot relative) to accommodate the markers.

Curiously, if I set the left axis range so that the data are inset, the same thing happens. That seems strange. I haven't looked at the manual to see if it's expected. Maybe contact support (help-contact support). I would expect that plot coordinates should always coincide with the graph background, but they don't if you plot with markers and a standoff.

A work-around might be to plot using a new bottom axis, and make the new bottom axis cross left at some negative value. But then you would have to create the standoff manually by adjusting the left axis range.

@tony The amount of standoff is intended to accommodate the width of a trace. So a lines-between-points trace with a very wide line would have noticeable standoff, too. I have tried to make the standoff account for the width of box and violin plots, also.

@topchem As far as I know, the only solution presently is to turn off standoff, and set the appropriate axis range to inset the data. Turn on the minimum and maximum manual range settings. You can try the "Expand 5%" button to get a small inset.

In reply to by johnweeks

My first ever use of "Nice + inset". I have to admit that option completely eluded my thinking.

It's not as visually appealing as standoff, but I'll take it in this case.

 

@johnweeks, Is there any way to make prel coordinates standoff-aware in the future? I would argue that including the standoff in the range 0,1 is in fact the correct behavior. But for the sake of backwards compatibility I would opt for a different character. Taking a cue from image plot autoscaling perhaps we could use an asterisk (*) to indicate the main or mirror axis standoff locations when used in place of left/top/right/bottom in the drawing environment.

-Andreas

 

One of our engineers is looking into what it would take to add something akin to "axrel" coordinates. Not ideal, but we can't change the behavior of prel at this point, about 25 years after it was invented!

No promises that anything will come of his investigation. And it's late in the cycle for Igor 9.

When I try it, it always seems like "Nice + Inset" makes too much space, but if it works, great.

Igor 9 is in beta testing. Here is some info released previously:

If you're interested, please fill out our short form at https://www.wavemetrics.com/form/igor-pro-9-beta-tester-signup. You must have a valid Igor Pro 8 license in order to sign up to be a beta tester, and for coursework licenses only the owner of the license may sign up to be a beta tester.

If you're curious, here is a brief list of some of the new features in Igor Pro 9:

* Autosave
* HDF5 Experiment Files
* Improved Box Plot and Violin Plot style and plotting options
* Expansion setting for control panels to accommodate large or small monitors
* Command completion of user-defined functions and command tooltips for built-in and user-defined functions
* Sparse matrix support
* Complex curve fitting
* Extensive Multipeak Fitting package improvements

Igor Pro 9 is fully supported on Windows 7 or later and macOS 10.12-10.14. Later versions of macOS are partially supported. You can install Igor Pro 9 beta and still continue using older versions.

All Igor Pro 8 English licenses (new and upgrades) sold on or after September 1, 2020, will be eligible for a free upgrade to Igor Pro 9 when it's released.
 

We have released beta 2. Jim's new axrel coordinate system missed that beta, so once you install the beta you will need to get the latest nightly build of the beta.

Is it already in last night's build? Or do I wait until tomorrow?

 

-Andreas