I was just saying in this other thread Should labels be masked by default or always? - #4 by Duane_Nykamp1 about the border around labels that I’ve been doing this very thing frequently!
What I do is turn displayXAxisTicks="false" and displayYAxisTicks="false", then create my own ticks and labels for the values I want using <repeatForSequence>, like in the graph below.
<graph xMin="-2.5" xMax="20.5" yMin="-1" yMax="10.5" fixAxes displayXAxisTicks="false" displayYAxisTicks="false" yLabelAlignment="right" aspectRatio="1.2/1">
<shortDescription>graph of the functions I and V</shortDescription>
<xLabel><m>t</m></xLabel>
<yLabel>Value in dollars</yLabel>
<repeatForSequence from="2" to="20" step="2" valueName="k">
<lineSegment styleNumber="5" lineWidth="1" fixed endpoints="($k,-.1) ($k,.1)"/>
<label anchor="($k,-.3)" fixed><m>$k</m></label>
</repeatForSequence>
<repeatForSequence from="1" to="10" valueName="k">
<lineSegment styleNumber="5" lineWidth="1" fixed endpoints="(-.15,$k) (.15,$k)"/>
<label anchor="(-1.4,$k)" fixed><math simplify>$k*10000</math></label>
</repeatForSequence>
<function domain="[0,21]">2*1.08^x</function>
<function domain="[0,21]" styleNumber="2">2* 0.88^x</function>
<label anchor="(17,8.2)" fixed><m>I(t)</m></label>
<label anchor="(17,0.7)" fixed><m>V(t)</m></label>
</graph>