Skip to content

Commit 5067ee9

Browse files
committed
Unset default colorbox on 3D plots
1 parent 7e7544c commit 5067ee9

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

source/matplot/core/axes_type.cpp

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,9 @@ namespace matplot {
500500
run_command("set rtics scale 0");
501501
run_command("unset ttics");
502502
}
503+
if (!cb_axis_.visible()) {
504+
run_command("unset colorbox");
505+
}
503506
} else {
504507
set_or_unset_axis(x_axis_, "x", x_minor_grid_);
505508
set_or_unset_axis(x2_axis_, "x2", x_minor_grid_);
@@ -795,18 +798,25 @@ namespace matplot {
795798
"graph 1,1 behind fillcolor rgb \"" +
796799
to_string(color()) +
797800
"\" fillstyle solid 1.0 noborder");
798-
} else if (is_3d()) {
799-
auto v = backend::gnuplot::gnuplot_version();
800-
const bool has_wall_option =
801-
v < std::tuple<int, int, int>{5, 5, 0};
802-
if (has_wall_option) {
803-
run_command("set wall z0 fs transparent solid 0.5 "
804-
"border -1 fc 'slategray'");
805-
run_command("set wall x0 fs transparent solid 0.5 "
806-
"border -1 fc 'slategray'");
807-
run_command("set wall y1 fs transparent solid 0.5 "
808-
"border -1 fc 'slategray'");
809-
}
801+
/* } else if (is_3d()) {
802+
// we can uncomment this to do something with the "wall"
803+
// option in the future.
804+
auto v = backend::gnuplot::gnuplot_version();
805+
const bool has_wall_option =
806+
v < std::tuple<int, int, int>{5, 5, 0};
807+
if (has_wall_option) {
808+
run_command("set object 2 rectangle from graph 0,0 to "
809+
"graph 1,1 behind fillcolor rgb \"" +
810+
to_string(parent_->color()) +
811+
"\" fillstyle solid 1.0 noborder");
812+
run_command("set wall z0 fs transparent solid 0.5 "
813+
"border -1 fc rgb '" + to_string(color()) + "'");
814+
run_command("set wall x0 fs transparent solid 0.5 "
815+
"border -1 fc rgb '" + to_string(color()) + "'");
816+
run_command("set wall y1 fs transparent solid 0.5 "
817+
"border -1 fc rgb '" + to_string(color()) + "'");
818+
}
819+
*/
810820
} else if (is_polar()) {
811821
double m = children_[0]->xmax();
812822
run_command("set object 2 ellipse at first 0,0 size " +

0 commit comments

Comments
 (0)