summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/proflycee/tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-06-03 03:01:14 +0000
committerNorbert Preining <norbert@preining.info>2023-06-03 03:01:14 +0000
commit644a486a866b7bcbf8fccb37cf6f88a36897deb0 (patch)
treeb8593330c0b54d298644dacf70e3b79918acf6b2 /macros/latex/contrib/proflycee/tex
parentde88ff1738cd9e29da5d2ce94b53d9035d9be6a4 (diff)
CTAN sync 202306030301
Diffstat (limited to 'macros/latex/contrib/proflycee/tex')
-rw-r--r--macros/latex/contrib/proflycee/tex/ProfLycee.sty3
-rw-r--r--macros/latex/contrib/proflycee/tex/proflycee-tools-graphiques.tex6
-rw-r--r--macros/latex/contrib/proflycee/tex/proflycee-tools-stats.tex254
3 files changed, 259 insertions, 4 deletions
diff --git a/macros/latex/contrib/proflycee/tex/ProfLycee.sty b/macros/latex/contrib/proflycee/tex/ProfLycee.sty
index 959754bc90..3e3d3cd558 100644
--- a/macros/latex/contrib/proflycee/tex/ProfLycee.sty
+++ b/macros/latex/contrib/proflycee/tex/ProfLycee.sty
@@ -3,7 +3,8 @@
% or later, see http://www.latex-project.org/lppl.txtf
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{ProfLycee}[2023/05/28 2.6.6 Aide pour l'utilisation de LaTeX en lycee]
+\ProvidesPackage{ProfLycee}[2023/06/02 2.6.7 Aide pour l'utilisation de LaTeX en lycee]
+% 2.6.7 Correction de bugs mineurs + Histogramme (classes régulières ou non)
% 2.6.6 Externalisation du style Tikz mainlevee (dans tikz2d-fr)
% 2.6.5 Ajout d'une option[noamssymb] pour éviter les clashs avec fourier (merci PfC) + Corections de bugs
% 2.6.4 Correction d'un dysfonctionnement avec les racines (oubli du \num) + Equation diophantienne ax+by=c + Eq cartésiennes (plan & droite) + Corrections de bugs mineurs
diff --git a/macros/latex/contrib/proflycee/tex/proflycee-tools-graphiques.tex b/macros/latex/contrib/proflycee/tex/proflycee-tools-graphiques.tex
index 0ddb801129..fbcc1910e1 100644
--- a/macros/latex/contrib/proflycee/tex/proflycee-tools-graphiques.tex
+++ b/macros/latex/contrib/proflycee/tex/proflycee-tools-graphiques.tex
@@ -331,13 +331,13 @@
\def\axesenlargyD{\fpeval{\axeselargyD*(\ymax-\ymin)}}
%on affiche les deux axes
\draw[line width=\axeswidth,-{\axestypefleche[scale=\axesechellefleche]}] ({\xmin-\axexOx-\axesenlargxG},0) -- ({\xmax-\axexOx+\axesenlargxD},0) ;
- \draw[line width=\axeswidth,-{\axestypefleche[scale=\axesechellefleche]}] (0,{\ymin-\axeyOy-\axesenlargyG}) -- (0,{\ymax-\axeyOy++\axesenlargyD}) ;
+ \draw[line width=\axeswidth,-{\axestypefleche[scale=\axesechellefleche]}] (0,{\ymin-\axeyOy-\axesenlargyG}) -- (0,{\ymax-\axeyOy+\axesenlargyD}) ;
%les labels éventuels
\IfSubStr{\axesafflabel}{x}%
- {\draw ({\xmax-\axexOx},0) node[\axesposlabelx,font=\axesfont] {\axeslabelx} ;}
+ {\draw ({\xmax-\axexOx+\axesenlargxD},0) node[\axesposlabelx,font=\axesfont] {\axeslabelx} ;}
{}
\IfSubStr{\axesafflabel}{y}%
- {\draw (0,{\ymax-\axeyOy}) node[\axesposlabely,font=\axesfont] {\axeslabely} ;}
+ {\draw (0,{\ymax-\axeyOy+\axesenlargyD}) node[\axesposlabely,font=\axesfont] {\axeslabely} ;}
{}
}
diff --git a/macros/latex/contrib/proflycee/tex/proflycee-tools-stats.tex b/macros/latex/contrib/proflycee/tex/proflycee-tools-stats.tex
index cc57e1fbf9..519783285a 100644
--- a/macros/latex/contrib/proflycee/tex/proflycee-tools-stats.tex
+++ b/macros/latex/contrib/proflycee/tex/proflycee-tools-stats.tex
@@ -8,6 +8,8 @@
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
+%2.6.7 Histogrammes
+
%%------RegressionLinéaire
%calcul des paramètres
\defKV[coeffreglin]{%
@@ -195,4 +197,256 @@
{}
}
+%%------HISTOGRAMME
+\defKV[histostats]{%
+ ListeCouleurs=\def\HistoCouleurs{#1},%
+ Largeur=\def\HistoLargeur{#1},%
+ Hauteur=\def\HistoHauteur{#1},%
+ GradX=\def\HistoGradX{#1},%
+ GradY=\def\HistoGradY{#1},%
+ PosEffectifs=\def\HistoPosEff{#1},%
+ LabelX=\def\HistoLabelx{#1},%
+ LabelY=\def\HistoLabely{#1},%
+ ElargirX=\def\HistoElargirx{#1},%
+ ElargirY=\def\HistoElargiry{#1},%
+ PoliceAxes=\def\HistoFonte{#1},%
+ PoliceEffectifs=\def\HistoFonteEff{#1},%
+ Opacite=\def\HistoOpac{#1},%
+ DebutOx=\def\HistoDebX{#1},%
+ FinOx=\def\HistoFinX{#1},%
+ EpaisseurTraits=\def\HistoEptraits{#1}
+}
+
+\setKVdefault[histostats]{%
+ ListeCouleurs=orange,%
+ Largeur=10,%
+ Hauteur=5,%
+ GradX={},%
+ GradY={},%
+ AffEffectifs=true,%
+ PosEffectifs=milieu,%
+ ElargirX=5mm,%
+ ElargirY=5mm,%
+ LabelX={},%
+ LabelY={},%
+ PoliceAxes=\normalsize\normalfont,%
+ PoliceEffectifs=\normalsize\normalfont,%
+ AffBornes=false,%
+ Remplir=true,%
+ Opacite=0.5,%
+ GrilleV=true,%
+ DebutOx={},%
+ FinOx={},%
+ EpaisseurTraits=semithick
+}
+
+\NewDocumentCommand\Histogramme{ s O{} m }{%
+ \useKVdefault[histostats]%
+ \setKV[histostats]{#2}%
+ \setsepchar[.]{ ./}%
+ \readlist*\LISTDONNEES{#3}%
+ \IfEq{\HistoDebX}{}%on stocke le début de l'axe Ox si besoin
+ {\itemtomacro\LISTDONNEES[1,1]{\HistoDebX}}{}%
+ \IfEq{\HistoFinX}{}%on stocke la fin de l'axe Ox si besoin
+ {\itemtomacro\LISTDONNEES[-1,2]{\HistoFinX}}{}%
+ \setsepchar{,}%
+ \readlist*\LISTCOUL{\HistoCouleurs}%
+ %distinction suivant largeur classes
+ \IfBooleanTF{#1}%étoilé := classe d'amplitudes différentes
+ {%
+
+ \xdef\ListeHauteurs{\fpeval{(\LISTDONNEES[1,3])/(\LISTDONNEES[1,2]-\LISTDONNEES[1,1])}}
+ \foreach \i in {2,...,\LISTDONNEESlen}
+ {%
+ \xdef\ListeHauteurs{\ListeHauteurs,\fpeval{(\LISTDONNEES[\i,3])/(\LISTDONNEES[\i,2]-\LISTDONNEES[\i,1])}}%
+ }%
+ \xdef\maxhauteurs{\xinteval{round(max(\ListeHauteurs),3)}}%
+ \xdef\HistoUniteY{\xinteval{round(\HistoHauteur/max(\ListeHauteurs),3)}}%
+ \xdef\HistoUniteX{\xinteval{round(\HistoLargeur/(\HistoFinX-\HistoDebX),3)}}%
+ %fenêtre graphique
+ \begin{tikzpicture}[x=\HistoUniteX cm,y=\HistoUniteY cm]
+ \foreach \i in {1,...,\LISTDONNEESlen}
+ {%
+ \xintifboolexpr{\LISTCOULlen == 1}%
+ {\def\couleurhisto{\HistoCouleurs}}%
+ {\itemtomacro\LISTCOUL[\i]{\couleurhisto}}%
+ \ifboolKV[histostats]{AffBornes}%
+ {%
+ \draw[\HistoEptraits] ({\LISTDONNEES[\i,1]},3pt)--++(0,-6pt) node[below,font=\HistoFonte] {\LISTDONNEES[\i,1]} ;
+ \draw[\HistoEptraits] ({\LISTDONNEES[\i,2]},3pt)--++(0,-6pt) node[below,font=\HistoFonte] {\LISTDONNEES[\i,2]} ;
+ }%
+ {}%
+ \ifboolKV[histostats]{Remplir}%
+ {%
+ \draw[\HistoEptraits,fill=\couleurhisto,fill opacity=\HistoOpac] ({\LISTDONNEES[\i,1]},0) rectangle ({\LISTDONNEES[\i,2]},{(\LISTDONNEES[\i,3])/(\LISTDONNEES[\i,2]-\LISTDONNEES[\i,1])}) ;
+ }%
+ {%
+ \draw[\HistoEptraits] ({\LISTDONNEES[\i,1]},0) rectangle ({\LISTDONNEES[\i,2]},{(\LISTDONNEES[\i,3])/(\LISTDONNEES[\i,2]-\LISTDONNEES[\i,1])}) ;
+ }%
+ }%
+ \foreach \x in \HistoGradX
+ {%
+ \draw[\HistoEptraits] (\x,3pt)--++(0,-6pt) node[below,font=\HistoFonte] {\num{\x}} ;
+ }%
+ \ifboolKV[histostats]{AffEffectifs}
+ {%
+ \IfStrEq{\HistoPosEff}{milieu}%
+ {%
+ \foreach \i in {1,...,\LISTDONNEESlen}
+ \draw ({0.5*\LISTDONNEES[\i,1]+0.5*\LISTDONNEES[\i,2]},{0.5*(\LISTDONNEES[\i,3])/(\LISTDONNEES[\i,2]-\LISTDONNEES[\i,1])}) node[font=\HistoFonteEff] {\num{\LISTDONNEES[\i,3]}} ;
+ }%
+ {}%
+ \IfStrEq{\HistoPosEff}{bas}%
+ {%
+ \foreach \i in {1,...,\LISTDONNEESlen}
+ \draw ({0.5*\LISTDONNEES[\i,1]+0.5*\LISTDONNEES[\i,2]},{0}) node[above,font=\HistoFonteEff] {\num{\LISTDONNEES[\i,3]}} ;
+ }%
+ {}%
+ \IfStrEq{\HistoPosEff}{haut}%
+ {%
+ \foreach \i in {1,...,\LISTDONNEESlen}
+ \draw ({0.5*\LISTDONNEES[\i,1]+0.5*\LISTDONNEES[\i,2]},{(\LISTDONNEES[\i,3])/(\LISTDONNEES[\i,2]-\LISTDONNEES[\i,1])}) node[below,font=\HistoFonteEff] {\num{\LISTDONNEES[\i,3]}} ;
+ }%
+ {}%
+ \IfStrEq{\HistoPosEff}{dessus}%
+ {%
+ \foreach \i in {1,...,\LISTDONNEESlen}
+ \draw ({0.5*\LISTDONNEES[\i,1]+0.5*\LISTDONNEES[\i,2]},{(\LISTDONNEES[\i,3])/(\LISTDONNEES[\i,2]-\LISTDONNEES[\i,1])}) node[above,font=\HistoFonteEff] {\num{\LISTDONNEES[\i,3]}} ;
+ }%
+ {}%
+ }%
+ {}%
+ \draw[\HistoEptraits,->,>=latex] ({\HistoDebX},0) -- ({\HistoFinX},0) --++ ({\HistoElargirx},0) node[right,font=\HistoFonte] {\HistoLabelx} ;
+ \end{tikzpicture}%
+ }%
+ {%
+ \xdef\ListeHauteurs{\LISTDONNEES[1,3]}
+ \foreach \i in {2,...,\LISTDONNEESlen}
+ {%
+ \xdef\ListeHauteurs{\ListeHauteurs,\LISTDONNEES[\i,3]}%
+ }%
+ \xdef\maxhauteurs{\xinteval{round(max(\ListeHauteurs),3)}}%
+ \xdef\HistoUniteY{\xinteval{round(\HistoHauteur/max(\ListeHauteurs),3)}}%
+ \xdef\HistoUniteX{\xinteval{round(\HistoLargeur/(\HistoFinX-\HistoDebX),3)}}%
+ %fenêtre graphique
+ \begin{tikzpicture}[x=\HistoUniteX cm,y=\HistoUniteY cm]
+ \ifboolKV[histostats]{GrilleV}%
+ {%
+ \foreach \y in \HistoGradY
+ {%
+ \draw[line width=0.4pt,lightgray] ({\HistoDebX},\y) -- ({\HistoFinX},\y) --++ ({\HistoElargirx},0) ;
+ }%
+ }%
+ {}%
+ \foreach \i in {1,...,\LISTDONNEESlen}
+ {%
+ \xintifboolexpr{\LISTCOULlen == 1}%
+ {\def\couleurhisto{\HistoCouleurs}}%
+ {\itemtomacro\LISTCOUL[\i]{\couleurhisto}}%
+ \ifboolKV[histostats]{AffBornes}%
+ {%
+ \draw[\HistoEptraits] ({\LISTDONNEES[\i,1]},3pt)--++(0,-6pt) node[below,font=\HistoFonte] {\LISTDONNEES[\i,1]} ;
+ \draw[\HistoEptraits] ({\LISTDONNEES[\i,2]},3pt)--++(0,-6pt) node[below,font=\HistoFonte] {\LISTDONNEES[\i,2]} ;
+ }%
+ {}%
+ \ifboolKV[histostats]{Remplir}%
+ {%
+ \draw[\HistoEptraits,fill=\couleurhisto,fill opacity=\HistoOpac] ({\LISTDONNEES[\i,1]},0) rectangle ({\LISTDONNEES[\i,2]},{\LISTDONNEES[\i,3]}) ;
+ }%
+ {%
+ \draw[\HistoEptraits] ({\LISTDONNEES[\i,1]},0) rectangle ({\LISTDONNEES[\i,2]},{\LISTDONNEES[\i,3]}) ;
+ }%
+ }%
+ \foreach \x in \HistoGradX
+ {%
+ \draw[\HistoEptraits] (\x,3pt)--++(0,-6pt) node[below,font=\HistoFonte] {\num{\x}} ;
+ }%
+ \foreach \y in \HistoGradY
+ {%
+ \draw[\HistoEptraits] ($({\HistoDebX},\y)+(3pt,0)$) --++ (-6pt,0) node[left,font=\HistoFonte] {\num{\y}} ;
+ }%
+ \ifboolKV[histostats]{AffEffectifs}
+ {%
+ \IfStrEq{\HistoPosEff}{milieu}%
+ {%
+ \foreach \i in {1,...,\LISTDONNEESlen}
+ \draw ({0.5*\LISTDONNEES[\i,1]+0.5*\LISTDONNEES[\i,2]},{0.5*\LISTDONNEES[\i,3]}) node[font=\HistoFonteEff] {\num{\LISTDONNEES[\i,3]}} ;
+ }%
+ {}%
+ \IfStrEq{\HistoPosEff}{bas}%
+ {%
+ \foreach \i in {1,...,\LISTDONNEESlen}
+ \draw ({0.5*\LISTDONNEES[\i,1]+0.5*\LISTDONNEES[\i,2]},{0}) node[above,font=\HistoFonteEff] {\num{\LISTDONNEES[\i,3]}} ;
+ }%
+ {}%
+ \IfStrEq{\HistoPosEff}{haut}%
+ {%
+ \foreach \i in {1,...,\LISTDONNEESlen}
+ \draw ({0.5*\LISTDONNEES[\i,1]+0.5*\LISTDONNEES[\i,2]},{\LISTDONNEES[\i,3]}) node[below,font=\HistoFonteEff] {\num{\LISTDONNEES[\i,3]}} ;
+ }%
+ {}%
+ \IfStrEq{\HistoPosEff}{dessus}%
+ {%
+ \foreach \i in {1,...,\LISTDONNEESlen}
+ \draw ({0.5*\LISTDONNEES[\i,1]+0.5*\LISTDONNEES[\i,2]},{\LISTDONNEES[\i,3]}) node[above,font=\HistoFonteEff] {\num{\LISTDONNEES[\i,3]}} ;
+ }%
+ {}%
+ }%
+ {}%
+ \draw[\HistoEptraits,->,>=latex] ({\HistoDebX},0) -- ({\HistoFinX},0) --++ ({\HistoElargirx},0) node[right,font=\HistoFonte] {\HistoLabelx} ;
+ \draw[\HistoEptraits,->,>=latex] ({\HistoDebX},0) -- ({\HistoDebX},{\maxhauteurs}) --++ (0,{\HistoElargiry}) node[above,font=\HistoFonte] {\HistoLabely} ;
+ \end{tikzpicture}%
+ }%
+}
+
+\NewDocumentCommand\HistogrammeTikz{ O{} m }{%
+ \useKVdefault[histostats]%
+ \setKV[histostats]{#1}%
+ \setsepchar[.]{ ./}%
+ \readlist*\LISTDONNEES{#2}%
+ \setsepchar{,}%
+ \readlist*\LISTCOUL{\HistoCouleurs}%
+ \foreach \i in {1,...,\LISTDONNEESlen}
+ {%
+ \xintifboolexpr{\LISTCOULlen == 1}%
+ {\def\couleurhisto{\HistoCouleurs}}%
+ {\itemtomacro\LISTCOUL[\i]{\couleurhisto}}%
+ \ifboolKV[histostats]{Remplir}%
+ {%
+ \draw[line width=1pt,fill=\couleurhisto,fill opacity=\HistoOpac] ({\LISTDONNEES[\i,1]-\axexOx},0) rectangle ({\LISTDONNEES[\i,2]-\axexOx},{\LISTDONNEES[\i,3]}) ;
+ }%
+ {%
+ \draw[line width=1pt] ({\LISTDONNEES[\i,1]-\axexOx},0) rectangle ({\LISTDONNEES[\i,2]-\axexOx},{\LISTDONNEES[\i,3]}) ;
+ }%
+ }%
+ \ifboolKV[histostats]{AffEffectifs}
+ {%
+ \IfStrEq{\HistoPosEff}{milieu}%
+ {%
+ \foreach \i in {1,...,\LISTDONNEESlen}
+ \draw ({0.5*\LISTDONNEES[\i,1]+0.5*\LISTDONNEES[\i,2]-\axexOx},{0.5*\LISTDONNEES[\i,3]}) node[font=\HistoFonteEff] {\num{\LISTDONNEES[\i,3]}} ;
+ }%
+ {}%
+ \IfStrEq{\HistoPosEff}{bas}%
+ {%
+ \foreach \i in {1,...,\LISTDONNEESlen}
+ \draw ({0.5*\LISTDONNEES[\i,1]+0.5*\LISTDONNEES[\i,2]-\axexOx},{0}) node[above,font=\HistoFonteEff] {\num{\LISTDONNEES[\i,3]}} ;
+ }%
+ {}%
+ \IfStrEq{\HistoPosEff}{haut}%
+ {%
+ \foreach \i in {1,...,\LISTDONNEESlen}
+ \draw ({0.5*\LISTDONNEES[\i,1]+0.5*\LISTDONNEES[\i,2]-\axexOx},{\LISTDONNEES[\i,3]}) node[below,font=\HistoFonteEff] {\num{\LISTDONNEES[\i,3]}} ;
+ }%
+ {}%
+ \IfStrEq{\HistoPosEff}{dessus}%
+ {%
+ \foreach \i in {1,...,\LISTDONNEESlen}
+ \draw ({0.5*\LISTDONNEES[\i,1]+0.5*\LISTDONNEES[\i,2]-\axexOx},{\LISTDONNEES[\i,3]}) node[above,font=\HistoFonteEff] {\num{\LISTDONNEES[\i,3]}} ;
+ }%
+ {}%
+ }%
+ {}%
+}
+
\endinput \ No newline at end of file