Modify RDF legend, export the coordination numbers of an atom

Hello everyone,

I am a new user of ovito, I have two questions

  1. I have 6 atom types in my data and I have selected two types to have the RDF of the two selected atoms, however I get my RDF curves, just that the legend of the 4 other atoms that I have deleted still remains on my RDF graph, I just want to keep the legend of the two atoms that I have selected.

  2. I want to export the coordination number of one of the atoms, and I can’t find a way to export or retrieve it,

Can you help me please?

thank you for your attention

Hi Glenn,

To avoid duplicates, this is just let you know that I have answered the email you’ve sent us through the official mail support.


I have the same question, please share with us the answer

Hello Karima,

  1. The Coordination Analysis Modifier takes into account all particle types that are present in the Data source. That means, even if you delete particles of certain types from your system, they will still appear as “nan” entry in the partial RDF data table and legend (see attached screenshot).

Although creating a new Data Table object with your own custom legend is in principle possible through the python scripting interface, see — OVITO Scripting Reference 3.5.4 documentation , you might find it easier to export the computed RDF as “Data/Table” txt file (see marked button in attached screenshot) and plot it with your usual plotting tool.

  1. Particle properties such as the Coordination numbers can be exported through the various file-export function that OVITO offers, e.g. as an xyz-file. Counting can be easily performed inside of OVITO by adding a Python Scripting Modifier, e.g. If you like, you can try the following custom modifier:

from import *

import numpy as np

def modify(frame: int, data: DataCollection):

hist = np.bincount(data.particles[‘Coordination’][…])


Alternatively, you can simply use a Histogram Modifier to calculate the distribution of coordination numbers.

Let me know if you have further questions.

Kind regards,


This is a message that I receive for this question.