Thanks for this excellent tool. I wish I had discovered it sooner. I have been writing custom quadratic programs to fit polynomials with various constraints (monotonicity, concavity, endpoint slopes, etc.) for years, but it seemed like every time required a slight variation on what I had done previously. This tool captures all of those things I was doing (and many more).
Figure 1 has additional space at the top and right in between panel 1 and panel 2 compared to panels 3 and 4 in figure 2. I just reinstalled v1.8 and removed all other versions from my path as a precaution. I am using R2010B.
We don't appear to be able to upload files or else I would include screenshots as well.
I need to retract my "correction" of lines 133-134 of Panel.m. However, I believe I am now closer to an answer. In normalized units, the border/title area is excluded from the control area. You have to compensate for this when you specify the width and height to obj.ShowSelectedChild. I can provide code, if interested.
I wanted to follow up on my previous comment. First, I believe lines 133-134 of Panel.m should be:
x0 = border;
y0 = border;
Also, the issue with the normalized panels appears to be that the uipanel reserves some space at the top of the panel such that a normalized position of [0 0 1 1] does not fully cover the area returned by getpixelpostion. I haven't figured out yet how to set/get what the "normalized" area actually is relative to the getpixelposition area.
I think this toolbox is fantastic. It has already saved me a ton of time. However, I wanted to point out one issue that has popped up recently. I believe that your bugfix in v1.7 that changed the unit-setting behavior when children are added has had some unintended consequences. Here's a simple example:
This produces a figure where there is an overly large gap between the top of the first panel and the second inset panel. In previous versions (definitely v1.5) the gap was much tighter. If you specify pixel units for the second panel explicitly:
Very slick and easy to work with. It's very well documented so anyone can pick this up in a heartbeat. However, if you have HG2 enabled, this will not work. Any plan in the future of this support?
Hi Ben, David,
I am having issues with the latest release and changing the limits of axes with patches objects in them.
if you do :
set(a2, 'YLim', [10 30])
You will see the contours coming out of the axes onto the neighbouring elements.
Is there a way to get the axes to update itself correctly ?
Thank you, John. According to your suggestion, I have fitted my data again, but unfortunately, the results is worse than seperately fitting the two parts of the curve. I made a simple simulation, but I still got the similar result. Would you please take a few minutes to have a look at my simulation data, I will send it to you by email. Thank you.
I found the code written by Meyer on this web site "http://www.stat.colostate.edu/~meyer/srrs.htm", but it was written in R code, not matlab. I think I should learn R code these days. Meyer also did not give out how to fit the data with half convex and half concave, it seems still a long way for me to get out. Would you please give me some suggestion? Thank you.
I am looking forward to your new reply, Thank you again.
I have been trying to make use of TabPanels for visualising a dataset. I can create and plot to several tabs each containing a flexible grid of axes:
for p = 1:Ntabs;
for q = 1:Naxes
Unfortunately if I make the figure reasonably large on the screen when I change tabs the axes on the old tab are not fully hidden and obscure the axes on the new tab (basically it looks a mess). If I slightly resize the figure window then the view updates and the axes are displayed correctly. Normally the first few times I change tab things work correctly.
I am using GUIlayout v1p13 on R2013a on win7.
Any help including a work-around would be greatly appreciated (executing refresh(gcf) doesn't help)!
No. SLM does NOT use truncated power functions! These are generally a numerically poor way to implement a spline, even only a cubic spline.
SLM uses a Hermite formulation, which personally, I've always preferred as they are easy to look at and understand the shape just by looking at the parameters since they are parameterized by function values and derivatives at the knots. Its just my personal preference though, since a spline by any other basis is still a spline.
As far as monotonicity or concavity applying only over a restricted range, you can do so using SLM directly. Read the help for slmset. It says (in part):
'increasing' - controls monotonicity of the function
= 'off' --> No part of the spline is constrained to be an
= 'on' --> the function will be increasing over its entire domain.
= vector of length 2 --> denotes the start and end points of a
region of the curve over which it is monotone increasing.
= array of size nx2 --> each row of which denotes the start
and end points of a region of the curve over which it is
So if you wish a constraint to apply only over a portion of the curve, you can specify the interval. This same approach applies to the concavity constraints. If that constraint would indicate the curve be monotonic over only part of a knot interval, I do stretch it to require monotonicity over a complete knot interval. So you cannot stop midway between a pair of knots. In that case, simply add a knot.