Wrong vertical ticks positioning without rotated text
A library for scientific data visualization
Brought to you by:
abalakin
Ticks for a vertical axis have wrong positions if SetRotatedText(false). Tested with 2.3.3 and SVN versions.
The example program:
:::c++
int main() {
mglGraph graph;
graph.SetRotatedText(false);
graph.SetRanges(-1.0, 1.0, -1.0, 1.0);
graph.Box();
graph.Axis();
graph.WritePNG("test.png");
return 0;
}
Anonymous
I'm sorry, the formatting of code is wrong. The right version:
#include <mgl2/mgl.h>
int main() {
mglGraph graph;
graph.SetRotatedText(false);
graph.SetRanges(-1.0, 1.0, -1.0, 1.0);
graph.Box();
graph.Axis();
graph.WritePNG("test.png");
return 0;
}
I used Ubuntu 15.04 with GCC 5.1 and compiled MathGL with LTO (added "-flto" flags to CMAKE_C_FLAGS and CMAKE_CXX_FLAGS and "-flto -O3" to CMAKE_EXE_LINKER_FLAGS, CMAKE_MODULE_LINKER_FLAGS and CMAKE_SHARED_LINKER_FLAGS).
Last edit: Petr Aleksandrov 2015-06-11
You can use something like
before axis drawing to partially solve this problem.
It seems not to help. I have added "graph.SetTickShift(mglPoint(0,-0.2));" before "graph.Box();". The problem hasn't been solved. I have used MathGL 2.3.5.1.
Last edit: Petr Aleksandrov 2016-10-14
It look as it was fixed.