IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

MATLAB Discussion :

affichage des X commence par 1 et avec un pas de 20


Sujet :

MATLAB

  1. #1
    Membre éclairé
    Inscrit en
    Septembre 2009
    Messages
    343
    Détails du profil
    Informations forums :
    Inscription : Septembre 2009
    Messages : 343
    Par défaut affichage des X commence par 1 et avec un pas de 20
    Bonjour,

    Je débute en MATLAB et j'ai un problème:

    j'utilise ce code la pour afficher une courbe:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    y=[0.9753   0.9901    0.9938  0.9969    0.9975    0.9981   0.9981    0.9988    0.9988  0.9988    0.9994  0.9994    0.9994 1.0000 1.0000]
     
    x=[1  20    40 60    80   100  120   140   160   180   200 220   240 260 280]
     
    y = y*1e2;
     
    figure
    hold on;
     
     
    plot(x,y,'R','LineWidth',2)
    xlabel('Rank','fontsize',16,'fontweight','b')
    ylabel('Recognition Rate','fontsize',16,'fontweight','b')
    title('CMC','fontsize',16,'fontweight','b')
    text(200,0.98*1e2,'With Selection','FontSize',13,'Color','r')
    text(0,0.9753*1e2,'\bullet','FontSize',12,'Color','r');
    y=0.97
    y=y*1e2;
    x=1
    hold on;
    plot(x,y,'R','LineWidth',2);
    Mon problème c'est que je veux que l'affichage des X commence par 1 et avec un pas de 20 non pas comme affiché (il commence par 0 et utilise un pas de 50). Pouvez-vous m'aidez à corriger ceci?

    Merci.

  2. #2
    Invité
    Invité(e)
    Par défaut
    Bonjour,

    Pour cela utilise la propriété 'XTick':

  3. #3
    Membre éclairé
    Inscrit en
    Septembre 2009
    Messages
    343
    Détails du profil
    Informations forums :
    Inscription : Septembre 2009
    Messages : 343
    Par défaut
    merci Winjerome,
    ça marche avec ceci:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
     
    y=[0.9753   0.9901    0.9938  0.9969    0.9975    0.9981   0.9981    0.9988    0.9988  0.9988    0.9994  0.9994    0.9994 1.0000 1.0000]
     
    x=[1  20    40 60    80   100  120   140   160   180   200 220   240 260 280]
     
    y = y*1e2;
     
    figure
    hold on;
     
    plot(x,y,'R','LineWidth',2)
    xlabel('Rank','fontsize',16,'fontweight','b')
    ylabel('Recognition Rate','fontsize',16,'fontweight','b')
    title('CMC','fontsize',16,'fontweight','b')
    text(200,0.98*1e2,'With Selection','FontSize',13,'Color','r')
    text(0,0.9753*1e2,'\bullet','FontSize',12,'Color','r');
    y=0.965
    y=y*1e2;
    %x=1
    hold on;
    plot(x,y,'R','LineWidth',2);
    set(gca,'XTick',x)
    maintenant j'ai un autre problème, je veux afficher une autre courbe dans cette même courbe, j'ai essayé avec ceci:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
     
    y=[0.9753   0.9901    0.9938  0.9969    0.9975    0.9981   0.9981    0.9988    0.9988  0.9988    0.9994  0.9994    0.9994 1.0000 1.0000]
     
    x=[1  20    40 60    80   100  120   140   160   180   200 220   240 260 280]
     
    y = y*1e2;
     
    figure
    hold on;
     
    plot(x,y,'R','LineWidth',2)
    xlabel('Rank','fontsize',16,'fontweight','b')
    ylabel('Recognition Rate','fontsize',16,'fontweight','b')
    title('CMC','fontsize',16,'fontweight','b')
    text(200,0.98*1e2,'With Selection','FontSize',13,'Color','r')
    text(0,0.9753*1e2,'\bullet','FontSize',12,'Color','r');
    y=0.965
    y=y*1e2;
    %x=1
    hold on;
    plot(x,y,'R','LineWidth',2);
    set(gca,'XTick',x)
    y1=[0.9698 0.9846 0.9889 0.9895  0.9938    0.9951 0.9957 0.9957    0.9969    0.9988    0.9988    0.9994    1.0000    1.0000 1.0000]
     
    x1=[1  20    40 60    80   100  120   140   160   180   200 220   240 260 280]
    hold on;
    plot(x1,y1,'B','LineWidth',2),text(150,0.98*1e2,'Without Selection','FontSize',13,'Color','b'),
    text(0,0.9698*1e2,'\bullet','FontSize',15,'Color','b');
    L'affichage que j'obtiens est très bizarre et je ne sais où est l'erreur et comment la corriger? Pouvez-vous encore m'aidez?

  4. #4
    Invité
    Invité(e)
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    y=[0.9753   0.9901    0.9938  0.9969    0.9975    0.9981   0.9981    0.9988    0.9988  0.9988    0.9994  0.9994    0.9994 1.0000 1.0000]
    
    x=[1  20    40 60    80   100  120   140   160   180   200 220   240 260 280]
    
    y = y*1e2;
    
    figure
    hold on;
    
    plot(x,y,'R','LineWidth',2)
    xlabel('Rank','fontsize',16,'fontweight','b')
    ylabel('Recognition Rate','fontsize',16,'fontweight','b')
    title('CMC','fontsize',16,'fontweight','b')
    text(200,0.98*1e2,'With Selection','FontSize',13,'Color','r')
    text(0,0.9753*1e2,'\bullet','FontSize',12,'Color','r');
    y=0.965
    y=y*1e2;
    %x=1
    hold on;
    plot(x,y,'R','LineWidth',2);
    set(gca,'XTick',x)
    y1=[0.9698 0.9846 0.9889 0.9895  0.9938    0.9951 0.9957 0.9957    0.9969    0.9988    0.9988    0.9994    1.0000    1.0000 1.0000]
    
    x1=[1  20    40 60    80   100  120   140   160   180   200 220   240 260 280]
    hold on;
    plot(x1,y1*1e2,'B','LineWidth',2),text(150,0.98*1e2,'Without Selection','FontSize',13,'Color','b'),
    text(0,0.9698*1e2,'\bullet','FontSize',15,'Color','b');

Discussions similaires

  1. Réponses: 6
    Dernier message: 19/06/2007, 00h55
  2. recuperation des lignes commencant par -
    Par vince2005 dans le forum Langage
    Réponses: 1
    Dernier message: 24/04/2007, 15h55
  3. Affichage des images générées par une application sous tomcat
    Par don'de dans le forum Tomcat et TomEE
    Réponses: 9
    Dernier message: 09/01/2007, 12h24
  4. Réponses: 1
    Dernier message: 09/10/2006, 20h40
  5. pb affichage des photos incorporées par balises html
    Par laville dans le forum Balisage (X)HTML et validation W3C
    Réponses: 4
    Dernier message: 01/04/2005, 12h47

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo