mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 04:39:23 +08:00
packages.ufo: fix
This commit is contained in:
@@ -7,9 +7,9 @@ namespace biu
|
||||
{
|
||||
std::experimental::make_observer(&std::clog), nullptr,
|
||||
# ifdef NDEBUG
|
||||
Logger::Level::Debug
|
||||
# else
|
||||
Logger::Level::Info
|
||||
# else
|
||||
Logger::Level::Debug
|
||||
# endif
|
||||
};
|
||||
void Logger::init(std::experimental::observer_ptr<std::ostream> stream, Level level)
|
||||
|
||||
@@ -315,7 +315,7 @@ void ufo::plot_point(std::string config_file)
|
||||
std::vector<double> result(resolution);
|
||||
for (auto& mode : qpoint.ModeData)
|
||||
{
|
||||
int index = mode.Frequency - frequency_range.first / (frequency_range.second - frequency_range.first)
|
||||
int index = (mode.Frequency - frequency_range.first) / (frequency_range.second - frequency_range.first)
|
||||
* resolution;
|
||||
if (index >= 0 && index < static_cast<int>(resolution)) result[index] += mode.Weight;
|
||||
}
|
||||
@@ -354,6 +354,7 @@ void ufo::plot_point(std::string config_file)
|
||||
ax->y_axis().reverse(false);
|
||||
ax->x_axis().tick_values(x_ticks);
|
||||
ax->x_axis().tick_length(1);
|
||||
ax->y_axis().tick_values({});
|
||||
f->save(filename, "png");
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user