In the past few weeks I have been doing lots of data analysis and graph plotting. I use some graphical tools such as Grace, Veusz and QtiPlot but when doing lots of plots for a big document I wanted something a little more scriptable.
ePiX seemed to fit this bill and when I contacted the author about a few problems I had getting it to work he was very responsive. He is a mathematician whereas I am a physicist and have to handle lots of data in general. So I found the data file reading quite fragile. It does however have some great advantages such as being able to write LaTeX equations right into the graphs and figures.
The image shown above shows a plot of the absorption profile of a gold nanoparticle suspension. In the recent ePiX 1.0.24 release I added a tokeniser to the file reading functions of the data_file class in order to make data file reading more robust and I was able to read all my data files in using a simple loop and plot them as shown.
I have also just finished a data pruning function for the same class, but I am not sure if there is a better way to implement it. It uses brute force right now to iterate through the data and erase unwanted points. It does work well but I am not sure if there is a better way to accomplish its goal using some of the STL algorithms. It does need to delete the whole row though.
void data_file::prune(double min, double max, unsigned int col)
{
// Erase rows where the data is outside of the specified range
std::vector::iterator> iter(m_data.size());
for (unsigned int i = 0; i < m_data.size(); i++)
iter.at(i) = m_data.at(i).begin();
while (iter.at(0) != m_data.at(0).end())
{
if ( *iter.at(col-1) < min || *iter.at(col-1) > max )
{
for (unsigned int j = 0; j < m_data.size(); j++)
m_data.at(j).erase(iter.at(j));
}
else
{
for (unsigned int j = 0; j < m_data.size(); j++)
iter.at(j)++;
}
}
}
This pretty much covers the extra bits I needed for data analysis. A nice legend function would be good as drawing legends isn't as automated as I might like. I would welcome any feedback on the prune function as I think this would make a good addition to ePiX.
I have to admit it has been tough finding the perfect visualisation environment for me. There is a lot of choice out there but nothing quite ticks all the boxes for me. Extending ePiX to tick the bigger boxes seemed reasonable. Choice is certainly good but there is only so long one wants to spend getting to grips with a new data plotting tool...
Yet, as an applied statistician, mostly, the The R Project for Statistical Computing has been superior environment for almost every single problem I have encountered in my recent work (a slight exaggeration, but still...) . And no other program provides such plotting facilities.
Although, like ePiX, presumably, it has always had problems with huge data sets even in high-quality cluster environments. Nevertheless, I recommend to get acquainted with it if you are not yet familiar with it.
ePiX also allows me to leverage my C++ knowledge and use the many libraries available for C++. It is more LaTeX like too which is a plus for me as I use Kile may be 70% of the time right now. For producing figures in papers ePiX would also seem like a great choice to me but I would certainly use other tools for analysis.