File tree Expand file tree Collapse file tree 4 files changed +13
-2
lines changed
source/matplot/axes_objects Expand file tree Collapse file tree 4 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -586,6 +586,13 @@ namespace matplot {
586
586
}
587
587
588
588
// if it increases
589
+ if (Z_data_.size () < n_row + 1 || Z_data_[n_row].size () < n_col + 1 ||
590
+ Z_data_.size () < opposite_row + 1 ||
591
+ Z_data_[opposite_row].size () < opposite_col + 1 ) {
592
+ // if we are outside the grid, we don't know
593
+ // if it's lower or upper level
594
+ return false ;
595
+ }
589
596
bool higher_values_on_left =
590
597
Z_data_[n_row][n_col] > Z_data_[opposite_row][opposite_col];
591
598
if (higher_values_on_left) {
Original file line number Diff line number Diff line change @@ -754,7 +754,8 @@ namespace matplot {
754
754
}
755
755
756
756
class histogram &histogram::edge_color (std::string_view color) {
757
- edge_color (to_array (color));
757
+ auto a = to_array (color);
758
+ edge_color (a);
758
759
return *this ;
759
760
}
760
761
Original file line number Diff line number Diff line change @@ -194,6 +194,9 @@ namespace matplot {
194
194
size_t index =
195
195
only_at_marker_indices ? marker_indices_[i] : i;
196
196
197
+ if (x_is_manual && index >= x_data_.size ()) {
198
+ break ;
199
+ }
197
200
double x_value = x_is_manual ? x_data_[index] : index + 1 ;
198
201
if (!std::isfinite (x_value) || !std::isfinite (y_data_[i])) {
199
202
ss << " \n " ;
Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ namespace matplot {
219
219
220
220
const size_t n_ticks = ticks[dimension].ticks .size ();
221
221
constexpr double tick_size = 0.03 ;
222
- for (size_t i = 0 ; i < n_ticks + 1 ; ++i) {
222
+ for (size_t i = 0 ; i < n_ticks; ++i) {
223
223
double y = normalize (ticks[dimension].ticks [i], dimension);
224
224
ss << " " << dimension + 1 << " " << y << " \n " ;
225
225
const bool is_last_dimension = dimension == data_.size () - 1 ;
You can’t perform that action at this time.
0 commit comments