Skip to content

Commit

Permalink
Add parameter gapcolor
Browse files Browse the repository at this point in the history
  • Loading branch information
christiankral committed Dec 13, 2024
1 parent 7a76282 commit f7e9f79
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
3 changes: 3 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ElectricalEngineering"
uuid = "84e62fa8-74a0-5990-9214-c45bd74ae4d7"
authors = ["Christian Kral <[email protected]>"]
version = "0.10.4"
version = "0.11.0"

[deps]
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Expand Down
22 changes: 14 additions & 8 deletions src/phasor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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
Expand All @@ -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 != ""
Expand Down Expand Up @@ -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`
Expand All @@ -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
Expand All @@ -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 != ""
Expand Down

0 comments on commit f7e9f79

Please sign in to comment.