**Breaking**: Figure.text: Fix typesetting of integers when mixed with floating-point values #3493
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Description of proposed changes
Currently,
Figure.textallows passing a list of non-string values into thetextparameter, e.g.,text=[1, 2, 3.0, 4.123, 5.000]. Internally, these non-string values are converted to an array of strings:pygmt/pygmt/src/text.py
Line 237 in 5cf7f6a
Instead of
np.atleast_1d(text).astype(str), we can also usenp.atleast_1d(np.asarray(text, dtype=str)). The former convertstextinto a numpy array (float64 in this case) first and then converts it to str dtype; the latter convertstextinto str dtype directly.Below are their differences:
The latter is faster (3.8 μs vs 4.57 μs) and the resulting array is smaller (20 bytes vs 128 bytes per element).
Also please pay attention to the different string representations. For an integer
1, the former will typeset1.0while the latter will typeset1. I think we can declare it as aFigure.textfor incorrectly typesetting integers when mixed with floating-point numbers.This PR adopts the latter one to fix the bug. An incorrect baseline image is also updated.