Skip to content

Commit 4389cf2

Browse files
authored
Merge pull request #352 from eric-wieser/patch-1
Output ticks even if they have no labels
2 parents f06fd7c + 3e8713a commit 4389cf2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tikzplotlib/_axes.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,6 @@ def _get_ticks(data, xy, ticks, ticklabels):
560560
pgfplots_ticklabels = []
561561
is_label_required = False
562562
for tick, ticklabel in zip(ticks, ticklabels):
563-
pgfplots_ticks.append(tick)
564563
# store the label anyway
565564
label = ticklabel.get_text()
566565
if "," in label:
@@ -578,6 +577,9 @@ def _get_ticks(data, xy, ticks, ticklabels):
578577
is_label_required = is_label_required or (label and label_float != tick)
579578
except ValueError:
580579
is_label_required = True
580+
# note: ticks may be present even if labels are not, keep them for grid lines
581+
for tick in ticks:
582+
pgfplots_ticks.append(tick)
581583

582584
# Leave the ticks to PGFPlots if not in STRICT mode and if there are no explicit
583585
# labels.

0 commit comments

Comments
 (0)