View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

4.6 | 9 ratings Rate this file 50 Downloads (last 30 days) File Size: 4.26 KB File ID: #22708 Version: 1.2
image thumbnail



michael arant (view profile)


17 Jan 2009 (Updated )

Plots matrix column data in a spider plot.

| Watch this File

File Information

Function plots table data in a spider (or radar) plot form. Permits independent or global axis limit controls as well as axis labeling and data set labeling. Also allows for the plot axes to be specified. Any inputs other than the data to be plotted can be left as null ([]) which then uses the default settings. Minimum of three axes (three rows to the data) required (technical limitation to a spider plot). No maximum on number of rows (axes) or columns (data sets) but plots can get busy if rational limits are not used.
Examples are included in the help listing for usage methods.
% create a spider plot for ranking the data
% function [f, ca, o] = spider(data,tle,rng,lbl,leg,f)
% inputs 6 - 5 optional
% data input data (MxN) (# axes (M) x # data sets (N)) class real
% tle spider plot title class char
% rng peak range of the data (Mx1 or Mx2) class real
% lbl cell vector axes names (Mxq) in [name unit] pairs class cell
% leg data set legend identification (1xN) class cell
% f figure handle or plot handle class real
% outptus 3 - 3 optional
% f figure handle class integer
% x axes handle class real
% o series object handles class real
% michael arant - jan 30, 2008

Minor bug with automatic placement of legend (may cover the axis labels). Legend can be moved manually.

Required Products MATLAB
MATLAB release MATLAB 7.4 (R2007a)
MATLAB Search Path
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (21)
20 Feb 2017 ming sheng shang

it is right , very good!

Comment only
20 Feb 2017 ming sheng shang

it is ritht , very good!

Comment only
20 Feb 2017 BonoBono

Hi Michael, I found my mistake. Your file is very helpful.
Can you give suggestion how to change the name of the "Axis"

I d like to change Axis 1, Axis 2,...
to apple, orange, grape, ...


17 Feb 2017 BonoBono

Hi Michael,

I am a beginner in Matlab.
Tried your code.
but it says:

Error using spider (line 55)
Need data to plot

Can you help?

I am using Matlab R2014b

THank you

Comment only
13 Nov 2016 Samuel Salvisberg

Verry nice. Thanks!

11 Apr 2016 Paul Carvalho

08 Apr 2015 Daniel

Daniel (view profile)

Hi Michael,

Am currently using MATLAB 2015...I was unable to get the function to run because of two things...line 136 you had 'isint'...I'm assuming you're checking for an integer, so I changed it to 'isinteger' and it made it past there. Then on line 167 there is reference to this thing called color_index. I see it's only used in one place so I put in some dummy data and was able to get it to output a plot using some of the cases you created.

All in all, this is very cool. Thank you for the submission


Comment only
02 Jul 2014 Steffen

02 Jul 2014 Steffen

Hello Michael,

Thanks for quick answer.
I already tried to edit with get and set, obviously I made a mistake.
Maybe I have to change "ca" not "x"?


Comment only
01 Jul 2014 michael arant

michael arant (view profile)

Hello Steffen
Yes but it is a user action. "X" in the outputs is the axes handles. From there you can edit the axes using get and set. It could have been done from the command line but I arbitrarily left that out. The complexity vs. adaptability compromise.


Comment only
01 Jul 2014 Steffen

Is it possible to plot more then two positions after decimal point?

Comment only
07 Mar 2014 Nyeinsu

Thanks a lot... It's exactly what I am searching for.
It saves a lot of time for me.

10 Jun 2013 Lars

Lars (view profile)

Well done! :)

@ Cyril: With the chop.m-file of this side it works.

Comment only
19 Apr 2013 Richard McCulloch

Works great! I agree with Linus, well commented and very nicely done!

27 May 2011 Chiao

Chiao (view profile)

Bravo. Exactly what I need. Thank you

Comment only
27 May 2011 Chiao

Chiao (view profile)

17 Jan 2011 michael arant

michael arant (view profile)

A few users with long legend labels have suggested replacing the location in the legend call (line 222) from ‘northeastoutside’ to ‘best’. This does improve appearance in some cases. I’ll leave it to the user to decide which placement to use.

Comment only
10 Jun 2010 Cyril

Cyril (view profile)

very nice... Didn't work initially as the 'chop' function seems to be obsolete in R2010a.

09 Nov 2009 Linus

Linus (view profile)

03 Feb 2009 michael arant

michael arant (view profile)

Thank you Linus

If you have any ideas on improving the function or the calling of the function, I would like to know. The passing of the axis labels, units, data set labels, etc. is a bit clunky but I could not think of a better method. I am hoping that as others use this someone with get an inspiration.

Comment only
02 Feb 2009 Linus

Linus (view profile)

Brilliant, well commented and very nicely done

Comment only
23 Dec 2014 1.1

Updated for MATLAB 2014 and newer (chop command was obsoleted)

08 Apr 2015 1.2

Thank you Daniel. Somehow two subfunctions got deleted. Do not know why / how. But fixed here.

Contact us