Menu

#32 Wrong vertical ticks positioning without rotated text

v1.0_(example)
closed
nobody
None
1
2017-09-26
2015-06-11
No

Ticks for a vertical axis have wrong positions if SetRotatedText(false). Tested with 2.3.3 and SVN versions.
The example program:
:::c++

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;
}

1 Attachments

Discussion

  • Petr Aleksandrov

    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
  • Alexey Balakin

    Alexey Balakin - 2015-06-15

    You can use something like

    gr->SetTickShift(mglPoint(0,-0.2);
    

    before axis drawing to partially solve this problem.

     
    • Petr Aleksandrov

      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
  • Alexey Balakin

    Alexey Balakin - 2017-09-26
    • status: open --> closed
     
  • Alexey Balakin

    Alexey Balakin - 2017-09-26

    It look as it was fixed.

     

Anonymous
Anonymous

Add attachments
Cancel