Skip to content

Commit 19651fb

Browse files
authored
Fix for the issue of confidence interval setting not being independent. (#2)
Changes how the fill between command is called to resolve the issue. Version bumps and documentation updates. Some minor preparations for future works.
1 parent e911230 commit 19651fb

File tree

5 files changed

+40
-12
lines changed

5 files changed

+40
-12
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
@Article{Hofmann2017,
3+
author = {Hofmann, Heike and , Hadley, Wickham and and Kafadar, Karen},
4+
date = {2017-07-03},
5+
journaltitle = {Journal of Computational and Graphical Statistics},
6+
title = {Letter-Value Plots: Boxplots for Large Data},
7+
doi = {10.1080/10618600.2017.1305277},
8+
issn = {1061-8600},
9+
number = {3},
10+
pages = {469--477},
11+
url = {https://doi.org/10.1080/10618600.2017.1305277},
12+
urldate = {2025-04-14},
13+
volume = {26},
14+
abstract = {Boxplots are useful displays that convey rough information about the distribution of a variable. Boxplots were designed to be drawn by hand and work best for small datasets, where detailed estimates of tail behavior beyond the quartiles may not be trustworthy. Larger datasets afford more precise estimates of tail behavior, but boxplots do not take advantage of this precision, instead presenting large numbers of extreme, though not unexpected, observations. Letter-value plots address this problem by including more detailed information about the tails using “letter values,” an order statistic defined by Tukey. Boxplots display the first two letter values (the median and quartiles); letter-value plots display further letter values so far as they are reliable estimates of their corresponding quantiles. We illustrate letter-value plots with real data that demonstrate their usefulness for large datasets. All graphics are created using the R package lvplot, and code and data are available in the supplementary materials.},
15+
file = {Full Text PDF:https\://www.tandfonline.com/doi/pdf/10.1080/10618600.2017.1305277:application/pdf},
16+
keywords = {Fourths, Location depth, Order statistics, Quantiles, Tail area},
17+
publisher = {{ASA} Website},
18+
shorttitle = {Letter-Value Plots},
19+
}
20+
21+
@Comment{jabref-meta: databaseType:biblatex;}
337 Bytes
Binary file not shown.

lua-regression/doc/lua-regression-doc.tex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,12 @@
798798
\pagebreak
799799

800800
\section{Changelog}
801+
802+
\subsection*{v1.0.2}
803+
804+
\begin{itemize}
805+
\item Solves the bug with multiple CI plots have the same options regardless of what has been set.
806+
\end{itemize}
801807

802808
\subsection*{v1.0.1}
803809

lua-regression/tex/lua-regression.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ function sigFig(value, digits)
439439
return tonumber(string.format(fmt, value))
440440
end
441441

442-
-- Example outlier filter using Z-scores
442+
-- Outlier filter using Z-scores
443443
function filter_outliers(data, threshold)
444444
if not threshold then return data end
445445

lua-regression/tex/lua-regression.sty

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
% implied warranties of merchantability and fitness for a
2020
% particular purpose.
2121

22-
\ProvidesPackage{lua-regression}[2025/04/06 1.0.1 Lua Regression Plotting project]
22+
\ProvidesPackage{lua-regression}[2025/04/17 1.0.2 Lua Regression Plotting project]
2323

2424
\RequirePackage{ifthen}
2525
\ifluatex
@@ -36,7 +36,6 @@
3636
\RequirePackage{pgfplots}
3737
\usepgfplotslibrary{fillbetween}
3838

39-
% Define the key-value options
4039
% Define the key-value options
4140
\pgfkeys{
4241
/luaregression/.is family, /luaregression,
@@ -97,6 +96,17 @@
9796
{Use '\\begin{tikzpicture} ... \\end{tikzpicture}' with '\\usepackage{pgfplots}'.}%
9897
\fi
9998
\expandafter\addplot\expandafter[\luaregressionpgfoptions] {\polyeq};%
99+
% Plot confidence band if ci=true
100+
\ifthenelse{\equal{\luaregressionci}{true}}{%
101+
\begingroup
102+
\edef\luareg@ci@addplot{%
103+
\noexpand\addplot[fill=\luaregressioncicolor,fill opacity=\luaregressioncifillopacity] fill between[of=quprpath and qlwrpath];%
104+
}
105+
\addplot[name path=qlwrpath,draw=none] coordinates {\qlwr};
106+
\addplot[name path=quprpath,draw=none] coordinates {\qupr};
107+
\luareg@ci@addplot
108+
\endgroup
109+
}{}%
100110
% Construct the legend entry dynamically
101111
\begingroup
102112
\def\legendentry{}%
@@ -115,14 +125,5 @@
115125
\expandafter\addlegendentry\expandafter{\legendentry}%
116126
\fi
117127
\endgroup
118-
% Plot confidence band if ci=true
119-
\ifthenelse{\equal{\luaregressionci}{true}}{%
120-
\addplot[name path=qlwrpath,draw=none] coordinates {\qlwr};
121-
\addplot[name path=quprpath,draw=none] coordinates {\qupr};
122-
\addplot[
123-
fill=\luaregressioncicolor,
124-
fill opacity=\luaregressioncifillopacity
125-
] fill between[of=quprpath and qlwrpath];
126-
}{}%
127128
}{}%
128129
}

0 commit comments

Comments
 (0)