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=[0:1000:6000]; |
54 |
%newtick=[tmp1:50:250]; newtick=[ newtick(1:end) [500:500:tmp2]]; |
55 |
%newtick=[tmp1:100:500]; newtick=[ newtick(1:end-1) [500:500:tmp2]]; |
56 |
newtick=[tmp1:100:1000]; newtick=[ newtick(1:end-1) [1000:500:6000]]; |
57 |
elseif (newtick(1)<=500) |
58 |
tmp1=floor(newtick(1)/50)*50; tmp2=ceil(newtick(2)/50)*50; |
59 |
newtick=[tmp1:50:tmp2]; |
60 |
else |
61 |
tmp1=floor(newtick(1)/500)*500; tmp2=ceil(newtick(2)/500)*500; |
62 |
newtick=[tmp1:500:tmp2]; |
63 |
end |
64 |
%on les range dans l'ordre approprie : |
65 |
newtick=flipdim(newtick,2); |
66 |
|
67 |
|
68 |
%format texte : |
69 |
newticklabel=[]; |
70 |
for kkk=1:length(newtick) |
71 |
newticklabel=strvcat(newticklabel,num2str(newtick(kkk))); |
72 |
end |
73 |
|
74 |
%mise a jour des yticks : |
75 |
newtick=myverticaldeform(newtick); |
76 |
set(gca,'YTick',newtick); |
77 |
set(gca,'YTickLabel',newticklabel); |
78 |
|
79 |
|
80 |
|