biggles icon indicating copy to clipboard operation
biggles copied to clipboard

expand support to new/multiple backends

Open beckermr opened this issue 11 years ago • 11 comments
trafficstars

plotutils does not seem to be actively maintained at the moment. Thus I think we should try and allow for plotting with a different backend. @esheldon suggested Cairo (http://cairographics.org/).

beckermr avatar Aug 22 '14 09:08 beckermr

Can @nolta comment on the layout mechanism for biggles? And such things as picking axis ranges, etc? I think the defaults in biggles are excellent and in good taste. In addition to the nice object oriented api, these are what drew me to biggles. I would want to preserve them if we supported another back end. Do you mostly hand that off to plotutils or do you do that yourself in the python code?

If it is in the python code then it might be straightforward to port to cairo.

I see in your winston Julia package, which uses cairo, the plots look fairly similar, so that is encouraging.

http://winston.readthedocs.org/en/latest/examples.html

esheldon avatar Aug 22 '14 14:08 esheldon

Yes, porting biggles to cairo should be straightforward.

nolta avatar Aug 22 '14 19:08 nolta

I have been reading the Cairo docs. This should be possible. The xwindows event loops seem a touch tricky to get right and not buggy.

beckermr avatar Feb 28 '17 14:02 beckermr

another alternative backend that looks interesting is pyx. I think it can do everything biggles does, but is a bit clunky to write. It is pure python. Would just need to wrap everything in nice classes. For the show() command would need to spawn to an external program.

esheldon avatar Feb 28 '17 14:02 esheldon

Yeah. I ran into that. Cairo has pycario which should put everything in Python too. I will look again.

beckermr avatar Feb 28 '17 14:02 beckermr

I have been reading the pyx docs and their support for transparency seems limited.

http://pyx.sourceforge.net/manual/color.html#transparency

This is the major motivation for me for moving to a new backend.

Thus I think cairo is probably a better choice since I think it supports this well.

beckermr avatar Mar 28 '17 13:03 beckermr

if we are willing to write pdf then convert to png (and then possibly display that on the screen) then pyx could work.

esheldon avatar Mar 28 '17 13:03 esheldon

This all sounds clunky and slow. I am thinking supporting both backends (plotutils and Cairo+gtk) is the way to go. If you don't have gtk, you can revert back to plotutils. Thoughts?

beckermr avatar Mar 28 '17 13:03 beckermr

I think cairo is definitely worth looking into.

Also I looked into it, and I think I could hack together a barebones X11 image display that would be as fast as plotutils current one (gtk is unbearably slow over the network)

esheldon avatar Mar 28 '17 13:03 esheldon

That sounds good. Cairo's docs seem to imply that it really wants you to use gtk. But hopefully this is not a strict requirement.

beckermr avatar Mar 28 '17 14:03 beckermr

I think the idea is to have cairo write directly to some display buffer, which is I think what plotutils does.

esheldon avatar Mar 28 '17 15:03 esheldon