Prev: set data in a uitable
Next: Adding new marker types?
From: Matt Fig on 1 May 2010 23:55 Here is one possible approach. Note that you could also use patches instead of text. This would, of course, require a little extra work. Below is a function and it's subfunction. The subfunction takes line objects as an argument, puts number labels on them, and returns the text objects for possible further manipulations. function [] = numplots() % Creates some data and passes it to a subfunction which demonstrates a % possible use of text as a line-marker. % Data to plot. x = 1:.1:20; w = 4 * sin(x); y = sqrt(x); z = x.^4.*exp(-x); % Plot ln = plot(x,w,x,y,x,z); % Get the handles to the lines. xlim([0 21]) labelum(ln); % Return text properties for further manipulations? function [T] = labelum(ln) %Puts number labels on input lines. Returns text objects. % Use general method. T = cell(length(ln),1); for ii = 1:length(ln) x = get(ln(ii),'xdata'); y = get(ln(ii),'ydata'); x2 = linspace(min(x),max(x),9+ii); y2 = interp1(x,y,x2,'nearest'); T{ii} = text(x2,y2,sprintf('%i',ii),'fontweight','bold','color',... get(ln(ii),'color'),'backgroundcolor','w'); end
From: us on 2 May 2010 08:20
"Halil " <adanali(a)gmail.com> wrote in message <hrhh4l$3aq$1(a)fred.mathworks.com>... > "us " <us(a)neurol.unizh.ch> wrote in message <hrheq3$4ak$1(a)fred.mathworks.com>... > > "Halil " <adanali(a)gmail.com> wrote in message <hrh9d2$ito$1(a)fred.mathworks.com>... > > > Hi, > > > > > > I would like to plot dozens of datasets to a one figure and i need at least 20 different marker types. > > > > > > The best solution that i found is the ''number'' marker types. I mean if you are going to plot the 1'st dataset, the marker is 1 (the number itself), if you are going to plot the 2'nd dataset, the marker that you are going to use is 2 (instead of * or +). > > > > > > Is there anyway to add these markes to MatLab??? > > > > a hint: > > > > help text; > > > > us > > İf you mean to look for help file in Matlab by typing "help txt", i have also searched it on Help and i also googled it. i said help text; not help txt; anyhow... you certainly got enough information on what TEXT can do for you... did you put it to work(?)... us |