Skip to content

Commit a8b1e69

Browse files
committed
comment out unreachable code
1 parent 492768a commit a8b1e69

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

tikzplotlib/_axes.py

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -431,11 +431,6 @@ def _subplot(self, obj, data):
431431
data["pgfplots libs"].add("groupplots")
432432

433433
def _get_label_rotation_and_horizontal_alignment(self, obj, data, x_or_y):
434-
tick_label_text_width = None
435-
tick_label_text_width_identifier = f"{x_or_y} tick label text width"
436-
if tick_label_text_width_identifier in self.axis_options:
437-
self.axis_options.remove(tick_label_text_width_identifier)
438-
439434
label_style = ""
440435

441436
major_tick_labels = (
@@ -447,6 +442,10 @@ def _get_label_rotation_and_horizontal_alignment(self, obj, data, x_or_y):
447442
if not major_tick_labels:
448443
return None
449444

445+
tick_label_text_width_identifier = f"{x_or_y} tick label text width"
446+
if tick_label_text_width_identifier in self.axis_options:
447+
self.axis_options.remove(tick_label_text_width_identifier)
448+
450449
tick_labels_rotation = [label.get_rotation() for label in major_tick_labels]
451450
tick_labels_rotation_same_value = len(set(tick_labels_rotation)) == 1
452451

@@ -468,9 +467,10 @@ def _get_label_rotation_and_horizontal_alignment(self, obj, data, x_or_y):
468467

469468
# Horizontal alignment will be ignored if no 'x/y tick label text width' has
470469
# been passed in the 'extra' parameter
471-
if tick_label_text_width:
472-
values.append(f"align={tick_labels_horizontal_alignment[0]}")
473-
values.append(f"text width={tick_label_text_width}")
470+
# tick_label_text_width = None
471+
# if tick_label_text_width:
472+
# values.append(f"align={tick_labels_horizontal_alignment[0]}")
473+
# values.append(f"text width={tick_label_text_width}")
474474

475475
if values:
476476
label_style = "{}ticklabel style = {{{}}}".format(
@@ -490,18 +490,18 @@ def _get_label_rotation_and_horizontal_alignment(self, obj, data, x_or_y):
490490

491491
# Ignore horizontal alignment if no '{x,y} tick label text width' has been
492492
# passed in the 'extra' parameter
493-
if tick_label_text_width:
494-
if tick_labels_horizontal_alignment_same_value:
495-
values.append(f"align={tick_labels_horizontal_alignment[0]}")
496-
values.append(f"text width={tick_label_text_width}")
497-
else:
498-
for idx, x in enumerate(tick_labels_horizontal_alignment):
499-
label_style += f"{x_or_y}_tick_label_ha_{idx}/.initial = {x}"
500-
501-
values.append(
502-
f"align=\\pgfkeysvalueof{{/pgfplots/{x_or_y}_tick_label_ha_\\ticknum}}"
503-
)
504-
values.append(f"text width={tick_label_text_width}")
493+
# if tick_label_text_width:
494+
# if tick_labels_horizontal_alignment_same_value:
495+
# values.append(f"align={tick_labels_horizontal_alignment[0]}")
496+
# values.append(f"text width={tick_label_text_width}")
497+
# else:
498+
# for idx, x in enumerate(tick_labels_horizontal_alignment):
499+
# label_style += f"{x_or_y}_tick_label_ha_{idx}/.initial = {x}"
500+
501+
# values.append(
502+
# f"align=\\pgfkeysvalueof{{/pgfplots/{x_or_y}_tick_label_ha_\\ticknum}}"
503+
# )
504+
# values.append(f"text width={tick_label_text_width}")
505505

506506
label_style = (
507507
"every {} tick label/.style = {{\n"
@@ -664,7 +664,6 @@ def _handle_linear_segmented_color_map(cmap, data):
664664
k_red = 0
665665
k_green = 0
666666
k_blue = 0
667-
x = 0.0
668667
colors = []
669668
X = []
670669
while True:

0 commit comments

Comments
 (0)