Skip to content

Commit

Permalink
Merge pull request #14 from VinayR-GitHub/VinayR-GitHub-patch-1
Browse files Browse the repository at this point in the history
Update domain_colouring_universal.py
  • Loading branch information
VinayR-GitHub authored Dec 16, 2023
2 parents c1ad3fb + baf63c3 commit a5ce052
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions graphing/domain_colouring_universal.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,13 @@ def colour_map_ph(vals, sat):
)
return colsys.hsv_to_rgb(col_hsv)

def domain_plot(colmap, f, dim_Re, dim_Im, title = "", sat = 1, A = 500):
def domain_plot(colmap, f, dim_Re, dim_Im, title = "", sat = 1, A = 500, contour = False, power = 2):
"""Where {f} is a function over z, {dim_Re} and {dim_Im} outline the dimensions of the rectangular domain, {sat} represents saturation, and {A} represents unit interval acuity."""
vals = eval_func(f, dim_Re, dim_Im, A)
cols = colmap(vals, sat)
if contour == True:
cols = colmap(vals, sat, power)
else:
cols = colmap(vals, sat)
mpl.xlabel("$\Re(z)$")
mpl.ylabel("$\Im(z)$")
mpl.title(title)
Expand Down Expand Up @@ -176,7 +179,8 @@ def user_mapping(colmap_co, colmap_wm, colmap_ph):
dim_Im,
title,
sat,
A
A,
False
)
mpl.subplot(2, 3, 2)
domain_plot(
Expand All @@ -187,6 +191,7 @@ def user_mapping(colmap_co, colmap_wm, colmap_ph):
title,
sat,
A,
True,
power
)
mpl.subplot(2, 3, 3)
Expand All @@ -197,7 +202,8 @@ def user_mapping(colmap_co, colmap_wm, colmap_ph):
dim_Im,
title,
sat,
A
A,
False
)
mpl.subplot(2, 3, 4)
domain_plot(
Expand All @@ -207,7 +213,8 @@ def user_mapping(colmap_co, colmap_wm, colmap_ph):
[z_dim [2], z_dim [3]],
"$f(z)=z$",
sat,
A
A,
False
)
mpl.subplot(2, 3, 5)
domain_plot(
Expand All @@ -218,6 +225,7 @@ def user_mapping(colmap_co, colmap_wm, colmap_ph):
"$f(z)=z$",
sat,
A,
True,
power
)
mpl.subplot(2, 3, 6)
Expand All @@ -228,7 +236,8 @@ def user_mapping(colmap_co, colmap_wm, colmap_ph):
[z_dim [2], z_dim [3]],
"$f(z)=z$",
sat,
A
A,
False
)
mpl.tight_layout()
settings = file_settings()
Expand Down

0 comments on commit a5ce052

Please sign in to comment.