Skip to content

Commit

Permalink
Add smooth argument
Browse files Browse the repository at this point in the history
  • Loading branch information
titsuki committed Aug 7, 2017
1 parent c1ec680 commit c531dcb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Tells gnuplot what kind of output to generate.
Defined as:

multi method plot(
:$title, :$ignore, :@range, :@vertices!,
:$title, :$ignore, :@range, :@vertices!, :$smooth,
:@using,
Str :$style, :ls(:$linestyle), :lt(:$linetype), :lw(:$linewidth), :lc(:$linecolor),
:pt(:$pointtype), :ps(:$pointsize), :$fill, FalseOnly :$hidden3d, FalseOnly :$contours,
Expand All @@ -50,7 +50,7 @@ Defined as:
)

multi method plot(
:$title, :$ignore, :@range, :$function!,
:$title, :$ignore, :@range, :$function!, :$smooth,
Str :$style, :ls(:$linestyle), :lt(:$linetype), :lw(:$linewidth), :lc(:$linecolor),
:pt(:$pointtype), :ps(:$pointsize), :$fill, FalseOnly :$hidden3d, FalseOnly :$contours,
FalseOnly :$surface, :$palette,
Expand All @@ -65,7 +65,7 @@ Defined as:

multi method splot(
:@range,
:@vertices!,
:@vertices!, :$smooth,
:$binary, :$matrix, :$index, :$every,
:$title, :$style, :ls(:$linestyle), :lt(:$linetype), :lw(:$linewidth), :lc(:$linecolor),
:$pointtype, :$pointsize, :$fill, FalseOnly :$hidden3d, FalseOnly :$contours,
Expand All @@ -74,7 +74,7 @@ Defined as:

multi method splot(
:@range,
:$function!,
:$function!, :$smooth,
:$title, :$style, :ls(:$linestyle), :lt(:$linetype), :lw(:$linewidth), :lc(:$linecolor),
:$pointtype, :$pointsize, :$fill, FalseOnly :$hidden3d, FalseOnly :$contours,
FalseOnly :$surface, :$palette, :&writer? = -> $msg { self.command: $msg }
Expand Down
22 changes: 12 additions & 10 deletions lib/Chart/Gnuplot.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ method !tweak-coordinate(Mu :$coordinate!, :$name!, :$enable-nooffset = False, I
$coordinate-str;
}

multi method plot(:$title, :$ignore, :@range, :@vertices!,
multi method plot(:$title, :$ignore, :@range, :@vertices!, :$smooth,
:@using,
Str :$style, :ls(:$linestyle), :lt(:$linetype), :lw(:$linewidth), :lc(:$linecolor),
:pt(:$pointtype), :ps(:$pointsize), :$fill, FalseOnly :$hidden3d, FalseOnly :$contours, FalseOnly :$surface, :$palette,
Expand All @@ -104,6 +104,7 @@ multi method plot(:$title, :$ignore, :@range, :@vertices!,

@args.push($tmpvariable);
@args.push("using " ~ @using.join(":")) if @using.elems > 0;
@args.push(sprintf("smooth %s", $smooth)) if $smooth.defined;
@args.push("with " ~ $style) if $style.defined;

if $title.defined {
Expand All @@ -115,7 +116,6 @@ multi method plot(:$title, :$ignore, :@range, :@vertices!,

@args.push(sprintf("notitle [%s]", $ignore)) if $ignore.defined;


@args.push("linestyle " ~ $linestyle) if $linestyle.defined;
@args.push("linetype " ~ $linetype) if $linetype.defined;
@args.push("linewidth " ~ $linewidth) if $linewidth.defined;
Expand All @@ -139,7 +139,7 @@ multi method plot(:$title, :$ignore, :@range, :@vertices!,
$!num-plot++;
}

multi method plot(:$title, :$ignore, :@range, :$function!,
multi method plot(:$title, :$ignore, :@range, :$function!, :$smooth,
Str :$style, :ls(:$linestyle), :lt(:$linetype), :lw(:$linewidth), :lc(:$linecolor),
:pt(:$pointtype), :ps(:$pointsize), :$fill, FalseOnly :$hidden3d, FalseOnly :$contours, FalseOnly :$surface, :$palette,
:&writer? = -> $msg { self.command: $msg }) {
Expand All @@ -159,7 +159,7 @@ multi method plot(:$title, :$ignore, :@range, :$function!,
}

@args.push(sprintf("notitle [%s]", $ignore)) if $ignore.defined;

@args.push(sprintf("smooth %s", $smooth)) if $smooth.defined;
@args.push("with " ~ $style) if $style.defined;

@args.push("linestyle " ~ $linestyle) if $linestyle.defined;
Expand Down Expand Up @@ -187,7 +187,7 @@ multi method plot(:$title, :$ignore, :@range, :$function!,
}

multi method splot(:@range,
:@vertices!,
:@vertices!, :$smooth,
:$binary, :$matrix, :$index, :$every,
:$title, :$style, :ls(:$linestyle), :lt(:$linetype), :lw(:$linewidth), :lc(:$linecolor),
:pt(:$pointtype), :ps(:$pointsize), :$fill, FalseOnly :$hidden3d, FalseOnly :$contours, FalseOnly :$surface, :$palette, :&writer? = -> $msg { self.command: $msg }) {
Expand Down Expand Up @@ -218,6 +218,7 @@ multi method splot(:@range,
}
}

@args.push(sprintf("smooth %s", $smooth)) if $smooth.defined;
@args.push("with " ~ $style) if $style.defined;

@args.push("linestyle " ~ $linestyle) if $linestyle.defined;
Expand All @@ -243,7 +244,7 @@ multi method splot(:@range,
}

multi method splot(:@range,
:$function!,
:$function!, :$smooth,
:$title, :$style, :ls(:$linestyle), :lt(:$linetype), :lw(:$linewidth), :lc(:$linecolor),
:pt(:$pointtype), :ps(:$pointsize), :$fill, FalseOnly :$hidden3d, FalseOnly :$contours, FalseOnly :$surface, :$palette, :&writer? = -> $msg { self.command: $msg }) {
my @args;
Expand All @@ -261,6 +262,7 @@ multi method splot(:@range,
}
}

@args.push(sprintf("smooth %s", $smooth)) if $smooth.defined;
@args.push("with " ~ $style) if $style.defined;

@args.push("linestyle " ~ $linestyle) if $linestyle.defined;
Expand Down Expand Up @@ -1078,7 +1080,7 @@ Tells gnuplot what kind of output to generate.
Defined as:
multi method plot(
:$title, :$ignore, :@range, :@vertices!,
:$title, :$ignore, :@range, :@vertices!, :$smooth,
:@using,
Str :$style, :ls(:$linestyle), :lt(:$linetype), :lw(:$linewidth), :lc(:$linecolor),
:pt(:$pointtype), :ps(:$pointsize), :$fill, FalseOnly :$hidden3d, FalseOnly :$contours,
Expand All @@ -1087,7 +1089,7 @@ Defined as:
)
multi method plot(
:$title, :$ignore, :@range, :$function!,
:$title, :$ignore, :@range, :$function!, :$smooth,
Str :$style, :ls(:$linestyle), :lt(:$linetype), :lw(:$linewidth), :lc(:$linecolor),
:pt(:$pointtype), :ps(:$pointsize), :$fill, FalseOnly :$hidden3d, FalseOnly :$contours,
FalseOnly :$surface, :$palette,
Expand All @@ -1102,7 +1104,7 @@ Defined as:
multi method splot(
:@range,
:@vertices!,
:@vertices!, :$smooth,
:$binary, :$matrix, :$index, :$every,
:$title, :$style, :ls(:$linestyle), :lt(:$linetype), :lw(:$linewidth), :lc(:$linecolor),
:$pointtype, :$pointsize, :$fill, FalseOnly :$hidden3d, FalseOnly :$contours,
Expand All @@ -1111,7 +1113,7 @@ Defined as:
multi method splot(
:@range,
:$function!,
:$function!, :$smooth,
:$title, :$style, :ls(:$linestyle), :lt(:$linetype), :lw(:$linewidth), :lc(:$linecolor),
:$pointtype, :$pointsize, :$fill, FalseOnly :$hidden3d, FalseOnly :$contours,
FalseOnly :$surface, :$palette, :&writer? = -> $msg { self.command: $msg }
Expand Down

0 comments on commit c531dcb

Please sign in to comment.