Search Comments and Ratings

go

   
Date File Comment by Comment Rating
08 Mar 2015 tightfig Remove excess margins from figures. Author: Richard Crozier reza vahid

I solved PDE with numerical method and I have 3 component (U,x,y) that (x,y)=[-1,1]*[-1,1]
and U is answer PDE< How can I use this function ?
Please any tip or example send to me through email:
vrh59ir@gmail.com

5
18 Dec 2014 tightfig Remove excess margins from figures. Author: Richard Crozier Shuqin

Shuqin (view profile)

very helpful! Thanks for sharing.

5
04 Dec 2014 tightfig Remove excess margins from figures. Author: Richard Crozier pietro

pietro (view profile)

It works fine but not when the figures are docked because it modifies the figure properties and not the axis ones. Anyway it is a great function. Hopefully it will work also when the figure are docked.

4
05 Nov 2014 tightfig Remove excess margins from figures. Author: Richard Crozier Thomas Edwards

I had a colorbar addded to my figure of multiple subplots. The annoying thing was that the exponent of the colorbar was cut-off on the edge of the figure. Using tightfig fixed this for me so that the exponent would fit in the figure. Very useful!

5
01 Oct 2014 tightfig Remove excess margins from figures. Author: Richard Crozier João

João (view profile)

Great. Although it sometimes clips the edges off fonts that are really close to the limits (I was not able to understand in which conditions it does this, but it happened unfrequently)

5
25 Sep 2014 tightfig Remove excess margins from figures. Author: Richard Crozier Daniel

Daniel (view profile)

5
04 Sep 2014 tightfig Remove excess margins from figures. Author: Richard Crozier arnold

arnold (view profile)

it doesn't take into account an xlabel of a boxplot. Just cuts it away. Ylabel seems fine though.

Comment only
28 Aug 2014 tightfig Remove excess margins from figures. Author: Richard Crozier Chad Greene

Chad Greene (view profile)

I use this frequently; thanks for sharing. I recommend adding this to the end of the function to suppress unwanted outputs:

if nargout==0; clear hfig; end

Comment only
24 Aug 2014 Goodness of Fit (Modified) Computes goodness of fit for regression model given matrix/vector of target and output values. Author: Richard Crozier Ricardo

Very useful and well written function. Thanks.

5
19 Aug 2014 tightfig Remove excess margins from figures. Author: Richard Crozier arnold

arnold (view profile)

I'll see when I find the time to look into it.
Something else I just noticed: Using plotyy and setting both y-labels, title, xlabel etc and tightfig. to wrap things up. Tightfig seems to fast somehow. It messes up the figure window. It works if I include a pause(0.2) before tightfig. Strange..... but the workaround is no problem of course.

Comment only
15 Aug 2014 tightfig Remove excess margins from figures. Author: Richard Crozier Richard Crozier

@arnold, I'll implement this if you suggest how to identify them. Unfortunately I don't have time to do a lot of research on this right now.

Comment only
11 Aug 2014 tightfig Remove excess margins from figures. Author: Richard Crozier arnold

arnold (view profile)

too bad it doesn't recognize my x-labels when using hierarchicalboxplot. It would be most useful if it were looking for all elements in a figure, not just axes.

3
09 Jul 2014 tightfig Remove excess margins from figures. Author: Richard Crozier Pablo Deossa

very useful!

5
08 Jul 2014 tightfig Remove excess margins from figures. Author: Richard Crozier Suntaree

awesome

5
27 Mar 2014 tightfig Remove excess margins from figures. Author: Richard Crozier Gergely Takács

5
24 Jan 2014 tightfig Remove excess margins from figures. Author: Richard Crozier grega

grega (view profile)

5
02 Oct 2013 tightfig Remove excess margins from figures. Author: Richard Crozier Mike Shen

5
25 Aug 2013 samesize Determine if all inputs are the same size in all dimensions. Author: Richard Crozier Jan Simon

Jan Simon (view profile)

Another hint: ISEQUAL replies a scalar TRUE or FALSE, so there is no need for ALL().

Comment only
02 Jul 2013 Display Formatted Text Table of Data Display data, mixed numeric and strings with optional col and row headers and your choice of col sep Author: Richard Crozier Noah

Noah (view profile)

It blows my mind that some kind of similar functionality is not already built in to Matlab. Thanks for putting this together!

5
12 Apr 2013 Display Formatted Text Table of Data Display data, mixed numeric and strings with optional col and row headers and your choice of col sep Author: Richard Crozier Richard Crozier

@arnold,

I'm not seeing this error on either 64 Bit Linux with R2011a or Win 32 R2012a, is this the exact code you ran?

Comment only
12 Apr 2013 Display Formatted Text Table of Data Display data, mixed numeric and strings with optional col and row headers and your choice of col sep Author: Richard Crozier arnold

arnold (view profile)

Hi Richard, I get this error when executing your example 2, any idea why?

====================================
>> colheadings = {'number of projects','sales','profit'};
rowheadings = {'Jimmy Slick', 'Norman Noob'};
data = [3 rand(1) rand(1); 1 rand(1) rand(1)];
wid = 16;
fms = {'d'};

colsep = ' & ';
rowending = ' \\';

fileID = 1;

displaytable(data,colheadings,wid,fms,rowheadings,fileID,colsep,rowending);
Maximum recursion limit of 500 reached. Use
set(0,'RecursionLimit',N)
to change the limit. Be aware that exceeding your
available stack space can
crash MATLAB and/or your computer.

Error in displaytable

Comment only
08 Apr 2013 Display Formatted Text Table of Data Display data, mixed numeric and strings with optional col and row headers and your choice of col sep Author: Richard Crozier Sanjay Manohar

Could you update this bug:

line 338

str = sprintf(['%',num2str(wid(j)),'g'],data(i,j));

should be

str = sprintf(['%',num2str(wid(j)),'g'],data{i,j});

Thanks for the useful script.
Sanjay

5
08 Apr 2013 Display Formatted Text Table of Data Display data, mixed numeric and strings with optional col and row headers and your choice of col sep Author: Richard Crozier Sanjay Manohar

Could you update this bug:

line 338

str = sprintf(['%',num2str(wid(j)),'g'],data(i,j));

should be

str = sprintf(['%',num2str(wid(j)),'g'],data{i,j});

Thanks for the useful script.
Sanjay

5
19 Mar 2013 Display Formatted Text Table of Data Display data, mixed numeric and strings with optional col and row headers and your choice of col sep Author: Richard Crozier Soumyadipta Sarkar

Great function. Much needed one. Please add some word recognition features so that the colheadings and rowheadings can be wraped around for a fixed width in a meaningful way.

5
07 Jan 2013 tightfig Remove excess margins from figures. Author: Richard Crozier K E

K E (view profile)

Perfect. Very useful if you are using the Windows clipboard to copy figures into Word and need to trim off the excess whitespace beforehand.

5
22 Dec 2012 tightfig Remove excess margins from figures. Author: Richard Crozier Richard Crozier

Hi Jurgan, from the description for crop.m I gather it crops whitespace from a bitmap (i.e. non vector type) image file which is already saved to disk, e.g. a jpeg, bitmap, png etc. It does not appear to act on figures.

I suppose you could get similar functionality to tightfig by first saving your figure to disk in one of these formats, then running crop.m on it. I prefer the tightfig workflow personally.

Comment only
20 Dec 2012 tightfig Remove excess margins from figures. Author: Richard Crozier Jurgen

Jurgen (view profile)

I see, I have export_fig. Based on what you said then maybe CROP (http://www.mathworks.nl/matlabcentral/fileexchange/20427-crop-whitespace-from-an-image) is worth comparing :)

Comment only
19 Dec 2012 tightfig Remove excess margins from figures. Author: Richard Crozier Richard Crozier

Jurgen, most of the functions you mention adjust the space between and around individual axes in subplots, and at least some have to be called on creation of a subplot. tightfig crops the white space around the outside of all the axes (and legends) in any figure without adjusting the rest of the plots at all. tightfig also identifies if you have a 3D zoomed axes in your figure and ignores it, since such figures cannot be cropped. tightfig is also well commented so you can understand it's workings.

Actually you failed to identify the one other function on the file exchange I know which does also have this functionality, export_fig.m.

Comment only
18 Dec 2012 tightfig Remove excess margins from figures. Author: Richard Crozier Jurgen

Jurgen (view profile)

How does this compare to: spaceplots, subplot1, tight_subplot, subplot_tight and subplotplus?

Comment only
26 Nov 2012 tightfig Remove excess margins from figures. Author: Richard Crozier Ben

Ben (view profile)

Hi, I found this very useful. However, I have one suggestion: in the line
ti(ti < 0) = 0.1

You should consider
ti(ti < 0.1) = 0.1
instead.

I had a graph where the top line of the outer box was being cutoff by saveas after I used tightfig, presumably because it had some ti in (0,0.1).

Comment only
14 May 2012 samesize Determine if all inputs are the same size in all dimensions. Author: Richard Crozier Richard Crozier

@Jan, oh, and thanks for the useful review.

Comment only
14 May 2012 samesize Determine if all inputs are the same size in all dimensions. Author: Richard Crozier Richard Crozier

@Jan,

Actually, I see now that isequal will return false in this case, so maybe I will just get rid of the first test!

Comment only
12 May 2012 samesize Determine if all inputs are the same size in all dimensions. Author: Richard Crozier Jan Simon

Jan Simon (view profile)

"any(diff(numdims))" is faster than "numel(unique(numdims)) > 1", but I'd omit the test for equal number of dimensions completely.

The function works as expected, the task is useful, it has a H1-line and a help text with an example and a "See also" line.

5
20 Feb 2012 Display Formatted Text Table of Data Display data, mixed numeric and strings with optional col and row headers and your choice of col sep Author: Richard Crozier grega

grega (view profile)

Thank you for the great func!

5
03 Feb 2012 Display Formatted Text Table of Data Display data, mixed numeric and strings with optional col and row headers and your choice of col sep Author: Richard Crozier Richard Crozier

Thanks Andrew, I have updated the file with your fix.

Comment only
03 Feb 2012 Display Formatted Text Table of Data Display data, mixed numeric and strings with optional col and row headers and your choice of col sep Author: Richard Crozier Andrew Davis

Works great, exactly what I wanted for quick table output. My only criticism is it prints a backspace character to the file if you're not using fid=1, so I added "&& fid == 1" to the conditional statements on lines 219 and 273.

5
19 Jan 2012 tightfig Remove excess margins from figures. Author: Richard Crozier Richard Crozier

Thanks Thomas, I've submitted a new version with the fix.

Comment only
16 Jan 2012 tightfig Remove excess margins from figures. Author: Richard Crozier Thomas

Thomas (view profile)

Great work... i was just going to implement it myself... but here it is ;) Thank you.

Just a minor issue:
Restoring the original axes units fails when there is only a single axes object in the figure:

set(hax(i), 'Units', origaxunits{i});

... since origaxunits is no cell array then. A simple if else does the trick.

5
25 Jul 2011 gapolyfitn optimises the functional form of a multi-dimensional polynomial fit to model data Author: Richard Crozier Richard Crozier

@Andrew Newell, I'm not sure why polyfitn has been removed. I will see if the author is happy for me to provide a copy of polyfitn with gapolyfitn.

Comment only
25 Jul 2011 gapolyfitn optimises the functional form of a multi-dimensional polynomial fit to model data Author: Richard Crozier Andrew Newell

Polyfitn has been removed from the FEX. Do you have any idea why?

Comment only
03 May 2011 odesplit Splits evaluation of a system of differential equations into chunks to avoid out of memory errors Author: Richard Crozier Richard Crozier

@Mukhtar, I'll update the description as you suggest.

Comment only
03 May 2011 odesplit Splits evaluation of a system of differential equations into chunks to avoid out of memory errors Author: Richard Crozier Mukhtar Ullah

I see. Thanks for clarifying. It is definitely useful then. You should have mentioned this in your description because otherwise people think you may have overlooked it!

Comment only
03 May 2011 odesplit Splits evaluation of a system of differential equations into chunks to avoid out of memory errors Author: Richard Crozier Richard Crozier

@Mukhtar, odextend returns the whole solution, and would therefore result in the out of memory problem that odesplit avoids for large solutions. From the matlab documentation:

The following command

sol=ode45(@vdp1,[0 10],[2 0]);

uses ode45 to solve the system y' = vdp1(t,y), where vdp1 is an example of an ODE function provided with MATLAB software, on the interval [0 10]. Then, the commands

sol=odextend(sol,@vdp1,20);
plot(sol.x,sol.y(1,:));

extend the solution to the interval [0 20] and plot the first component of the solution on [0 20].

So you get the whole solution from t=zero to tfinal, which may casue your machine to run out of memory.

Comment only
03 May 2011 odesplit Splits evaluation of a system of differential equations into chunks to avoid out of memory errors Author: Richard Crozier Mukhtar Ullah

Matlab already has a function ODEXTEND for that.

Comment only
30 Aug 2010 gapolyfitn optimises the functional form of a multi-dimensional polynomial fit to model data Author: Richard Crozier Martin Kaszynski

Great tool - thanks!

4
08 Mar 2010 Goodness of Fit (Modified) Computes goodness of fit for regression model given matrix/vector of target and output values. Author: Richard Crozier Andre Guy Tranquille

5
27 Oct 2009 Goodness of Fit (Modified) Computes goodness of fit for regression model given matrix/vector of target and output values. Author: Richard Crozier Ben

Ben (view profile)

4
24 Nov 2008 Goodness of Fit (Modified) Computes goodness of fit for regression model given matrix/vector of target and output values. Author: Richard Crozier David Yeo

Thank you. !!

5

Contact us