Skip to content

Commit d2f8e88

Browse files
committed
Change to only add option if there is cmap
1 parent 51f8e29 commit d2f8e88

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/tikzplotlib/_path.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def draw_path(data, path, draw_options=None, simplify=None):
112112

113113
def draw_pathcollection(data, obj):
114114
"""Returns PGFPlots code for a number of patch objects."""
115+
print("Drawing PathCollection")
115116
content = []
116117
# gather data
117118
assert obj.get_offsets() is not None
@@ -121,13 +122,12 @@ def draw_pathcollection(data, obj):
121122
fmt = "{:" + data["float format"] + "}"
122123
dd_strings = np.array([[fmt.format(val) for val in row] for row in dd])
123124

124-
draw_options = ["scatter", "only marks"]
125+
draw_options = ["only marks"]
125126
table_options = []
126127

127128
is_filled = False
128129

129130
if obj.get_array() is not None:
130-
draw_options.append("scatter")
131131
dd_strings = np.column_stack([dd_strings, obj.get_array()])
132132
labels.append("colordata")
133133
draw_options.append("scatter src=explicit")
@@ -138,6 +138,7 @@ def draw_pathcollection(data, obj):
138138
marker0 = None
139139
if obj.get_cmap():
140140
mycolormap, is_custom_cmap = _mpl_cmap2pgf_cmap(obj.get_cmap(), data)
141+
draw_options.append("scatter")
141142
draw_options.append(
142143
"colormap" + ("=" if is_custom_cmap else "/") + mycolormap
143144
)
@@ -283,6 +284,7 @@ def draw_pathcollection(data, obj):
283284

284285
# remove duplicates
285286
draw_options = sorted(list(set(draw_options)))
287+
print("Draw options: ", draw_options)
286288

287289
len_row = sum(len(item) for item in draw_options)
288290
j0, j1, j2 = ("", ", ", "") if len_row < 80 else ("\n ", ",\n ", "\n")

0 commit comments

Comments
 (0)