diff --git a/include/openmc/plot.h b/include/openmc/plot.h index c5397a3e3..28c395bca 100644 --- a/include/openmc/plot.h +++ b/include/openmc/plot.h @@ -184,7 +184,7 @@ T PlotBase::get_map() const { // local variables bool found_cell = find_cell(p, 0); j = p.n_coord_ - 1; - if (level >= 0) {j = level + 1;} + if (level >= 0) { j = level; } if (found_cell) { data.set_value(y, x, p, j); } diff --git a/src/plot.cpp b/src/plot.cpp index f52c2b03f..20c3c986e 100644 --- a/src/plot.cpp +++ b/src/plot.cpp @@ -42,7 +42,7 @@ IdData::IdData(size_t h_res, size_t v_res) void IdData::set_value(size_t y, size_t x, const Particle& p, int level) { // set cell data - if (p.n_coord_ < level) { + if (p.n_coord_ <= level) { data_(y, x, 0) = NOT_FOUND; } else { data_(y, x, 0) = model::cells.at(p.coord_.at(level).cell)->id_;