File: Plot.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 (18 lines) | stat: -rw-r--r-- 514 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// SPDX-License-Identifier: LGPL-3.0-or-later
// Author: Kristian Lytje

#include <plots/Plot.h>
#include <utility/Exceptions.h>
#include <hist/Histogram.h>
#include <io/File.h>

#include <fstream>

using namespace ausaxs;

void plots::Plot::save(const io::File& path) const {
    path.directory().create();
    std::ofstream output(path.str() + ".plot");
    if (!output.is_open()) {throw except::io_error("PlotDataset::quick_plot: Could not open file " + path.str() + " for writing!");}
    output << ss.str();
}