How can i draw scatter plot?

I type the follow line but it shows same error.

Yes sure, but what is the printout given by this command ?

Error in TCanvas::Range: illegal world coordinates range: x1=0.000000, y1=-0.125000, x2=0.000000, y2=1.125000
Error in TCanvas::RangeAxis: illegal axis coordinates range: xmin=0.000000, ymin=0.000000, xmax=0.000000, ymax=1.000000
xmin = 0, ymin = 0, xmax = 0, ymax = 0JIT has not been linked in.

*** Break *** segmentation violation
Generating stack trace…
0x00007f5c8e6b84c0 in from /usr/lib64/dri/swrast_dri.so
0x00007f5c8e6a1d06 in from /usr/lib64/dri/swrast_dri.so
0x00007f5c8e2c551f in from /usr/lib64/dri/swrast_dri.so
0x00007f5c8e298703 in from /usr/lib64/dri/swrast_dri.so
0x00007f5c8e27b5ea in from /usr/lib64/dri/swrast_dri.so
0x00007f5c8e27ba98 in from /usr/lib64/dri/swrast_dri.so
0x00007f5c8e27bfc3 in from /usr/lib64/dri/swrast_dri.so
0x00007f5c8e27d6dd in from /usr/lib64/dri/swrast_dri.so
0x00007f5c91ba0953 in Rgl::Pad::FillAttribSet::FillAttribSet(Rgl::Pad::PolygonStippleSet const&, bool) + 0xb3 from /home/cupsoft/Products/ROOT/V6.04.14/lib/libRGL.so
0x00007f5c91bac7ab in TGLPadPainter::DrawBox(double, double, double, double, TVirtualPadPainter::EBoxMode) + 0xeb from /home/cupsoft/Products/ROOT/V6.04.14/lib/libRGL.so
0x00007f5c95bc7bb1 in TPad::PaintBox(double, double, double, double, char const*) + 0x3e1 from /home/cupsoft/Products/ROOT/V6.04.14/lib/libGpad.so
0x00007f5c958cdee3 in TBox::PaintBox(double, double, double, double, char const*) + 0xa3 from /home/cupsoft/Products/ROOT/V6.04.14/lib/libGraf.so
0x00007f5c958b8d28 in TWbox::PaintWbox(double, double, double, double, short, short, short) + 0x48 from /home/cupsoft/Products/ROOT/V6.04.14/lib/libGraf.so
0x00007f5c958fb3be in TFrame::Paint(char const*) + 0x3e from /home/cupsoft/Products/ROOT/V6.04.14/lib/libGraf.so
0x00007f5c880dfac6 in THistPainter::Paint(char const*) + 0x516 from /home/cupsoft/Products/ROOT/V6.04.14/lib/libHistPainter.so
0x00007f5c91bbade4 in TGLHistPainter::Paint(char const*) + 0x1b4 from /home/cupsoft/Products/ROOT/V6.04.14/lib/libRGL.so
0x00007f5c95bd1a3c in TPad::Paint(char const*) + 0x1bc from /home/cupsoft/Products/ROOT/V6.04.14/lib/libGpad.so
0x00007f5c95be6f2c in TCanvas::Flush() + 0x9c from /home/cupsoft/Products/ROOT/V6.04.14/lib/libGpad.so
0x00007f5c95be7116 in TCanvas::Update() + 0xe6 from /home/cupsoft/Products/ROOT/V6.04.14/lib/libGpad.so
0x00007f5c95bbd803 in TPad::DrawFrame(double, double, double, double, char const*) + 0x1b3 from /home/cupsoft/Products/ROOT/V6.04.14/lib/libGpad.so
0x00007f5ca40e9526 in
0x00007f5ca40e9042 in
0x00007f5c9fc2c1a6 in cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) + 0x1b6 from /home/cupsoft/Products/ROOT/V6.04.14/lib/libCling.so
0x00007f5c9fc2fd07 in cling::Interpreter::EvaluateInternal(std::basic_string<char, std::char_traits, std::allocator > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**) + 0x157 from /home/cupsoft/Products/ROOT/V6.04.14/lib/libCling.so
0x00007f5c9fc2fe9f in cling::Interpreter::echo(std::basic_string<char, std::char_traits, std::allocator > const&, cling::Value*) + 0x1f from /home/cupsoft/Products/ROOT/V6.04.14/lib/libCling.so
0x00007f5c9fcdce89 in cling::MetaSema::actOnxCommand(llvm::StringRef, llvm::StringRef, cling::Value*) + 0x1d9 from /home/cupsoft/Products/ROOT/V6.04.14/lib/libCling.so
0x00007f5c9fce5ee9 in cling::MetaParser::isXCommand(cling::MetaSema::ActionResult&, cling::Value*) + 0x129 from /home/cupsoft/Products/ROOT/V6.04.14/lib/libCling.so
0x00007f5c9fce6eae in cling::MetaParser::isCommand(cling::MetaSema::ActionResult&, cling::Value*) + 0x7e from /home/cupsoft/Products/ROOT/V6.04.14/lib/libCling.so
0x00007f5c9fce78eb in cling::MetaProcessor::process(char const*, cling::Interpreter::CompilationResult&, cling::Value*) + 0x16b from /home/cupsoft/Products/ROOT/V6.04.14/lib/libCling.so
0x00007f5c9fbbc893 in TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) + 0xc53 from /home/cupsoft/Products/ROOT/V6.04.14/lib/libCling.so
0x00007f5c9fb9c11b in TCling::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) + 0x8b from /home/cupsoft/Products/ROOT/V6.04.14/lib/libCling.so
0x00007f5ca3b2f7cc in TApplication::ExecuteFile(char const*, int*, bool) + 0x7ac from /home/cupsoft/Products/ROOT/V6.04.14/lib/libCore.so
0x00007f5ca3b2ed42 in TApplication::ProcessLine(char const*, bool, int*) + 0x7e2 from /home/cupsoft/Products/ROOT/V6.04.14/lib/libCore.so
0x00007f5ca36f8b45 in TRint::ProcessLineNr(char const*, char const*, int*) + 0x125 from /home/cupsoft/Products/ROOT/V6.04.14/lib/libRint.so
0x00007f5ca36f9f78 in TRint::Run(bool) + 0x218 from /home/cupsoft/Products/ROOT/V6.04.14/lib/libRint.so
0x000000000040103c in main + 0x4c from /home/cupsoft/Products/ROOT/V6.04.14/bin/root.exe
0x00007f5ca2c02b15 in __libc_start_main + 0xf5 from /lib64/libc.so.6
0x00000000004010ad in from /home/cupsoft/Products/ROOT/V6.04.14/bin/root.exe
Root > JIT has not been linked in.

xmin = 0, ymin = 0, xmax = 0, ymax = 0

All 0, that can not work.
Post your macro and the data file so we can run it and fix it.

{
  // TFile *f = TFile::Open("mrgd_M001506.root.000");
  // TTree *ntp; f->GetObject("ntp", ntp);
  gStyle->SetCanvasPreferGL(1); // needed for color transparency
  Double_t alpha = 0.25; // e.g. 0.25 or 0.33 or 0.5
  TCanvas *c = new TCanvas("c", "c");
  TMultiGraph *mg =
    new TMultiGraph("mg", "all crystals;crystal*.energy;crystal1.energyD");
  ntp->SetMarkerColorAlpha(kBlack, alpha);
  ntp->Draw("crystal1.energyD : crystal1.energy", "");
  mg->Add((TGraph*)gPad->GetPrimitive("Graph")->Clone());
  ntp->SetMarkerColorAlpha(kRed, alpha);
  ntp->Draw("crystal1.energyD : crystal2.energy", "");
  mg->Add((TGraph*)gPad->GetPrimitive("Graph")->Clone());
  ntp->SetMarkerColorAlpha(kGreen, alpha);
  ntp->Draw("crystal1.energyD : crystal3.energy", "");
  mg->Add((TGraph*)gPad->GetPrimitive("Graph")->Clone());
  ntp->SetMarkerColorAlpha(kBlue, alpha);
  ntp->Draw("crystal1.energyD : crystal4.energy", "");
  mg->Add((TGraph*)gPad->GetPrimitive("Graph")->Clone());
  mg->Draw("AP");
  gPad->Modified(); gPad->Update();
}

How can i post the data file?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.