Skip to content

Commit

Permalink
Merge pull request #93 from cpmech/improve-void-marker
Browse files Browse the repository at this point in the history
Remove changing the line_color in Curve when marker_void is true
  • Loading branch information
cpmech authored Sep 25, 2024
2 parents a2d9650 + 2116392 commit 4f695fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
11 changes: 2 additions & 9 deletions src/curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,13 +473,6 @@ impl Curve {

/// Returns options for curve
fn options(&self) -> String {
// fix color if marker is void
let line_color = if self.marker_void && self.line_color == "" {
"red"
} else {
&self.line_color
};

// output
let mut opt = String::new();

Expand All @@ -492,8 +485,8 @@ impl Curve {
if self.line_alpha > 0.0 {
write!(&mut opt, ",alpha={}", self.line_alpha).unwrap();
}
if line_color != "" {
write!(&mut opt, ",color='{}'", line_color).unwrap();
if self.line_color != "" {
write!(&mut opt, ",color='{}'", self.line_color).unwrap();
}
if self.line_style != "" {
write!(&mut opt, ",linestyle='{}'", self.line_style).unwrap();
Expand Down
6 changes: 3 additions & 3 deletions tests/test_curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ fn test_curve() -> Result<(), StrError> {
.set_marker_void(false)
.set_marker_line_color("#cda500")
.set_marker_line_width(3.0)
.set_marker_size(8.0)
.set_marker_size(15.0)
.set_marker_style("p");

// another curve
let mut curve2 = Curve::new();
curve2
.set_line_style("None")
.set_marker_line_color("#1862ab")
.set_marker_style("8")
.set_marker_style("o")
.set_marker_size(20.0)
.set_marker_void(true);

let mut curve3 = Curve::new();
Expand Down

0 comments on commit 4f695fd

Please sign in to comment.