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 :

Retirer les pourcentages d'un pie chart


Sujet :

MATLAB

  1. #1
    Membre habitué
    Femme Profil pro
    Étudiant
    Inscrit en
    Avril 2018
    Messages
    9
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Avril 2018
    Messages : 9
    Par défaut Retirer les pourcentages d'un pie chart
    Bonjour,

    Je souhaite réaliser 31 pie charts à l'aide d'un subplot mais à chaque fois les pourcentages s'affichent dans les subplots. Comment faire pour les retirer ? Et comment ajouter une légende globale correspondant aux couleurs des pie charts ?

    Voilà une idée du code que j'ai pour l'instant :
    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
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    %% Pie for main contribution to sea level change
     
    %AAO - aerosols
    load('AAO_contrib_MAJ.mat') ;
     
    hold on ; box on ;
    Ax1=subplot(6,6,1);Ax2=subplot(6,6,2);Ax3=subplot(6,6,3);Ax4=subplot(6,6,4);
    Ax5=subplot(6,6,5);Ax6=subplot(6,6,6);Ax7=subplot(6,6,7);Ax8=subplot(6,6,8);
    Ax9=subplot(6,6,9);Ax10=subplot(6,6,10);Ax11=subplot(6,6,11);Ax12=subplot(6,6,12);
    Ax13=subplot(6,6,13);Ax14=subplot(6,6,14);Ax15=subplot(6,6,15);Ax16=subplot(6,6,16);
    Ax17=subplot(6,6,17);Ax18=subplot(6,6,18); Ax19=subplot(6,6,19); Ax20=subplot(6,6,20);
    Ax21=subplot(6,6,21); Ax22=subplot(6,6,22); Ax23=subplot(6,6,23); Ax24=subplot(6,6,24);
    Ax25=subplot(6,6,25); Ax26=subplot(6,6,26); Ax27=subplot(6,6,27); Ax28=subplot(6,6,28);
    Ax29=subplot(6,6,29); Ax30=subplot(6,6,30); Ax31=subplot(6,6,31);
     
    pie(Ax1,AAOcontributionmajchaqueville (1,:));   % Bergen
    pie(Ax2,AAOcontributionmajchaqueville (2,:));   % Stochkolm
    pie(Ax3,AAOcontributionmajchaqueville (3,:));   % Den Helder
    pie(Ax4,AAOcontributionmajchaqueville (4,:));   % Newlyn
    pie(Ax5,AAOcontributionmajchaqueville (5,:));   % Brest
    pie(Ax6,AAOcontributionmajchaqueville (6,:));   % Marseille
    pie(Ax7,AAOcontributionmajchaqueville (7,:));   % Mumbai
    pie(Ax8,AAOcontributionmajchaqueville (8,:));   % Chennai
    pie(Ax9,AAOcontributionmajchaqueville (9,:));   % Diamond Harbour
    pie(Ax10,AAOcontributionmajchaqueville (10,:)); % Ko Taphao Noi
    pie(Ax11,AAOcontributionmajchaqueville (11,:)); % Kanmen
    pie(Ax12,AAOcontributionmajchaqueville (12,:)); % Busan
    pie(Ax13,AAOcontributionmajchaqueville (13,:)); % Cebu
    pie(Ax14,AAOcontributionmajchaqueville (14,:)); % Wajima
    pie(Ax15,AAOcontributionmajchaqueville (15,:)); % Darwin
    pie(Ax16,AAOcontributionmajchaqueville (16,:)); % Townsville
    pie(Ax17,AAOcontributionmajchaqueville (17,:)); % Fremantle
    pie(Ax18,AAOcontributionmajchaqueville (18,:)); % Dunedin
    pie(Ax19,AAOcontributionmajchaqueville (19,:)); % Fort Denison
    pie(Ax20,AAOcontributionmajchaqueville (20,:)); % Kwajelein
    pie(Ax21,AAOcontributionmajchaqueville (21,:)); % Pago Pago
    pie(Ax22,AAOcontributionmajchaqueville (22,:)); % Midway Island
    pie(Ax23,AAOcontributionmajchaqueville (23,:)); % Honolulu
    pie(Ax24,AAOcontributionmajchaqueville (24,:)); % Seattle
    pie(Ax25,AAOcontributionmajchaqueville (25,:)); % San Francisco
    pie(Ax26,AAOcontributionmajchaqueville (26,:)); % San Diego
    pie(Ax27,AAOcontributionmajchaqueville (27,:)); % Balboa
    pie(Ax28,AAOcontributionmajchaqueville (28,:)); % Antofagasta
    pie(Ax29,AAOcontributionmajchaqueville (29,:)); % Montevideo
    pie(Ax30,AAOcontributionmajchaqueville (30,:)); % Key West
    pie(Ax31,AAOcontributionmajchaqueville (31,:)); % New York
    text (10,-2, 'Contribution of the different contributors for the change of the level of the sea') ;
    Comme vous pouvez le voir le résultat n'est pas lisible du tout...
    Nom : pie chart.jpg
Affichages : 324
Taille : 129,5 Ko

    Merci d'avance pour votre aide

  2. #2
    Rédacteur/Modérateur

    Avatar de Jerome Briot
    Homme Profil pro
    Freelance mécatronique - Conseil, conception et formation
    Inscrit en
    Novembre 2006
    Messages
    20 317
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Freelance mécatronique - Conseil, conception et formation

    Informations forums :
    Inscription : Novembre 2006
    Messages : 20 317
    Par défaut
    Essaie 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
    figure
     
    for n = 1:4
     
        subplot(2, 2, n)
        X = rand(1, 5);
        p = pie(X);
        if n == 1
            hp = p(1:2:end);
        end
     
    end
     
    % Suppression des pourcentages
    ht = findobj('type', 'text');
    delete(ht)
     
    % Ajout de la légende
    leg = legend(hp, {'A' 'B' 'C' 'D' 'E'});
     
    % Positionnement de la légende
    pos = get(leg, 'position');
    pos(1) = 0.5-pos(3)/2;
    pos(2) = 0.5-pos(4)/2;
    set(leg, 'position', pos)
    Images attachées Images attachées  

Discussions similaires

  1. Réponses: 2
    Dernier message: 14/12/2011, 11h13
  2. [GRAPH] Detail PIE CHART : Pourcentages à l'interieur
    Par kmel53 dans le forum ODS et reporting
    Réponses: 1
    Dernier message: 25/11/2011, 11h19
  3. Réponses: 0
    Dernier message: 20/01/2011, 12h30
  4. [debutant] Retirer les bords de Jcomponent
    Par cosmos.1097 dans le forum Agents de placement/Fenêtres
    Réponses: 4
    Dernier message: 29/06/2005, 17h27
  5. [LG]Retirer les blancs dans une chaine
    Par Andy_24DB dans le forum Langage
    Réponses: 16
    Dernier message: 25/02/2004, 16h30

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