Content-Length: 272511 | pFad | http://github.com/mcuntz/ncvue/commit/f31487ce666c4734fd15f4a94afbb96593c4df4b

7C Increased number of digits in coordinate formatters · mcuntz/ncvue@f31487c · GitHub
Skip to content

Commit

Permalink
Increased number of digits in coordinate formatters
Browse files Browse the repository at this point in the history
  • Loading branch information
mcuntz committed Jan 20, 2025
1 parent 6ce667c commit f31487c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Changelog
---------

v5.2 (??? 2025)
* Increased number of digits in format_coord_scatter.
* Increased number of digits in coordinate formatters.

v5.1 (Dec 2024)
* Use ncvue-specific theme with customtkinter.
Expand Down
10 changes: 6 additions & 4 deletions src/ncvue/ncvutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
Oct 2024, Matthias Cuntz
* Use CustomTkinter in clone_ncvmain if installed, Nov 2024, Matthias Cuntz
* Increased digits in format_coord_scatter, Jan 2025, Matthias Cuntz
* Increased digits in format_coord_contour and format_coord_map,
Jan 2025, Matthias Cuntz
"""
import tkinter as tk
Expand Down Expand Up @@ -518,15 +520,15 @@ def format_coord_contour(x, y, ax, xx, yy, zz):
if xx.dtype.type == np.dtype('datetime64').type:
xstr = mpld.num2date(xout).strftime('%Y-%m-%d %H:%M:%S')
else:
xstr = '{:.4g}'.format(xout)
xstr = '{:.6g}'.format(xout)
if yy.dtype.type == np.dtype('datetime64').type:
ystr = mpld.num2date(yout).strftime('%Y-%m-%d %H:%M:%S')
else:
ystr = '{:.4g}'.format(yout)
ystr = '{:.6g}'.format(yout)
if zz.dtype.type == np.dtype('datetime64').type:
zstr = mpld.num2date(zout).strftime('%Y-%m-%d %H:%M:%S')
else:
zstr = '{:.4g}'.format(zout)
zstr = '{:.6g}'.format(zout)
# out = 'x=' + xstr + ', y=' + ystr + ', z=' + zstr
out = f'x={xstr}, y={ystr}, z={zstr}'
return out
Expand Down Expand Up @@ -576,7 +578,7 @@ def format_coord_map(x, y, ax, xx, yy, zz):
# ystr = '{:.4g}'.format(yout)
xstr = '{:.4g}'.format(xout)
ystr = '{:.4g}'.format(yout)
zstr = '{:.4g}'.format(zout)
zstr = '{:.6g}'.format(zout)
ns = 'N' if lat >= 0. else 'S'
ew = 'E' if lon >= 0. else 'W'
latstr = u'{:.4f} \u00b0{:s}'.format(abs(lat), ns)
Expand Down

0 comments on commit f31487c

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/mcuntz/ncvue/commit/f31487ce666c4734fd15f4a94afbb96593c4df4b

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy