formatter.format( "\\definecolor{%s}{rgb}{%.2f, %.2f, %.2f}%n",
colorString, color.getRed()/255.0, color.getGreen()/255.0,
color.getBlue()/255.0);
}
HistogramBin currentBin=null;
while(iter.hasNext()) {
double currentMargin;
currentBin = (HistogramBin)iter.next();
currentMargin = ((margin*(currentBin.getEndBoundary()-currentBin.getStartBoundary())))*XScale;
if ((currentBin.getStartBoundary() >= xmin && currentBin.getStartBoundary() <= xmax)
&& (currentBin.getCount() >= ymin && currentBin.getCount() <= ymax) )
{
var = Math.min( currentBin.getEndBoundary(), xmax);
if (filled[i]) {
formatter.format("\\filldraw [line width=%.2fpt, opacity=%.2f, color=%s] ([xshift=%.4f] %.4f, %.4f) rectangle ([xshift=-%.4f] %.4f, %.4f); %%%n",
lineWidth[i], (color.getAlpha()/255.0), colorString,
currentMargin, (currentBin.getStartBoundary()-XShift)*XScale, 0.0,
currentMargin, (var-XShift)*XScale, (currentBin.getCount()-YShift)*YScale);
}
else {
formatter.format("\\draw [line width=%.2fpt, color=%s] ([xshift=%.4f] %.4f, %.4f) rectangle ([xshift=-%.4f] %.4f, %.4f); %%%n",
lineWidth[i], colorString,
currentMargin, (currentBin.getStartBoundary()-XShift)*XScale, 0.0,
currentMargin, (var-XShift)*XScale, (currentBin.getCount()-YShift)*YScale);
}
}
else if ( (currentBin.getStartBoundary() >= xmin && currentBin.getStartBoundary() <= xmax)
&& (currentBin.getCount() >= ymin && currentBin.getCount() > ymax) )
{ // Cas ou notre rectangle ne peut pas etre affiche en entier (trop haut)
var = Math.min( currentBin.getEndBoundary(), xmax);
if (filled[i]) {
formatter.format("\\filldraw [line width=%.2fpt, opacity=%.2f, color=%s] ([xshift=%.4f] %.4f, %.4f) rectangle ([xshift=-%.4f] %.4f, %.4f); %%%n",
lineWidth[i], (color.getAlpha()/255.0), colorString,
currentMargin, (currentBin.getStartBoundary()-XShift)*XScale, 0.0,
currentMargin, (var-XShift)*XScale, (ymax-YShift)*YScale);
formatter.format("\\draw [line width=%.2fpt, color=%s, style=dotted] ([xshift=%.4f] %.4f, %.4f) rectangle ([yshift=3mm, xshift=-%.4f] %.4f, %.4f); %%%n",
lineWidth[i], colorString,
currentMargin, (currentBin.getStartBoundary()-XShift)*XScale, (ymax-YShift)*YScale,
currentMargin, (var-XShift)*XScale, (ymax-YShift)*YScale);
}
else {
formatter.format("\\draw [line width=%.2fpt, color=%s] ([xshift=%.4f] %.4f, %.4f) rectangle ([xshift=-%.4f] %.4f, %.4f); %%%n",
lineWidth[i], colorString,
currentMargin, (currentBin.getStartBoundary()-XShift)*XScale, 0.0,
currentMargin, (var-XShift)*XScale, (ymax-YShift)*YScale);
formatter.format("\\draw [line width=%.2fpt, color=%s, style=dotted] ([xshift=%.4f] %.4f, %.4f) rectangle ([yshift=3mm, xshift=-%.4f] %.4f, %.4f); %%%n",
lineWidth[i], colorString,
currentMargin, (currentBin.getStartBoundary()-XShift)*XScale, (ymax-YShift)*YScale,
currentMargin, (var-XShift)*XScale, (ymax-YShift)*YScale);
}
}
}
}