How to plot orbit of binary star and calculate its orbital elements? I have a set of dates, position angles ($\theta$) and angular separations ($\rho$) for visual binary star. For example:

1994.3132  57.0    0.097
1996.1783  73.4    0.051
2006.1938 182.0    0.126
2009.2597 192.9    0.152
etc.


What are algorithms to calculate orbital elements and to plot the orbit of the binary star?

Are there available codes (or programs) for this calculations?
If it's a binary, it's fairly simple (in comparison with a ternary system), because the stars of the binary orbit about their common barycenter in Kepler ellipses.

An orbit simulator, see here; replace the central star by the barycenter of the binaries.

Calculation of an Orbit from Three Observations. Kepler problem on Wikipedia.

If you don't find a ready-to-use software, try to solve it numerically by simulating the orbit of the binaries according to Kepler's law, and vary mass, distance, excentricity assumptions until they match to the observations. Use optimization methods, e.g. hill climbing algorithms, or gradient methods.