Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Vesa Oikonen
tpcclib
Commits
64722eb1
Commit
64722eb1
authored
Jun 22, 2020
by
Vesa Oikonen
Browse files
less x axis ticks when scale is small or large
parent
9dbc1b09
Changes
1
Hide whitespace changes
Inline
Side-by-side
v1/libtpcsvg/svg_plot.c
View file @
64722eb1
...
...
@@ -382,6 +382,8 @@ int svg_calculate_axes(
if
(
vp
->
x
.
fixed_max
)
vp
->
x
.
max
=
orig_max
;
if
(
verbose
>
1
)
printf
(
"x-range %g - %g -> %g - %g
\n
"
,
orig_min
,
orig_max
,
vp
->
x
.
min
,
vp
->
x
.
max
);
vp
->
x
.
tick_nr
=
MAX_TICK_NR
;
if
((
fabs
(
vp
->
x
.
max
)
<
0
.
1
||
fabs
(
vp
->
x
.
max
)
>
10000
)
&&
vp
->
x
.
tick_nr
>
8
)
vp
->
x
.
tick_nr
=
8
;
// Only few long tick labels can fit on x axis
if
((
fabs
(
vp
->
x
.
max
)
<
0
.
01
||
fabs
(
vp
->
x
.
max
)
>
100000
)
&&
vp
->
x
.
tick_nr
>
6
)
vp
->
x
.
tick_nr
=
5
;
// even fewer tick labels can fit on x axis
if
(
vp
->
label_area_viewport
.
is
)
vp
->
x
.
tick_nr
=
1
+
vp
->
x
.
tick_nr
/
2
;
// Legends reduce the width of x axis
ret
=
axis_tick_positions
(
vp
->
x
.
min
,
vp
->
x
.
max
,
vp
->
x
.
tick
,
&
vp
->
x
.
tick_nr
,
&
vp
->
x
.
tickscale
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment