Log of /trunk/hist/histpainter/src/TGraphPainter.cxx
Parent Directory
Revision
44358 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed May 30 12:53:15 2012 UTC (2 years, 7 months ago) by
couet
File length: 142956 byte(s)
Diff to
previous 43329
Fix http://root.cern.ch/phpBB3/viewtopic.php?f=3&t=8591.
When drawn with option SAME the histogram 1st and last bins might be wrong.
The following macro showed the problem.:
{
TCanvas *c = new TCanvas("c","c",900,900);
c->Divide (1,2);
TH1D * histo1 = new TH1D ("histo1","histo1",100,0.,100.) ;
histo1->SetBinContent(51,80.) ;
TH1D * histo2 = new TH1D ("histo2","histo2",100,49.9,51.1) ; /// not ok
histo2->SetMinimum(0.) ; histo2->SetMaximum(100.) ;
c->cd(1);
gPad->DrawFrame(49.9, 0., 51.1, 100);
histo1->Draw("same");
Double_t xAxis[4] = {3., 5., 7., 9.};
TH1D *histo = new TH1D("histo","",3, xAxis);
histo->SetBinContent(1,2.);
histo->SetBinContent(2,4.);
histo->SetBinContent(3,3.);
c->cd(2);
gPad->DrawFrame(4.,0., 10.,5.);
histo->Draw("same");
}
Revision
43329 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Mar 12 15:05:32 2012 UTC (2 years, 10 months ago) by
couet
File length: 142749 byte(s)
Diff to
previous 42646
- In some case, when a graph had some some vertical parts, the exclusion zone was not drawn correctly. The following small example showed the problem:
{
TCanvas *c1 = new TCanvas();
gPad->DrawFrame(-1,-1,3,3);
TGraph * graph=new TGraph(3);
graph->SetFillColor(3);
graph->SetFillStyle(3001);
graph->SetLineWidth(2000);
graph->SetPoint(0,1.,1.);
graph->SetPoint(1,1.,0);
graph->SetPoint(2,0.,0.);
graph->Draw("*L");
}
Revision
40949 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Tue Sep 20 13:11:58 2011 UTC (3 years, 4 months ago) by
couet
File length: 142194 byte(s)
Diff to
previous 40909
fix https://savannah.cern.ch/bugs/index.php?83910.
In TGraphPainter::PaintGraphErrors and related functions, the caps that are drawn when option "[]" is specified are drawn as a sequence of three separate lines. This results in an ugly concave jag at each corner. The caps are now drawn using TPad::PaintPolyLine, the default miter line joins makes those jags go away.
Revision
38181 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Feb 21 14:41:32 2011 UTC (3 years, 11 months ago) by
couet
File length: 138482 byte(s)
Diff to
previous 36424
- Implement the option "0" for graphs with error bars:
"By default, when a data point is outside the visible range
along the Y axis the error bars are not drawn. Combined with
other options, this option forces error bars' drawing for the
data points outside the visible range along the Y axis."
A similar option already existed for histograms.
Revision
32930 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Apr 9 16:18:32 2010 UTC (4 years, 9 months ago) by
pcanal
File length: 137164 byte(s)
Diff to
previous 32330
Prefer the use of InheritsFrom(TClass*) over InheritsFrom(const char*) as long as
it does not increase the library dependencies.
Revision
32330 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Feb 11 14:24:46 2010 UTC (4 years, 11 months ago) by
couet
File length: 137054 byte(s)
Diff to
previous 32035
- The following macro displayed the hitograms outside of the frame.
{
TCanvas *c = new TCanvas("c","c");
c->Divide(2,1);
gStyle->SetHistMinimumZero();
TH1F* h = new TH1F("h","h", 44, -0.5, 43.5);
h->SetBarWidth(0.7);
h->SetBarOffset(0.2);
h->SetFillColor(kGreen);
for (int i=0;i<44; i++ ) h->Fill(i, -i-60);
c->cd(1); h->DrawCopy("bar1");
c->cd(2); h->DrawCopy("b");
}
Revision
32035 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jan 18 10:36:01 2010 UTC (5 years ago) by
couet
File length: 136992 byte(s)
Diff to
previous 30638
- When painted with option "2" (errors represented with boxes) the graph with
error bars were not clipped if the boxes were outside the frame limits. This
missing funtionnality was reported here:
https://savannah.cern.ch/bugs/index.php?61476
This problem was visible with TGraphErrors, TGraphAsymmErrors and
TGraphBentErrors (not only with TGraphAsymmErrors as pointed in the bug
report). The following macro showed the problem:
void GraphErrClipBox()
{
TCanvas *c1 = new TCanvas("c1","c1",200,10,700,500);
const Int_t n = 10;
Double_t x[n] = {-0.22, 0.05, 0.25, 0.35, 0.5, 0.61,0.7,0.85,0.89,0.95};
Double_t y[n] = {1,2.9,5.6,7.4,9,9.6,8.7,6.3,4.5,1};
Double_t ex[n] = {.05,.1,.07,.07,10.04,.05,.06,.07,.08,.05};
Double_t ey[n] = {3.8,.7,.6,.5,.4,.4,.5,.6,.7,.8};
Double_t exd[n] = {.0,.0,.0,.0,.0,.0,.0,.0,.0,.0};
Double_t eyd[n] = {.0,.0,.05,.0,.0,.0,.0,.0,.0,.0};
TGraphErrors *gr1 = new TGraphErrors(n,x,y,ex,ey);
gr1->SetFillStyle(3004);
TGraphAsymmErrors *gr2 = new TGraphAsymmErrors(n, x, y, ex, ex, ey, ey);
gr2->SetFillStyle(3005);
TGraphBentErrors *gr3 = new TGraphBentErrors(n,x,y,ex,ex,ey,ey,exd,exd,eyd,eyd);
gr3->SetFillStyle(3006);
c1->DrawFrame(-1,0,1,10);
gr1->Draw("2");
gr2->Draw("2");
gr3->Draw("2");
}
- In PaintGraphBentErrors the fill style was not set for the boxes.
Revision
30638 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Oct 8 15:37:34 2009 UTC (5 years, 3 months ago) by
couet
File length: 135352 byte(s)
Diff to
previous 30244
- When drawn with the option B, a TGraph had the first or/and last bar missing
if its lowest or/and highest value were equal to the minimum or/and maximum
of the pad. The following lines illustrate the problem:
Int_t x[5] = {0,1,2,3,4};
Int_t y[5] = {10,1,2,3,0};
Int_t n = 5;
TGraph *gr = new TGraph(n,x,y);
gr->Draw("AB*");
This problem was submited here: https://savannah.cern.ch/bugs/index.php?53949
Revision
30244 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Sep 18 11:32:31 2009 UTC (5 years, 4 months ago) by
couet
File length: 135346 byte(s)
Diff to
previous 29406
- TGraphAsymmErrors and TGraphBentErrors were not correctly clipped when
paint with the option E3 (filled band) and zoomed.
Revision
28364 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Apr 27 15:35:46 2009 UTC (5 years, 8 months ago) by
couet
File length: 134831 byte(s)
Diff to
previous 27913
- Fix a remaining problem due to the move from TGraph to TGraphPainter:
In TGraphPainter the test on TGraph::kClipFrame should be donne the
following way:
theGraph->TestBit(TGraph::kClipFrame)
in several places the "theGraph->" was missing. This end up
producing a wrong result with the following macro:
{
TH1F * h1 = new TH1F("h1", "h1", 100, -3., 3.);
TH1F * h2 = new TH1F("h2", "h2", 100, -3., 3.);
h1->FillRandom("gaus", 5000);
h2->FillRandom("gaus", 4000);
h1->SetMaximum(100);
h1->Draw();
h2->Draw("same");
}
This problem was mentionned in:
http://root.cern.ch/phpBB2/viewtopic.php?t=8429
Revision
27913 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Mar 23 14:46:11 2009 UTC (5 years, 10 months ago) by
couet
File length: 134791 byte(s)
Diff to
previous 27891
- In PaintGrapHist the option "][" did not
work if the frame line width
(gStyle->SetFrameLineWidth()) was bigger than 1.
Revision
27343 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Feb 4 08:55:50 2009 UTC (5 years, 11 months ago) by
couet
File length: 131579 byte(s)
Diff to
previous 26761
- When adding an object in the list of funtions of a TGraph,
there was a crash at the TGraph drawing time if the
fitting option (gStyle->SetOptFit(1)) was ON. This was
reported in: https://savannah.cern.ch/bugs/?46525
The following macro reproduces the problem:
{
gStyle->SetOptFit(1);
TGraph *gr = new TGraph(2);
gr->SetPoint(0,1,1);
gr->SetPoint(1,2,2);
TLatex *l1 = new TLatex(gr->GetX()[0], gr->GetY()[0], "#1");
gr->GetListOfFunctions()->Add(l1);
gr->Draw("APL");
}
Revision
25647 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Wed Oct 1 13:16:08 2008 UTC (6 years, 3 months ago) by
couet
File length: 131168 byte(s)
Diff to
previous 24899
- When a histogram was drawn in a larger frame than its limits (using the
option "SAME"), the `outside' vertical lines for the first and last bins
were not drawn.
The macro below demonstrates the problem:
{
TH1D h("h", "h", 10., 0., 1.);
h.SetBinContent(1, 1.);
h.SetBinContent(3, 1.);
h.SetBinContent(10, 1.);
h.SetFillColor(1001);
h.SetFillColor(kOrange-2);
h.SetLineColor(kBlack);
TCanvas canvas("canvas");
frame = canvas.DrawFrame(-1., 0., 2., 2.);
h.Draw("SAMEH");
}
This was reported here: https://savannah.cern.ch/bugs/?41364
Revision
24899 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jul 21 16:20:30 2008 UTC (6 years, 6 months ago) by
couet
File length: 131039 byte(s)
Diff to
previous 24896
- Mods in PaintGraphAsymErrors, PaintGraphBentErrors and PaintGraphErrors, to implement
the new option "[]". The old option "[]" has been change to "||". The new option "[]"
is the same as "||" except that some ticks are drawn at the end of the horizontal and
vertical lines at the end of the error bars. This was a request from:
Thomas Ullrich [thomas.ullrich@bnl.gov]
Revision
24414 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Jun 20 13:03:13 2008 UTC (6 years, 7 months ago) by
couet
File length: 125540 byte(s)
Diff to
previous 24311
- Start improving the doc.
- Protection added in case a TGraphPolar is plotted wit option "E"
but has no errors defined.
- The title painted for TGraphPolar was not correct.
Revision
24105 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Jun 2 18:53:37 2008 UTC (6 years, 7 months ago) by
brun
File length: 108943 byte(s)
Diff to
previous 24090
Move back the functionm Zero from TGraphPainter::Zero to TGraph::Zero where it was originally.
This function is not a graphics function and it is used by several applications.
Revision
24084 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Jun 1 15:34:01 2008 UTC (6 years, 7 months ago) by
brun
File length: 111915 byte(s)
Diff to
previous 24066
From Olivier and me:
Split the TGraph classes to move the graphics code to separate classes.
These classes will be moved to the hist directory once the classes will be ok.
The TGraphs are painted via the TVirtualGraphPainter class and its concrete
implementation TGraphPainter.
At the difference of the TH1 classes for which a different painter is created
when drawing each histogram, one single TGraphPainter class is created.
The TGraphPainter class does not have internal state, all the information
from TGraph is passed to the drawing functions via parameters.
This form allows you to request diffs between any two revisions of this file.
For each of the two "sides" of the diff,
enter a numeric revision.