From f7e9f79f1d6f639fdb7d9da9f38eb04c9a55f2da Mon Sep 17 00:00:00 2001 From: Christian Kral Date: Fri, 13 Dec 2024 15:54:42 +0100 Subject: [PATCH] Add parameter gapcolor --- HISTORY.md | 3 +++ Project.toml | 2 +- src/phasor.jl | 22 ++++++++++++++-------- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index ddc7aa7..cfdd89c 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,8 @@ # History.md +## v0.11.0 2024-12-13 +- Add parameter gapcolor to `phasorsine_hline` and `phasorcosine_hline` + ## v0.10.4 2024-09-14 - Remove obsoletely plotted lines diff --git a/Project.toml b/Project.toml index 136ff33..7bfac08 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ElectricalEngineering" uuid = "84e62fa8-74a0-5990-9214-c45bd74ae4d7" authors = ["Christian Kral "] -version = "0.10.4" +version = "0.11.0" [deps] Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" diff --git a/src/phasor.jl b/src/phasor.jl index c7652d8..548f6bc 100644 --- a/src/phasor.jl +++ b/src/phasor.jl @@ -840,6 +840,8 @@ value = "black" `colorDash` Color of the dashed circle (left subplot) and the horizontal dashed lines between the left and right subplot; default value = "gray" +`gapcolor` Gap color of line gaps; default value = nothing + `shift` If `true`, the sine curve on the right is plotted with phase shift `phi`; default value = `true` @@ -863,12 +865,13 @@ phasorsine_hline(1, 30°, color=colorBlack2, shift=false, marker="o") function phasorsine_hline( mag = 1, phi = 0; - color="black", + color = "black", linewidth = 1, linestyle = ":", - colorDash="gray", + colorDash = "gray", + gapcolor = nothing, shift = true, - marker="") + marker = "") # Consider optional phase shift phishift = shift ? upstrip(phi) : 0 @@ -885,7 +888,7 @@ function phasorsine_hline( con = matplotlib.patches."ConnectionPatch"( xyA=(philim*180/pi, mag*sin(phi)), xyB=(mag*cos(phi), mag*sin(phi)), coordsA="data", coordsB="data", - axesA=ax2, axesB=ax1, color=colorDash, + axesA=ax2, axesB=ax1, color=colorDash, gapcolor=gapcolor, linewidth=linewidth, linestyle=linestyle, clip_on=false) ax2.add_artist(con) if marker != "" @@ -926,6 +929,8 @@ value = "black" `colorDash` Color of the dashed circle (left subplot) and the horizontal dashed lines between the left and right subplot; default value = "gray" +`gapcolor` Gap color of line gaps; default value = nothing + `shift` If `true`, the cosine curve on the right is plotted with phase shift `phi`; default value = `true` @@ -949,12 +954,13 @@ phasorcosine_hline(1, 30°, color=colorBlack2, shift=false, marker="o") function phasorcosine_hline( mag = 1, phi = 0; - color="black", + color = "black", linewidth = 1, linestyle = ":", - colorDash="gray", + colorDash = "gray", + gapcolor = nothing, shift = true, - marker="") + marker = "") # Consider optional phase shift phishift = shift ? upstrip(phi) : 0 @@ -971,7 +977,7 @@ function phasorcosine_hline( con = matplotlib.patches."ConnectionPatch"( xyA=(philim*180/pi, mag*cos(phi)), xyB=(-mag*sin(phi), mag*cos(phi)), coordsA="data", coordsB="data", - axesA=ax2, axesB=ax1, color=colorDash, + axesA=ax2, axesB=ax1, color=colorDash, gapcolor=gapcolor, linewidth=linewidth, linestyle=linestyle, clip_on=false) ax2.add_artist(con) if marker != ""