Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

left-axis-format does not accept %s #1217

Open
dschultzca opened this issue Mar 23, 2023 · 1 comment
Open

left-axis-format does not accept %s #1217

dschultzca opened this issue Mar 23, 2023 · 1 comment

Comments

@dschultzca
Copy link

Describe the bug
When trying to format the left axis with --left-axis-format="%8.2lf %s" an error is thrown.
ERROR: invalid format string '%8.2lf %s' (should match '^(?:[^%]+|%%)*%[-+ 0#]?[0-9]*(?:[.][0-9]+)?l[eEfFgG](?:[^%]+|%%)*$')

To Reproduce
Steps to reproduce the behavior:
Using the attached RRD (power.rrd) create graph with a command such as:
rrdtool.exe graph - --imgformat=PNG --start="1679511902" --end="1679598034" --pango-markup --title="Current Power" --vertical-label="power level" --slope-mode --base=1000 --height=200 --width=700 --alt-autoscale --left-axis-format="%8.2lf %s" COMMENT:"From 2023-03-22 19\:05\:02 To 2023-03-23 19\:00\:34\c" COMMENT:" \n" --color BACK#F3F3F3 --color CANVAS#FDFDFD --color SHADEA#CBCBCB --color SHADEB#999999 --color FONT#000000 --color AXIS#2C4D43 --color ARROW#2C4D43 --color FRAME#2C4D43 --border 1 --font TITLE:11:"Arial" --font AXIS:8:"Arial" --font LEGEND:8:"Courier" --font UNIT:8:"Arial" --font WATERMARK:6:"Arial" --slope-mode DEF:a="power.rrd":"CurrPower":AVERAGE LINE1:a#00CF00FF:"power level" GPRINT:a:LAST:"Cur\:%8.2lf %s" GPRINT:a:AVERAGE:"Avg\:%8.2lf %s" GPRINT:a:MAX:"Max\:%8.2lf %s\n > power_graph.png"

Expected behavior
I expect that the 'k' SI magnitude unit be printed after the numeric value of the axis with the format I specify. In this case 26.0 k, 26.2 k, 26.4 k, 26.6 k, 26.8 k, 27.0 k, etc.
If I use --left-axis-format="%8.2lf" the 'k' SI magnitude unit is left out completely.
Using the axis --units-exponent option does not help either.

Screenshots
I am trying to correct this axis labelling behavior:
image

Desktop (please complete the following information):

  • OS: Windows Server 2012
  • Browser: Chrome

power.rrd.zip

@qtist
Copy link

qtist commented Jun 24, 2023

I noticed the same behaviour. Annoying because without --left-axis-format I cannot find another way to remove this unnecessary .0 on all the ticks here causing the overlap with the label :(

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants