Skip to content

Commit a625aa4

Browse files
committed
Keep consistent behavior when there is no magnitude vector
1 parent f1e320a commit a625aa4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

source/matplot/axes_objects/vectors.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ namespace matplot {
7272
std::string vectors::plot_string() {
7373
maybe_update_line_spec();
7474
std::stringstream ss;
75-
ss << " '-' with vectors";
76-
if (!line_spec_.user_color()) {
77-
ss << " linecolor palette ";
75+
ss << " '-' with vectors ";
76+
if (!m_data_.empty()) {
77+
ss << "linecolor palette ";
78+
ss << "linewidth " << line_spec_.line_width();
7879
} else {
79-
ss << " linecolor rgb \'" << to_string(line_spec_.color()) << "\'";
80+
ss << line_spec_.plot_string(
81+
line_spec::style_to_plot::plot_line_only, false);
8082
}
8183

82-
ss << " linewidth " << line_spec_.line_width();
83-
8484
if (use_y2_) {
8585
ss << " xlim x1y2";
8686
}

0 commit comments

Comments
 (0)