File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -175,20 +175,19 @@ const AxisPainterMethods = {
175175 /** @summary Provide label for exponential form */
176176 formatExp ( base , order , value ) {
177177 let res = '' ;
178+ const sbase = Math . abs ( base - Math . E ) < 0.001 ? 'e' : base . toString ( ) ;
178179 if ( value ) {
179180 value = Math . round ( value / Math . pow ( base , order ) ) ;
180- if ( ( value !== 0 ) && ( value !== 1 ) ) res = value . toString ( ) + ( settings . Latex ? '#times' : 'x' ) ;
181- }
182- if ( Math . abs ( base - Math . E ) < 0.001 )
183- res += 'e' ;
184- else
185- res += base . toString ( ) ;
186- if ( settings . StripAxisLabels ) {
187- if ( order === 0 )
188- return '1' ;
189- else if ( order === 1 )
190- return res ;
181+ if ( settings . StripAxisLabels ) {
182+ if ( order === 0 )
183+ return value . toString ( ) ;
184+ else if ( ( order === 1 ) && ( value === 1 ) )
185+ return sbase ;
186+ }
187+ if ( value !== 1 )
188+ res = value . toString ( ) + ( settings . Latex ? '#times' : 'x' ) ;
191189 }
190+ res += sbase ;
192191 if ( settings . Latex > constants . Latex . Symbols )
193192 return res + `^{${ order } }` ;
194193 const superscript_symbols = {
You can’t perform that action at this time.
0 commit comments