How to avoid flickering in Graphical drawings using X11

VigneshK
We are drawing graph in a window. We are updating the curves for every 50ms
with the values received from hardware say like sensors.
We need to display the values in graphical format. So we are updating the
graph for every 50ms. This gives flickering issue.
We are writing the code in X11. Is there a way to avoid flickering in
graphical drawing in X11. Thanks in advance.