Skip to content

Commit

Permalink
Docs updated
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrolexa committed Aug 25, 2023
1 parent e6bb2e8 commit ef390ad
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 21 deletions.
10 changes: 1 addition & 9 deletions src/apsg/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,13 @@
color=None,
ls="-",
lw=1.5,
mec=None,
mew=1,
mfc=None,
ms=4,
line_marker="o",
),
stereonet_default_fault_kwargs=dict(
alpha=None,
color=None,
ls="-",
lw=1.5,
mec=None,
mew=1,
mfc=None,
ms=2,
),
stereonet_default_hoeppner_kwargs=dict(
alpha=None,
Expand All @@ -111,7 +103,7 @@
mew=1,
ms=5,
),
stereonet_default_quiver_kwargs=dict(
stereonet_default_arrow_kwargs=dict(
color=None,
width=2,
headwidth=5,
Expand Down
2 changes: 1 addition & 1 deletion src/apsg/plotting/_plot_artists.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def __init__(self, factory, *args, **kwargs):
self.parse_kwargs(kwargs)

def parse_kwargs(self, kwargs):
super().update_kwargs("stereonet_default_quiver_kwargs")
super().update_kwargs("stereonet_default_arrow_kwargs")
self.kwargs.update((k, kwargs[k]) for k in self.kwargs.keys() & kwargs.keys())
if not isinstance(self.kwargs["label"], str):
if len(self.args) == 1:
Expand Down
56 changes: 53 additions & 3 deletions src/apsg/plotting/_roseplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,23 +162,73 @@ def savefig(self, filename="roseplot.png", **kwargs):
########################################

def bar(self, *args, **kwargs):
"""Plot rose histogram of angles"""
"""
Plot rose histogram of angles
Args:
Vector2Set feature(s)
Keyword Args:
alpha (scalar): Set the alpha value. Default None
color (color): Set the color of the point. Default None
ec (color): Patch edge color. Default None
fc (color): Patch face color. Default None
ls (str): Line style string (only for multiple features).
Default "-"
lw (float): Set line width. Default 1.5
legend (bool): Whether to show legend. Default False
"""
try:
artist = RosePlotArtistFactory.create_bar(*args, **kwargs)
self._artists.append(artist)
except TypeError as err:
print(err)

def pdf(self, *args, **kwargs):
"""Plot rose histogram of angles"""
"""
Plot Von Mises probability density function from angles
Args:
Vector2Set feature(s)
Keyword Args:
alpha (scalar): Set the alpha value. Default None
color (color): Set the color of the point. Default None
ec (color): Patch edge color. Default None
fc (color): Patch face color. Default None
ls (str): Line style string (only for multiple features).
Default "-"
lw (float): Set line width. Default 1.5
legend (bool): Whether to show legend. Default False
weight (float): Factor to scale probability density function
Default 1
"""
try:
artist = RosePlotArtistFactory.create_pdf(*args, **kwargs)
self._artists.append(artist)
except TypeError as err:
print(err)

def muci(self, *args, **kwargs):
"""Plot circular mean with confidence interval"""
"""
Plot circular mean with bootstrapped confidence interval
Args:
Vector2Set feature(s)
Keyword Args:
alpha (scalar): Set the alpha value. Default None
color (color): Set the color of the point. Default None
ls (str): Line style string (only for multiple features).
Default "-"
lw (float): Set line width. Default 1.5
confidence_level (float): Confidence interval. Default 95
n_resamples (int): Number of bootstrapped samples.
Default 9999
"""
try:
artist = RosePlotArtistFactory.create_muci(*args, **kwargs)
self._artists.append(artist)
Expand Down
78 changes: 70 additions & 8 deletions src/apsg/plotting/_stereonet.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,32 +431,91 @@ def cone(self, *args, **kwargs):
print(err)

def pair(self, *args, **kwargs):
"""Plot pair feature(s) as great circle and point"""
"""
Plot pair feature(s) as great circle and point
Args:
Pair or PairSet feature(s)
Keyword Args:
alpha (scalar): Set the alpha value. Default None
color (color): Set the color of the point. Default None
ls (str): Line style string (only for multiple features).
Default "-"
lw (float): Set line width. Default 1.5
line_marker (str): Marker style string for point. Default "o"
"""
try:
artist = StereoNetArtistFactory.create_pair(*args, **kwargs)
self._artists.append(artist)
except TypeError as err:
print(err)

def fault(self, *args, **kwargs):
"""Plot fault feature(s) as great circle and point"""
"""
Plot fault feature(s) as great circle and arrow
Note: Arrow is styled according to default arrow config
Args:
Fault or FaultSet feature(s)
Keyword Args:
alpha (scalar): Set the alpha value. Default None
color (color): Set the color of the point. Default None
ls (str): Line style string (only for multiple features).
Default "-"
lw (float): Set line width. Default 1.5
"""
try:
artist = StereoNetArtistFactory.create_fault(*args, **kwargs)
self._artists.append(artist)
except TypeError as err:
print(err)

def hoeppner(self, *args, **kwargs):
"""Plot a fault-and-striae as in tangent lineation plot - Hoeppner plot."""
"""
Plot fault feature(s) on Hoeppner (tangent lineation) plot
Note: Arrow is styled according to default arrow config
Args:
Fault or FaultSet feature(s)
Keyword Args:
alpha (scalar): Set the alpha value. Default None
color (color): Set the color of the point. Default None
ls (str): Line style string (only for multiple features).
Default "-"
lw (float): Set line width. Default 1.5
"""
try:
artist = StereoNetArtistFactory.create_hoeppner(*args, **kwargs)
self._artists.append(artist)
except TypeError as err:
print(err)

def arrow(self, *args, **kwargs):
"""Plot arrows at position of first argument
and oriented in direction of second"""
"""
Plot arrow at position of first argument
and oriented in direction of second
Note: You should pass two features
Args:
Vector3 or Vector3Set like feature(s)
Keyword Args:
color (color): Set the color of the arrow. Default None
width (int): Width of arrow. Default 2
headwidth (int): Width of arrow head. Default 5
pivot (str): Arrow pivot. Default "mid"
units (str): Arrow size units. Default "dots"
"""
try:
artist = StereoNetArtistFactory.create_arrow(*args, **kwargs)
self._artists.append(artist)
Expand All @@ -468,6 +527,9 @@ def contour(self, *args, **kwargs):
Plot filled contours using modified Kamb contouring technique with exponential
smoothing.
Args:
Vector3Set like feature
Keyword Args:
levels (int or list): number or values of contours. Default 6
cmap: matplotlib colormap used for filled contours. Default "Greys"
Expand All @@ -482,7 +544,7 @@ def contour(self, *args, **kwargs):
linewidths (float): contour lines width
linestyles (str): contour lines style
show_data (bool): Show data as points. Default False
data_kwargs (dict): arguments passed to point factory
data_kwargs (dict): arguments passed to point factory when `show_data` True
"""
try:
artist = StereoNetArtistFactory.create_contour(*args, **kwargs)
Expand Down Expand Up @@ -715,15 +777,15 @@ def _pair(self, *args, **kwargs):

def _fault(self, *args, **kwargs):
h = self._great_circle(*[arg.fol for arg in args], **kwargs)
quiver_kwargs = apsg_conf["stereonet_default_quiver_kwargs"]
quiver_kwargs = apsg_conf["stereonet_default_arrow_kwargs"]
quiver_kwargs["pivot"] = "tail"
quiver_kwargs["color"] = h[0].get_color()
for arg in args:
self._arrow(arg.lin, sense=arg.sense, **quiver_kwargs)

def _hoeppner(self, *args, **kwargs):
h = self._line(*[arg.fol for arg in args], **kwargs)
quiver_kwargs = apsg_conf["stereonet_default_quiver_kwargs"]
quiver_kwargs = apsg_conf["stereonet_default_arrow_kwargs"]
quiver_kwargs["color"] = h[0].get_color()
for arg in args:
self._arrow(arg.fol, arg.lin, sense=arg.sense, **quiver_kwargs)
Expand Down

0 comments on commit ef390ad

Please sign in to comment.