Skip to content

Commit adc1347

Browse files
committed
Fix histogram xlabel
1 parent 21f7362 commit adc1347

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/unicode_plot/interface/histogram.cr

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,16 +295,13 @@ module UnicodePlot
295295
plot = barplot(
296296
labels_arr, counts,
297297
color: color, title: title,
298-
xlabel: xlabel.empty? ? "Frequency" : xlabel,
298+
xlabel: xlabel.empty? ? transform_name(xscale, "Frequency") : xlabel,
299299
xscale: xscale,
300300
border: border, margin: margin, padding: padding,
301301
labels: labels, unicode_exponent: unicode_exponent,
302302
thousands_separator: thousands_separator, symbols: symbols,
303303
width: width
304304
)
305-
# When a custom xlabel is provided, use it as-is (no scale-name suffix),
306-
# matching Julia's behavior where kw... overrides the default transform_name label.
307-
plot.xlabel = xlabel unless xlabel.empty?
308305
plot
309306
end
310307

0 commit comments

Comments
 (0)