2 pièce(s) jointe(s)
Utilisation de string et dates comme labels d'axes
Bonjour,
J'ai une matrice de points à tracer avec surf, et j'ai quelques difficultés pour pouvoir imposer mes notations sur les axes.
Je trace le tout comme ceci :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| function ShowMeYCurve(xDates, xYield, xcLabels, strName)
h1 = surfc(xYield, 'FaceColor', 'interp', 'EdgeColor', 'none', 'FaceLighting', 'phong') ;
material metal ;
alpha(.9) ;
camlight right ;
title(strName) ;
colorbar;
hold on;
xWater = ones(size(xYield)) * nanmean(xYield(:));
surfc(xWater, 'Facecolor', 'b', 'EdgeColor', 'none', 'FaceAlpha', 0.3);
hold off;
% petite animation...
h2 = light;
for az = -50:1:50
lightangle(h2, az, 30) ;
drawnow;
end
h2 = camlight('right') ;
iStepSize = 5 ;
for iLoop = 0:iStepSize:360 ;
camorbit(iStepSize,0) ;
%camlight(h, 'left') ;
drawnow ;
end |
Dans ce cas là, j'ai une matrice de dates xDates qui est <75x1> et une matrice xYield qui est <75x17>.
Je cherche à mettre les dates sur l'axe en bas à gauche, et je cherche également à ajouter des labels strings (variable xcFRGeneric) sur l'axe en bas à droite. J'ai essayé différentes méthodes, mais j'ai souvent des décalages.
Si quelqu'un a une idée, je suis preneur :mrgreen:
Merci par avance.
Pour tester :
ShowMeYCurve(xDatesFR, xYieldsFR, xcFRGeneric, 'FR Govt') ;
http://www.developpez.net/forums/att...1&d=1181897572