atialiasing

Help
2009-09-04
2013-03-15
  • Stefan Kummer
    Stefan Kummer
    2009-09-04

    Hello,

    I am using PlPlot 5.9.4 with wxWidgets 2.8. In my wxWidgets-application I tried to make a x,y-plot using wxPLplotwindow (create a wxPLplotwindow-object; gain access to the Plplot-API via the GetStream() function). Everything works fine but the plot is not antialiased!
    How can I turn on antialiasing for a better outlook using wxPLplotwindow and wxPLplotstream? I have already tried to pass the macro "wxPLPLOT_SMOOTH_TEXT" to the constructor of wxPLplotwindow but without any success.

    Best regards
    Stefan

     
    • Werner Smekal
      Werner Smekal
      2009-09-04

      Hi Stefan,

      what compiler do you use? If you use Visual C++, no problem, just recompile wxWidgets with USE_GDIPLUS=1 option (I believe, look at the install file) and you can use the wxGraphicsContext backend. If you use MinGW you might be out of luck, since there are no gdi+ headers for MinGW (at least not legally).
      In that case you must compile and install the agg library and use the AGG backend. Tell me if you have any problems make these solutions work.

      Regards,
      Werner

       
    • Stefan Kummer
      Stefan Kummer
      2009-09-04

      Hi Werner,

      I am using gcc 4.3.3 on LinuxMint 7 (= Ubuntu 9.04).  I have installed Plplot  5.9.4 (including wxPLplot) using cmake without any options.

      Regards,
      Stefan

       
      • Werner Smekal
        Werner Smekal
        2009-09-04

        Then the wxGC driver should be available. Look in bindings/wxwidgets/wxPLplotstream.h.in for the available options, which can be given to wxPLplotwindow (...pl_style):

        /*! Style options for wxPLplotstream:
        *  wxPLPLOT_NONE: no option
        *  wxPLPLOT_FREETYPE: use freetype library instead of Hershey fonts
        *  wxPLPLOT_SMOOTHTEXT: antialiase font (if freetype library is used)
        *  wxPLPLOT_BACKEND_DC: use the standard wxDC backend (always available)
        *  wxPLPLOT_BACKEND_AGG: use the AGG backend (if available)
        *  wxPLPLOT_BACKEND_GC: use the wxGraphicsContext backend (if available)
        *  wxPLPLOT_DRAWTEXT: use wxWidgets routines to draw text
        *  wxPLPLOT_USE_HERSHEY_SYMBOLS: use hershey symbols to draw symbols instead of font symbols
        */

        So if you use wxPLPLOT_BACKEND_GC as pl_style you should get antialised output.

        HTH,
        Werner

        PS: examples/c++/wxPLplotDemo.cpp shows how to use the wxPLplotWindow regarding these options.

         
    • Stefan Kummer
      Stefan Kummer
      2009-09-04

      Hi Werner,

      now it works fine. Thank you very much.

      Regards (und Gruß aus Bayern)
      Stefan