Skip to content

Commit f351ce3

Browse files
committed
Add mark size to path
1 parent 48691e1 commit f351ce3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/tikzplotlib/_path.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,12 @@ def draw_pathcollection(data, obj):
230230
marker0 = None
231231
if obj.get_paths():
232232
p = obj.get_paths()[0]
233+
mark_size = obj.get_sizes()[0]
234+
if mark_size:
235+
ff = data["float format"]
236+
# setting half size because pgfplots counts the radius/half-width, while mark-size is squared diameter
237+
pgf_size = 0.5 * mark_size ** 0.5
238+
draw_options.append(f"mark size={pgf_size:{ff}}pt")
233239
ms = {style: MarkerStyle(style) for style in MarkerStyle.markers}
234240
paths = {
235241
style: marker.get_path().transformed(marker.get_transform())

0 commit comments

Comments
 (0)