C++Guns – RoboBlog

06.10.2019

C++ Guns: acpl Histogram2D: Ordnungszahl vs. Atomgewicht

Filed under: Allgemein — Tags: — Thomas @ 13:10

Steigt das Atomgewicht mit der Ordnungszahl an? Hmmm. Lasst uns das in einem 2D Histogramm überprüfen!

ordnungszahlatomgewichthist2d

        PSE pse;

        std::vector<double> ordnungszahlen;
        for(uint32_t i=1; i <= pse.nElements(); ++i) {
            ordnungszahlen.push_back(i);
        }
        acpl::HistogramAxis Xaxis("Ordnungszahl", acpl::FixBinSize{50}, acpl::makeDataIntervalClosed(ordnungszahlen));

        std::vector<double> gewicht;
        for(uint32_t ordnungszahl=1; ordnungszahl <= pse.nElements(); ++ordnungszahl) {
            gewicht.push_back(pse.atomgewicht(pse.atomByOrdnungszahl(ordnungszahl)));
        }
        acpl::HistogramAxis Yaxis("Atomgewicht", acpl::FixBinSize{20}, acpl::makeDataIntervalClosed(gewicht));

        acpl::Histogram2D hist(Xaxis, ordnungszahlen, Yaxis, gewicht);
        std::cout << hist;

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress