TGeoPolygon usage

Hello,

I would like to use a TGeoPolygon as background for some text. I cannot get a simple test, drawing a TGeoPolygon, to show anything on the canvas:

#include "TGeoPolygon.h"
#include "TCanvas.h"

void poly () {

  TCanvas *c = new TCanvas("c","Poly Test",600,600);
  //  c->Range(0,0,100,100);
  TGeoPolygon *poly = new TGeoPolygon(4);
   Double_t vx[4] = { 20.0, 20.0, 50.0, 50.0 };
   Double_t vy[4] = { 20.0, 80.0, 80.0, 20.0 };
   poly->SetXY(vx, vy);
   poly->FinishPolygon();
   poly->Draw("l");

}

There’s probably something I’m missing.

Thanks for any help.

Roger

Answering my own post.

Use a TPolyLine instead of a TGeoPolygon for this purpose. If the TPolyLine is closed, then it can be filled and text written over the fill.

Roger