# Cannot make a TGraph2D plot

**URL:** <https://root-forum.cern.ch/t/cannot-make-a-tgraph2d-plot/9527>\
**Category:** ROOT\
**Created:** [January 23, 2010, 12:22am UTC](https://root-forum.cern.ch/t/cannot-make-a-tgraph2d-plot/9527 "2010-01-23T00:22:59Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![zhiyiliu](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/z/85e7bf/32.png) [@zhiyiliu](https://root-forum.cern.ch/u/zhiyiliu)\
**Post date:** [January 23, 2010, 12:22am UTC](https://root-forum.cern.ch/t/cannot-make-a-tgraph2d-plot/9527/1 "2010-01-23T00:22:59Z")

</div>

Hi,  
I am trying to plot 4 points with lines connected. I use the following code:

```auto
  double *x = new double[4];
  double *y = new double[4];
  double *z = new double[4];
  x[0] = 6215.736328;
  x[1] = 5542.363770;
  x[2] = 5518.736816;
  x[3] = 5518.736816;

  y[0] = 3853.795410;
  y[1] = 5270.174805;
  y[2] = 5329.190430;
  y[3] = 5329.190430;
  
  z[0] = 2723.959961;
  z[1] = 2723.959961;
  z[2] = 2723.959961;
  z[3] = 2723.959961;
  
  TGraph2D * g = new TGraph2D(4, x, y, z);

  g->Draw("LINE");
```

However, I was given errors like:

> [@](#):
>
> 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

the problem seems from the Z values. Maybe all points are in the same plane? so I do not know why I cannot plot the points even they are in the same plane. any hint?

Thanks,  
Zhiyi.

---

_[View the full topic](https://root-forum.cern.ch/t/cannot-make-a-tgraph2d-plot/9527)._
