@@ -76,14 +76,14 @@ def __init__(self, data, obj):
7676
7777 # aspect ratio, plot width/height
7878 aspect = obj .get_aspect ()
79- if aspect == "auto" or aspect == "normal" :
79+ if aspect in [ "auto" , "normal" ] :
8080 aspect_num = None # just take the given width/height values
8181 elif aspect == "equal" :
8282 aspect_num = 1.0
8383 else :
8484 aspect_num = float (aspect )
8585
86- self ._width (data , aspect_num , xlim , ylim )
86+ self ._set_axis_dimensions (data , aspect_num , xlim , ylim )
8787
8888 # axis positions
8989 xaxis_pos = obj .get_xaxis ().label_position
@@ -163,7 +163,7 @@ def get_end_code(self, data):
163163
164164 return ""
165165
166- def _width (self , data , aspect_num , xlim , ylim ):
166+ def _set_axis_dimensions (self , data , aspect_num , xlim , ylim ):
167167 if data ["fwidth" ] and data ["fheight" ]:
168168 # width and height overwrite aspect ratio
169169 self .axis_options .append ("width=" + data ["fwidth" ])
@@ -193,12 +193,8 @@ def _width(self, data, aspect_num, xlim, ylim):
193193 data ["fwidth" ] = str (1.0 / alpha ) + "*" + data ["fheight" ]
194194 self .axis_options .append ("width=" + data ["fwidth" ])
195195 else :
196- if aspect_num :
197- print (
198- "Non-automatic aspect ratio demanded, "
199- "but neither height nor width of the plot are given. "
200- "Discard aspect ratio."
201- )
196+ # TODO keep an eye on https://tex.stackexchange.com/q/480058/13262
197+ pass
202198 return
203199
204200 def _ticks (self , data , obj ):
@@ -453,17 +449,11 @@ def _get_label_rotation_and_horizontal_alignment(obj, data, axes_obj):
453449 if any (tick_labels_rotation ) != 0 :
454450 values .append ("rotate={}" .format (tick_labels_rotation [0 ]))
455451
452+ # Horizontal alignment will be ignored if no 'x/y tick label text width' has
453+ # been passed in the 'extra' parameter
456454 if tick_label_text_width :
457455 values .append ("align={}" .format (tick_labels_horizontal_alignment [0 ]))
458456 values .append ("text width={}" .format (tick_label_text_width ))
459- else :
460- print (
461- (
462- "Horizontal alignment will be ignored as no '{} tick "
463- "label text width' has been passed in the 'extra' "
464- "parameter"
465- ).format (axes_obj )
466- )
467457
468458 if values :
469459 label_style = "{}ticklabel style = {{{}}}" .format (
0 commit comments