Skip to content

Commit c010e7f

Browse files
added dashtype when m_data specified
1 parent 9a84531 commit c010e7f

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

source/matplot/axes_objects/vectors.cpp

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,27 @@ namespace matplot {
7272
std::string vectors::plot_string() {
7373
maybe_update_line_spec();
7474
std::stringstream ss;
75-
ss << " '-' with vectors ";
75+
ss << " '-' with vectors";
7676
if (!m_data_.empty()) {
77-
ss << "linecolor palette ";
78-
ss << "linewidth " << line_spec_.line_width();
77+
ss << " linecolor palette";
78+
ss << " linewidth " << line_spec_.line_width();
79+
80+
switch (line_spec_.line_style()) {
81+
case line_spec::line_style::solid_line:
82+
ss << " dashtype 1";
83+
break;
84+
case line_spec::line_style::dashed_line:
85+
ss << " dashtype '--'";
86+
break;
87+
case line_spec::line_style::dotted_line:
88+
ss << " dashtype '.'";
89+
break;
90+
case line_spec::line_style::dash_dot_line:
91+
ss << " dashtype '-.'";
92+
break;
93+
default:
94+
break;
95+
}
7996
} else {
8097
ss << line_spec_.plot_string(
8198
line_spec::style_to_plot::plot_line_only, false);

0 commit comments

Comments
 (0)