This commit is contained in:
张壹 2025-01-16 09:47:11 +08:00
parent c2a65550ef
commit 572cdedae9
2 changed files with 5 additions and 5 deletions

View File

@ -83,8 +83,8 @@ int gctl::mathgl_dens::Draw(mglGraph *gr)
for (size_t j = 0; j < xnum_; j++) for (size_t j = 0; j < xnum_; j++)
{ {
z_d.a[j + i*xnum_] = z_[j + i*xnum_]; z_d.a[j + i*xnum_] = z_[j + i*xnum_];
zmin = std::min(zmin, z_[j + i*xnum_]); zmin = GCTL_MIN(zmin, z_[j + i*xnum_]);
zmax = std::max(zmax, z_[j + i*xnum_]); zmax = GCTL_MAX(zmax, z_[j + i*xnum_]);
} }
} }

View File

@ -49,7 +49,7 @@ void gctl::mathgl_plot::add_profile(const array<double> &in_y, std::string y_lab
if (xnum_ != in_y.size()) if (xnum_ != in_y.size())
throw std::runtime_error("[gctl::mathgl_plot] Invalid profile data size."); throw std::runtime_error("[gctl::mathgl_plot] Invalid profile data size.");
ys_.append_array(in_y); ys_.concat(in_y);
y_ll_ = y_label; y_ll_ = y_label;
ynum_++; ynum_++;
return; return;
@ -65,8 +65,8 @@ int gctl::mathgl_plot::Draw(mglGraph *gr)
double mini = ys_.front(), maxi = ys_.front(); double mini = ys_.front(), maxi = ys_.front();
for (size_t i = 1; i < ys_.size(); i++) for (size_t i = 1; i < ys_.size(); i++)
{ {
mini = std::min(mini, ys_[i]); mini = GCTL_MIN(mini, ys_[i]);
maxi = std::max(maxi, ys_[i]); maxi = GCTL_MAX(maxi, ys_[i]);
} }
gr->SetSize(800, 400); gr->SetSize(800, 400);