diff options
author | Karl Berry <karl@freefriends.org> | 2023-05-13 20:29:20 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-05-13 20:29:20 +0000 |
commit | dc2e3de3e66d27b63432c7125f94bfaa0cf1824d (patch) | |
tree | 4201a53552cb214ccc2b4a955739816a48625110 /Master/texmf-dist/tex/latex/profcollege/PfCStatistiques.tex | |
parent | 62098fbc130ec6cb9b4a634560e08794e2f0bfb7 (diff) |
profcollege (13may23)
git-svn-id: svn://tug.org/texlive/trunk@67096 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/profcollege/PfCStatistiques.tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/profcollege/PfCStatistiques.tex | 56 |
1 files changed, 46 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/latex/profcollege/PfCStatistiques.tex b/Master/texmf-dist/tex/latex/profcollege/PfCStatistiques.tex index 6be4545dee9..8f63507b5b7 100644 --- a/Master/texmf-dist/tex/latex/profcollege/PfCStatistiques.tex +++ b/Master/texmf-dist/tex/latex/profcollege/PfCStatistiques.tex @@ -158,25 +158,39 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis % Pour construire le diagramme en bâtons \def\Updatetoks#1/#2\nil{\addtotok\toklistepoint{(#1,#2),}}% \newcommand\buildgraph[1][]{% - \newtoks\toklistepoint% + \newtoks\toklistepoint\toklistepoint{}% + \newtoks\toklistecouleur\toklistecouleur{}% + \newtoks\toklistelegende\toklistelegende{}% + \ifboolKV[ClesStat]{LegendeVide}{% + \xdef\foo{\useKV[ClesStat]{LegendesVides}}% + \readlist*\ListeLegendesAEffacer{\foo}% + }{\xdef\foo{-1}\readlist*\ListeLegendesAEffacer{\foo}% + }% + \foreachitem\compteur\in\ListeLegendesAEffacer{\expandafter\UpdateLegende\compteur\nil}% \foreachitem\compteur\in\ListeComplete{\expandafter\Updatetoks\compteur\nil}% - \newtoks\toklistecouleur% \xdef\ListeAvantCouleurs{\useKV[ClesStat]{ListeCouleursB}}% \readlist*\ListeCouleur{\ListeAvantCouleurs}% \foreachitem\couleur\in\ListeCouleur{\expandafter\UpdateCoul\couleur\nil}% - \MPStatNew{\the\toklistepoint}{\the\toklistecouleur}% + \MPStatNew{\the\toklistepoint}{\the\toklistecouleur}{\the\toklistelegende} }% % Pour construire le diagramme en bâtons qualitatif \def\Updatetoksq#1/#2\nil{\addtotok\toklistepointq{"#1",#2,}}% \newcommand\buildgraphq[1][]{% - \newtoks\toklistepointq% + \newtoks\toklistepointq\toklistepointq{}% + \newtoks\toklistecouleur\toklistecouleur{}% + \newtoks\toklistelegende\toklistelegende{}% + \ifboolKV[ClesStat]{LegendeVide}{% + \xdef\foo{\useKV[ClesStat]{LegendesVides}}% + \readlist*\ListeLegendesAEffacer{\foo}% + }{\xdef\foo{-1}\readlist*\ListeLegendesAEffacer{\foo}% + }% + \foreachitem\compteur\in\ListeLegendesAEffacer{\expandafter\UpdateLegende\compteur\nil}% \foreachitem\compteur\in\ListeComplete{\expandafter\Updatetoksq\compteur\nil}% - \newtoks\toklistecouleur% \xdef\ListeAvantCouleurs{\useKV[ClesStat]{ListeCouleursB}}% \readlist*\ListeCouleur{\ListeAvantCouleurs}% \foreachitem\couleur\in\ListeCouleur{\expandafter\UpdateCoul\couleur\nil}% - \MPStatNew{\the\toklistepointq}{\the\toklistecouleur}% + \MPStatNew{\the\toklistepointq}{\the\toklistecouleur}{\the\toklistelegende}% }% \def\UpdateCoul#1\nil{\addtotok\toklistecouleur{#1,}}% @@ -437,20 +451,22 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis unitey:=\useKV[ClesStat]{Unitey}*cm; xpartorigine:=\useKV[ClesStat]{Origine}; AngleRotation=\useKV[ClesStat]{AngleRotationAbscisse}; - boolean Rotation,Lecture,LectureFine,AideLecture,DonneesSup,Reponses,Qualitatif,Tiret; + boolean Rotation,Lecture,LectureFine,AideLecture,DonneesSup,Reponses,Qualitatif,Tiret,LegendeVide,Retour; Rotation=\useKV[ClesStat]{AbscisseRotation}; Lecture:=\useKV[ClesStat]{Lecture}; LectureFine:=\useKV[ClesStat]{LectureFine}; AideLecture:=\useKV[ClesStat]{AideLecture}; DonneesSup:=\useKV[ClesStat]{DonneesSup}; Reponses:=\useKV[ClesStat]{Reponses}; + LegendeVide=\useKV[ClesStat]{LegendeVide}; epaisseurbatons=\useKV[ClesStat]{EpaisseurBatons}; Qualitatif=\useKV[ClesStat]{Qualitatif}; Tiret=\useKV[ClesStat]{Tiret}; + Retour=false; color CoulDefaut; CoulDefaut=\useKV[ClesStat]{CouleurDefaut}; Depart=\useKV[ClesStat]{Depart}; - % + % pair A[],B[],P[]; vardef toto(text t)=%points quantitatif n:=0; @@ -489,11 +505,25 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis } % Construction du graphique en bâtons -\newcommand\MPStatNew[2]{% +\newcommand\MPStatNew[3]{% \ifluatex \mplibforcehmode \begin{mplibcode} \MPStatNewCode + % + vardef Test(expr nb)= + Retour:=false; + op:=0; + for l_=#3: + if l_=nb: + op:=op+1; + fi; + endfor; + if op>0: + Retour:=true; + fi; + enddef; + % % on r\'ecup\`ere les couleurs color Col[]; n:=0; @@ -517,7 +547,10 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis fi; if Reponses: if DonneesSup: + Test(l); + if Retour=false: label.top(TEX("\num{"&decimal(ypart(p_))&"}"),P[l]); + fi; else: if Tiret: trace (B[l]+(-1pt,0))--(B[l]+(1pt,0)); @@ -536,7 +569,10 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis if numeric p_: if Reponses: if DonneesSup: + Test(l); + if Retour=false: label.top(TEX("\num{"&decimal(p_)&"}"),P[l]); + fi; else: if Tiret: trace (B[l]+(-1pt,0))--(B[l]+(1pt,0)); @@ -966,7 +1002,7 @@ Barre=false,Longueur=10cm,Hauteur=5mm,Bicolore=false,EcartBarre=0%Grille est dis if op>0: Retour:=true; fi; - enddef; + enddef; Figure(-10u,-10u,10u,10u); toto(#1); if Legende: |