Skip to content

Commit 2116392

Browse files
committed
Remove changing the line_color in Curve when marker_void is true
1 parent a2d9650 commit 2116392

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

src/curve.rs

+2-9
Original file line numberDiff line numberDiff line change
@@ -473,13 +473,6 @@ impl Curve {
473473

474474
/// Returns options for curve
475475
fn options(&self) -> String {
476-
// fix color if marker is void
477-
let line_color = if self.marker_void && self.line_color == "" {
478-
"red"
479-
} else {
480-
&self.line_color
481-
};
482-
483476
// output
484477
let mut opt = String::new();
485478

@@ -492,8 +485,8 @@ impl Curve {
492485
if self.line_alpha > 0.0 {
493486
write!(&mut opt, ",alpha={}", self.line_alpha).unwrap();
494487
}
495-
if line_color != "" {
496-
write!(&mut opt, ",color='{}'", line_color).unwrap();
488+
if self.line_color != "" {
489+
write!(&mut opt, ",color='{}'", self.line_color).unwrap();
497490
}
498491
if self.line_style != "" {
499492
write!(&mut opt, ",linestyle='{}'", self.line_style).unwrap();

tests/test_curve.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ fn test_curve() -> Result<(), StrError> {
2020
.set_marker_void(false)
2121
.set_marker_line_color("#cda500")
2222
.set_marker_line_width(3.0)
23-
.set_marker_size(8.0)
23+
.set_marker_size(15.0)
2424
.set_marker_style("p");
2525

2626
// another curve
2727
let mut curve2 = Curve::new();
2828
curve2
2929
.set_line_style("None")
30-
.set_marker_line_color("#1862ab")
31-
.set_marker_style("8")
30+
.set_marker_style("o")
31+
.set_marker_size(20.0)
3232
.set_marker_void(true);
3333

3434
let mut curve3 = Curve::new();

0 commit comments

Comments
 (0)