You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ax.format_ydata=lambdax: '$%1.2f'%x# format the price.
I don't know what the "coords message box" referred to in the comment is. I tried commenting out the two ax.format_?data lines, and the output plot seemed to be the same.
Suggested Improvement
It looks like these lines have been there for a very long time so possibly they no longer do what they were originally written to do. In which case they could just be removed. It seems plausible that the intent of line 60 is to format the y-axis, so possibly that could be replaced with something like
ax.yaxis.set_major_formatter(lambdax, pos: f'${x:.2f}') # format the price.
If these lines are still doing something useful, then more information in that comment on line 58 would be really helpful.
The text was updated successfully, but these errors were encountered:
I suppose this could be a little more verbose, but this formats the numbers displayed as the pointer moves through the axes. Of course you won't see this if you don't use an interactive backend.
Thanks @jklymak. I was using an interactive backend, but it had not occurred to me to wave my cursor over the plot! This is functionality that I had no idea existed.
Problem
The Date Tick Labels example has a couple of lines whose purpose are unclear, and I'm actually not sure whether they are achieving anything:
matplotlib/examples/text_labels_and_annotations/date.py
Lines 58 to 60 in f2c5b37
I don't know what the "coords message box" referred to in the comment is. I tried commenting out the two
ax.format_?data
lines, and the output plot seemed to be the same.Suggested Improvement
It looks like these lines have been there for a very long time so possibly they no longer do what they were originally written to do. In which case they could just be removed. It seems plausible that the intent of line 60 is to format the y-axis, so possibly that could be replaced with something like
If these lines are still doing something useful, then more information in that comment on line 58 would be really helpful.
The text was updated successfully, but these errors were encountered: