## #2477 Non-negative numbers are displayed too right in plots

closed
nobody
None
5
2012-10-10
2012-10-09
David J. López
No

I've noticed in maxima plots (based on postcript with gnuplot) that the positive numbers are slightly right-shifted from their axis ticks marks. I include a figure, see numbers 0, 1, 2 and 3 in the x axis of plot2d(sin(x),[x,-3,3])

Using epslatex I've found the reason, see the space in the output of non-negative the axis marks labels:

\put(946,704){\makebox(0,0)[r]{\strut{}-1}}%
\put(946,1111){\makebox(0,0)[r]{\strut{}-0.8}}%
\put(946,1518){\makebox(0,0)[r]{\strut{}-0.6}}%
\put(946,1925){\makebox(0,0)[r]{\strut{}-0.4}}%
\put(946,2332){\makebox(0,0)[r]{\strut{}-0.2}}%
\put(946,2740){\makebox(0,0)[r]{\strut{} 0}}%
\put(946,3147){\makebox(0,0)[r]{\strut{} 0.2}}%
\put(946,3554){\makebox(0,0)[r]{\strut{} 0.4}}%
\put(946,3961){\makebox(0,0)[r]{\strut{} 0.6}}%
\put(946,4368){\makebox(0,0)[r]{\strut{} 0.8}}%
\put(946,4775){\makebox(0,0)[r]{\strut{} 1}}%
\put(1078,484){\makebox(0,0){\strut{}-3}}%
\put(2032,484){\makebox(0,0){\strut{}-2}}%
\put(2986,484){\makebox(0,0){\strut{}-1}}%
\put(3941,484){\makebox(0,0){\strut{} 0}}%
\put(4895,484){\makebox(0,0){\strut{} 1}}%
\put(5849,484){\makebox(0,0){\strut{} 2}}%
\put(6803,484){\makebox(0,0){\strut{} 3}}%

In the y axis the left space is not a problem, but in the x-axis the ticks must be

\put(3941,484){\makebox(0,0){\strut{}0}}%
\put(4895,484){\makebox(0,0){\strut{}1}}%
\put(5849,484){\makebox(0,0){\strut{}2}}%
\put(6803,484){\makebox(0,0){\strut{}3}}%

without the left space.

PD: It seems it's a postcript problem. png or gif figures seems to be fine

## Discussion

• non-negative x tick labels shifted to the right

Attachments
• status: open --> closed

• The leading space is done by design in gnuplot. In maxima it can be corrected with

[gnuplot_preamble,"set format '%g'"] (in plot)

user_preamble="set format '%'" (in draw)

• Sorry, a typo: user_preamble="set format '%g'" (in draw)