sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.31k stars 450 forks source link

axes_labels are cut off in Sage-9.8 and newer but not in Sage-9.6 #35971

Open williamstein opened 1 year ago

williamstein commented 1 year ago

Steps To Reproduce

Using sage-9.8 or sage-10.0 run this code:

pair= list(zip([62,81,75,90,67],[20,34,18,25,31]))
list_plot(pair,axes_labels=["Hippo Population" , "Crocodile Population"],color="red", plotjoined=true )

You will see:

image

Note that the x axes label is cut off.

See https://cocalc.com/wstein/support/axes-labels-bug

Expected Behavior

The x-axis label is not cut off.

Actual Behavior

See screenshot above.

Additional Information

It works fine in sage-9.6. See: https://cocalc.com/wstein/support/axes-labels-bug-older:

image

Environment

- **OS**: Ubuntu 22.04
- **Sage Version**: 9.8 and 10.0

Checklist

goebbe commented 1 year ago

I can confim the reported issue (tested in JupyterLab, Sage 10.0, on CoCal)

The Problem can also appear at the y-axis, e.g. when using latex fonts for the y-axis: myplot.axes_labels(['$x$','$f(x)$'])

Result: the label f(x) on the y-axis is cut off, from the top.

mhartl commented 8 months ago

I’m having this issue, too, using the latest version of SageMath as of this writing (10.2). It appears to be a regression, so diffing version 9.8 with 9.6 should lead fairly quickly to a solution. (Unfortunately, I am at present unqualified to contribute a fix, though that may change as I become more acquainted with Sage.)

marco-perin commented 6 months ago

I can confirm that I have the same behavior, both on the x and y axis, with sage 10.2 image