Menu

graphics library

Michael
2006-01-16
2013-04-25
  • Michael

    Michael - 2006-01-16

    hi

    i would like to programm the "bar" command and the "barh" command, but I don't know, which graphics library should be used for this. In Octave, till know there are no "patch-support" because they still use gnuplot..
    I need the bars like in Matlab, filled and with distance between them, I have saw, the m-file interface is like in matlab, but no code behind the head comment.. should i use OpenGL ?? or something else...??

     
    • Michael

      Michael - 2006-01-16

      ok, stupid question..
      i looked into your patch.cpp and saw you are using openGL.. ok.. I will try do the same..

       
      • Shai Ayal

        Shai Ayal - 2006-01-16

        Michael

        I am not sure I understand what you are trying to do -- do you want to implement bar & barh to work with octplot? or are you writing your own graphics back end?

        If you are trying with octplot, have a look at the bar.m which is in the cvs:

        <a href="http://cvs.sourceforge.net/viewcvs.py/octplot/octplot/src/bar.m?rev=1.2&view=auto">bar.m</a>

        It will give you a good base to start. If you manage to make a better bar.m, please consider sending it to me to be included in the octplot distribution.

        Shai

         
    • Michael

      Michael - 2006-01-17

      Thanks Shai

      I used an older version of bar.m and there was no code insight, only the m-file interface...
      now its great..

      question: would you like to be mostly matlab compatible with your octplot commands?

      Michael

       
      • Shai Ayal

        Shai Ayal - 2006-01-17

        I'm glad it works for you ...

        I am trying to be like octave -- better than matlab but backwards compatible -- i.e. code written for matlab should run in octplot, but code written for octplot might not run in matlab

        Shai

         
    • Michael

      Michael - 2006-01-17

      mhh... another question:
      have you forgotten the return value for the handle?

      x = 1:10;
      h = bar(x) will produce following warning message:

      warning: in /usr/local/libexec/octave/2.9.3/site/octplot-0.3.0/bar.m near line 6, column 3:
      warning: bar: some elements in list of return values are undefined
      h = [](0x0)

      Michael

       
    • Michael

      Michael - 2006-01-17

      so I can tell you following difference:

      x = 1:10;
      bar(x);

      will produce in octplot a nice graphics with the expectet bars. the same happens in matlab.

      with
      bar(x,x) both programms, octave (octplot) and matlab do the same.

      now in matlab I can change the color with
      bar(x,'k') .. this will produce bars in black..

      octplot will produce an error..

      I need some time, to understand your programming style. If I checked this, I will help you with some m-files..

      Michael

      PS: waht happens with h=bar(x) in octplot... there is no handle, octplot generates an error message?

       
      • Shai Ayal

        Shai Ayal - 2006-01-17

        Michael,

        I will try and correct bar to return the handles of the patch objects tonight. I will email you when it's done.

        As for any other bugs, It would be best if you file them as bugs, since this makes it easier for me and other users to follow-up

        Thanks for helping to debug octplot
        Shai

         
      • Shai Ayal

        Shai Ayal - 2006-01-17

        OK Michael,

        I corrected bar.m and now it outputs the handles of the patch objects it creates. The new version (1.3) of bar.m was commited to CVS. However it might take some time (~ hours) to show up on the public CVS

        tell me if it is OK

        Shai

         
    • Michael

      Michael - 2006-01-17

      Shai,

      of course, sorry..
      I forgott it, because we are in the middle of the discussion.. 

       
    • Michael

      Michael - 2006-01-18

      Thanks a lot

      it works great and sorry again for reporting this not implemented feature (it was not really a bug) in this discussion forum.

      Thanks
      Michael

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.