File: PlotHistogram.cpp

package info (click to toggle)
ausaxs 1.1.8-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 72,592 kB
  • sloc: cpp: 49,853; ansic: 6,901; python: 730; makefile: 18
file content (32 lines) | stat: -rw-r--r-- 879 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// SPDX-License-Identifier: LGPL-3.0-or-later
// Author: Kristian Lytje

#include <plots/PlotHistogram.h>
#include <hist/Histogram.h>
#include <dataset/SimpleDataset.h>

using namespace ausaxs::plots;

PlotHistogram::PlotHistogram() = default;

PlotHistogram::~PlotHistogram() = default;

PlotHistogram::PlotHistogram(const hist::Histogram& h, const PlotOptions& options) {
    plot(h, options);
}

PlotHistogram& PlotHistogram::plot(const hist::Histogram& hist, const PlotOptions& options) {
    SimpleDataset p(hist.get_axis().as_vector(), hist.get_counts());

    ss << "PlotHistogram\n"
        << p.to_string()
        << "\n"
        << options.to_string()
        << std::endl;
    return *this;
}

void PlotHistogram::quick_plot(const hist::Histogram& hist, const PlotOptions& options, const io::File& path) {
    PlotHistogram plot(hist, options);
    plot.save(path);
}