Skip to content

Commit e30740a

Browse files
authored
Merge pull request #490 from dhoekstra2000/fix-scatter-colors
Change to only add option if there is cmap
2 parents 7f4d2d4 + 37a72e2 commit e30740a

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

src/tikzplotlib/_path.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,12 @@ def draw_pathcollection(data, obj):
122122
fmt = "{:" + data["float format"] + "}"
123123
dd_strings = np.array([[fmt.format(val) for val in row] for row in dd])
124124

125-
draw_options = ["scatter", "only marks"]
125+
draw_options = ["only marks"]
126126
table_options = []
127127

128128
is_filled = False
129129

130130
if obj.get_array() is not None:
131-
draw_options.append("scatter")
132131
dd_strings = np.column_stack([dd_strings, obj.get_array()])
133132
labels.append("colordata")
134133
draw_options.append("scatter src=explicit")
@@ -139,6 +138,7 @@ def draw_pathcollection(data, obj):
139138
marker0 = None
140139
if obj.get_cmap():
141140
mycolormap, is_custom_cmap = _mpl_cmap2pgf_cmap(obj.get_cmap(), data)
141+
draw_options.append("scatter")
142142
draw_options.append(
143143
"colormap" + ("=" if is_custom_cmap else "/") + mycolormap
144144
)
@@ -276,6 +276,7 @@ def draw_pathcollection(data, obj):
276276
[
277277
"visualization depends on="
278278
+ "{\\thisrow{sizedata} \\as\\perpointmarksize}",
279+
"scatter",
279280
"scatter/@pre marker code/.append style="
280281
+ "{/tikz/mark size=\\perpointmarksize}",
281282
# "scatter/@post marker code/.style={}"

tests/test_legend_line_scatter_reference.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
ymin=-0.2, ymax=4.2,
2222
ytick style={color=black}
2323
]
24-
\addplot [draw=color0, fill=color0, mark=*, only marks, scatter]
24+
\addplot [draw=color0, fill=color0, mark=*, only marks]
2525
table{%
2626
x y
2727
0 0

tests/test_marker_reference.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
ymin=-1.1, ymax=1.1,
1616
ytick style={color=black}
1717
]
18-
\addplot [draw=black, fill=black, mark=+, only marks, scatter]
18+
\addplot [draw=black, fill=black, mark=+, only marks]
1919
table{%
2020
x y
2121
0 0

tests/test_scatter_reference.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
ymin=0.17184841, ymax=112.81716,
1717
ytick style={color=black}
1818
]
19-
\addplot [draw=color0, fill=color0, mark=*, only marks, scatter]
19+
\addplot [draw=color0, fill=color0, mark=*, only marks]
2020
table{%
2121
x y
2222
0 10.447038

0 commit comments

Comments
 (0)