# Problem in making a TGraph plot

**URL:** <https://root-forum.cern.ch/t/problem-in-making-a-tgraph-plot/19066>\
**Category:** ROOT\
**Created:** [April 2, 2015, 8:27am UTC](https://root-forum.cern.ch/t/problem-in-making-a-tgraph-plot/19066 "2015-04-02T08:27:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![henry](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/df705f/32.png) [@henry](https://root-forum.cern.ch/u/henry)\
**Post date:** [April 2, 2015, 8:27am UTC](https://root-forum.cern.ch/t/problem-in-making-a-tgraph-plot/19066/1 "2015-04-02T08:27:07Z")

</div>

Hi to all,

i am trying to produce a simple plot to draw some points on a three-dimensional space.

[code]void macro(){

TCanvas\* tc = new TCanvas(“tc”, “points”, 800, 600);  
TGraph2D\* tg = new TGraph2D(3);

tg-\>SetPoint(0, 5, 5, 0);  
tg-\>SetPoint(1, 10, 5, 0);  
tg-\>SetPoint(2, 10, 10, 0);

tg-\>SetMarkerStyle(6);  
tg-\>SetTitle(“points”);  
tg-\>Draw(“pcol”);  
}[/code]

When i execute it with ROOT 5.34/25 i get the following error:

[quote]Processing macro.C…  
Error in TView3D::ResetView: Error in min-max scope  
Error in TView3D::ResetView: Error in min-max scope  
Error in TView3D::ResetView: Error in min-max scope  
Error in TView3D::SetRange: problem setting view  
Error in TView3D::ResetView: Error in min-max scope  
Error in TCanvas::Range: illegal world coordinates range: x1=0.000000, y1=0.000000, x2=-0.000000, y2=-0.000000  
Error in TCanvas::RangeAxis: illegal axis coordinates range: xmin=0.000000, ymin=0.000000, xmax=-0.000000, ymax=-0.000000  
[/quote]

Changing a single z value of SetPoint to != 0 correctly produces the plot.

I believe this is related to that problem:

[url][Cannot make a TGraph2D plot](https://root-forum.cern.ch/t/cannot-make-a-tgraph2d-plot/9527/1)

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [April 2, 2015, 8:41am UTC](https://root-forum.cern.ch/t/problem-in-making-a-tgraph-plot/19066/2 "2015-04-02T08:41:53Z")

</div>

yes it is the same sort of thing. I will check.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [April 2, 2015, 9:57am UTC](https://root-forum.cern.ch/t/problem-in-making-a-tgraph-plot/19066/3 "2015-04-02T09:57:01Z")

</div>

Now fixed in 6.04, 6.02 and 5.34:  
[root.cern.ch/gitweb?p=root.git; … 69c0fe2ade](https://root.cern.ch/gitweb?p=root.git;a=commitdiff;h=fb971c1cf874ecdc5eedb54aa67f4869c0fe2ade)  
Thanks for reporting.

---

<div class="post-metadata">

**Author:** ![henry](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/h/df705f/32.png) [@henry](https://root-forum.cern.ch/u/henry)\
**Post date:** [April 2, 2015, 10:02am UTC](https://root-forum.cern.ch/t/problem-in-making-a-tgraph-plot/19066/4 "2015-04-02T10:02:09Z")

</div>

Thanks for the quick fix!
