some minor improvements proposed by BMW: fix data to graph
This commit is contained in:
parent
e55ac4ecee
commit
fc9c573f2a
@ -4780,18 +4780,22 @@ void PMusrCanvas::PlotData(Bool_t unzoom)
|
|||||||
|
|
||||||
// add all data to fMultiGraphData
|
// add all data to fMultiGraphData
|
||||||
for (UInt_t i=0; i<fNonMusrData.size(); i++) {
|
for (UInt_t i=0; i<fNonMusrData.size(); i++) {
|
||||||
// the next two lines are ugly but needed for the following reasons:
|
// the next three lines are ugly but needed for the following reasons:
|
||||||
// TMultiGraph is taking ownership of the TGraphErrors, hence a deep copy is needed.
|
// TMultiGraph is taking ownership of the TGraphErrors, hence a deep copy is needed.
|
||||||
// This is not resulting in a memory leak, since the TMultiGraph object will do the cleanup
|
// This is not resulting in a memory leak, since the TMultiGraph object will do the cleanup
|
||||||
TGraphErrors *ge = new TGraphErrors(*(fNonMusrData[i].data));
|
TGraphErrors *ge = new TGraphErrors(*(fNonMusrData[i].data));
|
||||||
|
// Data points and model curves should be fixed on the graph and not dragged around using, e.g., the mouse.
|
||||||
|
ge->SetEditable(false);
|
||||||
fMultiGraphData->Add(ge, "p");
|
fMultiGraphData->Add(ge, "p");
|
||||||
}
|
}
|
||||||
// add all the theory to fMultiGraphData
|
// add all the theory to fMultiGraphData
|
||||||
for (UInt_t i=0; i<fNonMusrData.size(); i++) {
|
for (UInt_t i=0; i<fNonMusrData.size(); i++) {
|
||||||
// the next two lines are ugly but needed for the following reasons:
|
// the next three lines are ugly but needed for the following reasons:
|
||||||
// TMultiGraph is taking ownership of the TGraphErrors, hence a deep copy is needed.
|
// TMultiGraph is taking ownership of the TGraphErrors, hence a deep copy is needed.
|
||||||
// This is not resulting in a memory leak, since the TMultiGraph object will do the cleanup
|
// This is not resulting in a memory leak, since the TMultiGraph object will do the cleanup
|
||||||
TGraphErrors *ge = new TGraphErrors(*(fNonMusrData[i].theory));
|
TGraphErrors *ge = new TGraphErrors(*(fNonMusrData[i].theory));
|
||||||
|
// Data points and model curves should be fixed on the graph and not dragged around using, e.g., the mouse.
|
||||||
|
ge->SetEditable(false);
|
||||||
fMultiGraphData->Add(ge, "l");
|
fMultiGraphData->Add(ge, "l");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4836,6 +4840,11 @@ void PMusrCanvas::PlotData(Bool_t unzoom)
|
|||||||
if (fMultiGraphLegend)
|
if (fMultiGraphLegend)
|
||||||
fMultiGraphLegend->Draw();
|
fMultiGraphLegend->Draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// report canvas status events in non-musr plots
|
||||||
|
if (!fMainCanvas->GetShowEventStatus()) {
|
||||||
|
fMainCanvas->ToggleEventStatus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fDataTheoryPad->Update();
|
fDataTheoryPad->Update();
|
||||||
@ -5018,10 +5027,12 @@ void PMusrCanvas::PlotDifference(Bool_t unzoom)
|
|||||||
|
|
||||||
// add all diff data to fMultiGraphDiff
|
// add all diff data to fMultiGraphDiff
|
||||||
for (UInt_t i=0; i<fNonMusrData.size(); i++) {
|
for (UInt_t i=0; i<fNonMusrData.size(); i++) {
|
||||||
// the next two lines are ugly but needed for the following reasons:
|
// the next three lines are ugly but needed for the following reasons:
|
||||||
// TMultiGraph is taking ownership of the TGraphErrors, hence a deep copy is needed.
|
// TMultiGraph is taking ownership of the TGraphErrors, hence a deep copy is needed.
|
||||||
// This is not resulting in a memory leak, since the TMultiGraph object will do the cleaing
|
// This is not resulting in a memory leak, since the TMultiGraph object will do the cleaing
|
||||||
TGraphErrors *ge = new TGraphErrors(*(fNonMusrData[i].diff));
|
TGraphErrors *ge = new TGraphErrors(*(fNonMusrData[i].diff));
|
||||||
|
// Data points and model curves should be fixed on the graph and not dragged around using, e.g., the mouse.
|
||||||
|
ge->SetEditable(false);
|
||||||
fMultiGraphDiff->Add(ge, "p");
|
fMultiGraphDiff->Add(ge, "p");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user