Lumiwealth / quantstats_lumi

Apache License 2.0
83 stars 27 forks source link

axis/graph formatting issues in 0.3.1 when setting y-axis limits #42

Closed kartiksubbarao closed 2 months ago

kartiksubbarao commented 3 months ago

There was a recent patch in 0.3.1 that explicitly set y-axis limits to returns.min() and returns.max(), to remove a small blank "buffer" area of the graphs. While this works fine for some returns, there are other returns where this truncates the graph and/or prevents the lowest y-axis label from being displayed. My recommendation would be to revert this particular part of the patch, since it appears that matplotlib seems to need that buffer area. Here are some illustrations:

version 0.3.0 -- notice how the -15% label is present as the lowest y-axis label: image

version 0.3.1 -- the -15% label is missing: image

another example:

version 0.3.0 -- the lowest axis label is -2% and the graph is clear:

image

version 0.3.1 -- the -2% label is missing, and the graph's lowest datapoints are truncated:

image