iplotx 1.4.2__py3-none-any.whl → 1.5.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
iplotx/version.py CHANGED
@@ -2,4 +2,4 @@
2
2
  iplotx version information module.
3
3
  """
4
4
 
5
- __version__ = "1.4.2"
5
+ __version__ = "1.5.0"
iplotx/vertex.py CHANGED
@@ -14,6 +14,7 @@ import matplotlib as mpl
14
14
  from matplotlib.collections import PatchCollection
15
15
  from matplotlib.patches import (
16
16
  Patch,
17
+ PathPatch,
17
18
  Polygon,
18
19
  Ellipse,
19
20
  Circle,
@@ -393,7 +394,7 @@ class VertexCollection(PatchCollection):
393
394
 
394
395
 
395
396
  def make_patch(
396
- marker: str = "o",
397
+ marker: str | Polygon | mpl.path.Path = "o",
397
398
  size: float | Sequence[float] = 20,
398
399
  **kwargs,
399
400
  ) -> tuple[Patch, float]:
@@ -475,6 +476,23 @@ def make_patch(
475
476
  ][::-1],
476
477
  **kwargs,
477
478
  )
479
+ elif isinstance(marker, Polygon):
480
+ xy = marker.get_xy()
481
+ xy_sizes = xy.max(axis=0) - xy.min(axis=0)
482
+ art = Polygon(
483
+ xy * size / xy_sizes,
484
+ **kwargs,
485
+ )
486
+ elif isinstance(marker, mpl.path.Path):
487
+ xy = marker.vertices
488
+ xy_sizes = xy.max(axis=0) - xy.min(axis=0)
489
+ art = PathPatch(
490
+ mpl.path.Path(
491
+ xy * size / xy_sizes,
492
+ codes=marker.codes,
493
+ ),
494
+ **kwargs,
495
+ )
478
496
  else:
479
497
  raise KeyError(f"Unknown marker: {marker}")
480
498
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: iplotx
3
- Version: 1.4.2
3
+ Version: 1.5.0
4
4
  Summary: Plot networkx from igraph and networkx.
5
5
  Project-URL: Homepage, https://github.com/fabilab/iplotx
6
6
  Project-URL: Documentation, https://readthedocs.org/iplotx
@@ -3,8 +3,8 @@ iplotx/artists.py,sha256=2dBDT240zGwKb6tIc_y9pXeyU3LuYeF9wjj2tvi4KJo,730
3
3
  iplotx/label.py,sha256=7eS8ByadrhdIFOZz19U4VrS-oXY_ndFYNB-D4RZbFqI,9573
4
4
  iplotx/plotting.py,sha256=RyAdvaHSpuyJkf8DF3SJBvEXBrPmJEdovUyAlBWQvqU,16228
5
5
  iplotx/typing.py,sha256=QLdzV358IiD1CFe88MVp0D77FSx5sSAVUmM_2WPPE8I,1463
6
- iplotx/version.py,sha256=kZr-49jdcwgJr2GpCbq4T7ZJiENOw7WtxAU7m4HZCeQ,66
7
- iplotx/vertex.py,sha256=_yYyvusn4vYvi6RBEW6CHa3vnbv43GnZylnMIaK4bG0,16040
6
+ iplotx/version.py,sha256=dHoG6x6aINBmE0KlFSrXNW1gCmtIOfGa2oJaCjtGZlE,66
7
+ iplotx/vertex.py,sha256=Ta48M_6ZT8xKQWdI5XHiRxTt2LlJ9vshiDk34OzKYlY,16585
8
8
  iplotx/art3d/vertex.py,sha256=Xf8Um30X2doCd8KdNN7332F6BxC4k72Mb_GeRAuzQfQ,2545
9
9
  iplotx/art3d/edge/__init__.py,sha256=uw1U_mMXqcZAvea-7JbU1PUKULQD1CMMrbwY02tiWRQ,8529
10
10
  iplotx/art3d/edge/arrow.py,sha256=14BFXY9kDOUGPZl2fMD9gRVGyaaN5kyd-l6ikBg6WHU,3601
@@ -43,6 +43,6 @@ iplotx/utils/geometry.py,sha256=6RrC6qaB0-1vIk1LhGA4CfsiMd-9JNniSPyL_l9mshE,9245
43
43
  iplotx/utils/internal.py,sha256=WWfcZDGK8Ut1y_tOHRGg9wSqY1bwSeLQO7dHM_8Tvwo,107
44
44
  iplotx/utils/matplotlib.py,sha256=p_53Oamof0RI4mtV8HrdDtZbgVqUxeUZ_KDvLZSiBUQ,8604
45
45
  iplotx/utils/style.py,sha256=vyNP80nDYVinqm6_9ltCJCtjK35ZcGlHvOskNv3eQBc,4225
46
- iplotx-1.4.2.dist-info/METADATA,sha256=PWcma7vJQm7QzRsYyW3smdSJTd0extBEfRnB83c6oM0,5407
47
- iplotx-1.4.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
48
- iplotx-1.4.2.dist-info/RECORD,,
46
+ iplotx-1.5.0.dist-info/METADATA,sha256=smIckmasPHKrTHRupED_eiRfm7O0UkesY-r-4CpJGvM,5407
47
+ iplotx-1.5.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
48
+ iplotx-1.5.0.dist-info/RECORD,,
File without changes