Problem in TGraphPolar


Does anyone know how to draw a TGraphPolar in the given data?
In the figure 1, I use the code from the user guide to plot a polar graph.

I want to limit the range from 0 to Pi, that is, just the upper half of the graph. I change the rmax to Pi. However, it cannot made the correct plot which I want.

Does anyone know how to solve this problem?


You have to limit theta from 0 to pi instead of the radius r.

I think that doesn’t affect the result because it is just the wrong parameter name which is written in user guide.
After I change the name of parameter, the result remains the same.

What do you want exactly ?

You were just missing to tell the TGraphPolar that your theta are radian (no idea what it expects by default). Then the polar graph is correct. Just add this:

CPol->Update();// Update, otherwise GetPolargram returns 0

Next time please post your script test2.cpp