matlab - Use text function inside a gui -


i want use text function add info curve in gui. problem when set coordinates , specify handles figure don't shown on figure. text doesn't show anything. code inside loop. here's small portion of code containing text functions..

i have defined matrices d, s, c, j, , mi somewhere else..

animh=handles.runanimationonaxes; v=s*es+c*0.7053*z^2/a^(1/3)+... j(it).*(j(it)+1)*(hbar)^2./(2*(mi*2/5*m*r0^2*a^(2/3)+... 4*m*a^2));  p=polyfit(d,v,5); pol=p(1)*d.^5 + p(2)*d.^4+p(3)*d.^3+p(4)*d.^2+p(5)*d+p(6);  plot(animh,d,pol,'k') ylabel(animh,'$v(r/r_0)\ (mev)$','interpreter','latex',... 'fontsize',11); xlabel(animh,'$r/r_0$','interpreter','latex',... 'fontsize',11); xlim(animh,[0.3 2.5]); ylim(animh,[ymin ymax]); title(animh,'mldm potential energy surface');  indexmin = find(min(pol) == pol); xmin = d(indexmin); ymin = pol(indexmin);  indexmax = find(max(pol) == pol); xmax = d(indexmax); ymax = pol(indexmax);  strmin = ['minimum = ',num2str(ymin)]; text(animh,xmin,ymin,strmin);  strmax = ['maximum = ',num2str(ymax)]; text(animh,xmax,ymax,strmax); 

the text function not have, within input parameters handle of axes on add string.

actually, first 2 input should x coord , y coord of point in add string.

moreover, text can used add strings in 3d graphs, in instructions

text(animh,xmin,ymin,strmin); 

and

text(animh,xmax,ymax,strmax); 

the axes handle interpreted x coord, while xmax , ymax, respectively y coord , z coord.

if in gui have 1 axes have remove first parameter in calls text.

if in gui have more 1 axes should make axes in want add string "current axes":

edit: removed first parameter in call text

axes(handles.runanimationonaxes)  strmin = ['minimum = ',num2str(ymin)]; text(xmin,ymin,strmin);  strmax = ['maximum = ',num2str(ymax)]; text(xmax,ymax,strmax); 

hope helps.

qapla'


Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

Swift game error message -