| 1 |
%22/11/2003 |
| 2 |
%auteur : Gael Forget |
| 3 |
%version : beta |
| 4 |
%objet : a la realsiation d'un plot xz ou yz, on utilise |
| 5 |
%des echelles differentes au dessus/en dessous de 500m |
| 6 |
|
| 7 |
%remarque : old version etait spacifique a chaque type |
| 8 |
% de plot, cette nouvelle se vaut generique... |
| 9 |
|
| 10 |
function [varargout]=verticalplot(typeplot,cur_x,cur_z,varargin); |
| 11 |
%variables d'entree : |
| 12 |
%1) typeplot est le nom du type de plot (px : pcolor) |
| 13 |
%2) cur_x et cur_z sont les chamsp x et z |
| 14 |
%3) varargin sont les autres options a passer a la routine de plot |
| 15 |
|
| 16 |
|
| 17 |
%nouvelles ordonnees : |
| 18 |
xplot2=cur_x; yplot2=myverticaldeform(cur_z); |
| 19 |
|
| 20 |
%************************************ |
| 21 |
%gestion des vars de sortie (partie 1) |
| 22 |
tmptxt=''; |
| 23 |
if nargout==1 |
| 24 |
tmptxt='[tmp1]='; |
| 25 |
elseif nargout>1 |
| 26 |
tmptxt='[tmp1'; |
| 27 |
for kkk=2:nargout |
| 28 |
tmptxt=[tmptxt ',tmp' num2str(kkk)]; |
| 29 |
end |
| 30 |
tmptxt=[tmptxt ']=']; |
| 31 |
end |
| 32 |
%************************************ |
| 33 |
|
| 34 |
|
| 35 |
%le plot en lui meme : |
| 36 |
eval([tmptxt typeplot '(xplot2,yplot2,varargin{:});']); |
| 37 |
|
| 38 |
|
| 39 |
%************************************ |
| 40 |
%gestion des vars de sortie (partie 2) |
| 41 |
if nargout>=1 |
| 42 |
for kkk=1:nargout |
| 43 |
eval(['varargout(kkk) = {tmp' num2str(kkk) '};']) |
| 44 |
end |
| 45 |
end |
| 46 |
%************************************ |
| 47 |
|
| 48 |
|
| 49 |
%reglage des ytics : |
| 50 |
newtick=[floor(min(min(cur_z))) ceil(max(max(cur_z)))]; |
| 51 |
if (newtick(1)<=500)&(newtick(2)>500) |
| 52 |
tmp1=100*floor(newtick(1)/100); tmp2=ceil(newtick(2)/500)*500; |
| 53 |
newtick=[tmp1:50:250]; newtick=[ newtick(1:end) [500:500:tmp2]]; |
| 54 |
%newtick=[tmp1:100:500]; newtick=[ newtick(1:end-1) [500:500:tmp2]]; |
| 55 |
%newtick=[tmp1:100:1000]; newtick=[ newtick(1:end-1) [1000:500:tmp2]]; |
| 56 |
elseif (newtick(1)<=500) |
| 57 |
tmp1=floor(newtick(1)/50)*50; tmp2=ceil(newtick(2)/50)*50; |
| 58 |
newtick=[tmp1:50:tmp2]; |
| 59 |
else |
| 60 |
tmp1=floor(newtick(1)/500)*500; tmp2=ceil(newtick(2)/500)*500; |
| 61 |
newtick=[tmp1:500:tmp2]; |
| 62 |
end |
| 63 |
%on les range dans l'ordre approprie : |
| 64 |
newtick=flipdim(newtick,2); |
| 65 |
|
| 66 |
|
| 67 |
%format texte : |
| 68 |
newticklabel=[]; |
| 69 |
for kkk=1:length(newtick) |
| 70 |
newticklabel=strvcat(newticklabel,num2str(newtick(kkk))); |
| 71 |
end |
| 72 |
|
| 73 |
%mise a jour des yticks : |
| 74 |
newtick=myverticaldeform(newtick); |
| 75 |
set(gca,'YTick',newtick); |
| 76 |
set(gca,'YTickLabel',newticklabel); |
| 77 |
|
| 78 |
|
| 79 |
|