Seperate plot rendering implementation from plotting data generation
Make it easier to replace/plug plotting libraries. The currently used wx.lib.plot doesn't produce visually appealing plots (at least the latest trunk version has antialiasing), we should make it easier to plug different rendering libraries. I'm adapting the cairoplot library rendering backend, the graphs it produces look quite attractive.
Blueprint information
- Status:
- Complete
- Approver:
- None
- Priority:
- Medium
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- Approved
- Series goal:
- None
- Implementation:
-
Implemented
- Milestone target:
-
0.7
- Started by
- Michael Rooney
- Completed by
- Michael Rooney
Whiteboard
2009.12.29 kolmis:
confirming correct fallback-to-wx behavior on windows.
2009.12.29 mrooney:
Sorry, I meant cairo there and not chaco. I want to make sure that if a Windows user has numpy installed but not GTK, that it falls back to the wx plot instead of dying on cairo dependencies.
2009.12.29 kolmis:
I'm not exactly sure what you mean by the chaco ImportError raising. Running on windows, both 'cairo' and 'wx' suggest the 'python-numpy' package installed for plorrint features.
Shouldn't BasePlotImportE
2009.12.29 mrooney:
I removed the chaco support for now, and after testing the fallbacks (except on Windows, I'd like to test that it properly raises an ImportError there for chaco and falls back. If you get a chance to test on Windows before I do, feel free to let me know), I'm calling this Implemented! Thanks again for your excellent contribution.
2009.12.19 kolmis:
yep, the bundled version is the patched one. the tests and test scripts can be deleted.
2009.12.18 mrooney:
Okay, bundling it makes sense then and sounds easy. It is only ~115K or so I see, and the refactoring allowed us to drop bundling plot.py which was 85K, so it more or less paid for itself. Is the bundled cairoplot your sped up version? I think the only left to do on this blueprint is get the chaco plot working as well as the others (or just drop it, it may not be valuable to support three different plotting backends, cairoplot seems pretty sufficient). Am I missing anything? Thanks again for your work, the new cairoplot is much better!
2009.12.18 kolmis:
no, cairplot doesn't have a package, moreover its code is very slow, showing a plot in wxbanker took a long time, i had done some tweaks, and proposed a merge
https:/
but without a response, i'd bundle it with wxbanker for start...
2009.12.18 mrooney: I thought it might be fun to play around with this tonight, so I merged your branch into trunk and pushed it up to ~mrooney/
EDIT: Okay, I actually pushed this up to trunk after some modifications. It now will choose cairo by default if it exists, and can fall all the way back to no summary tab. I added the trend line, and make the y labels formatted as currency. Now I see that I guess cairo plot doesn't have a debian package, so it just has to be included? Also, since I factored out the polyfit logic into the baseplot class, wxBanker doesn't need to carry its own plot.py file, so I was able to drop that which is very nice.
2009.10.17 kolmis: strange i didn't stumble upon chaco when comparing python plotting libraries, it looks cool, though it does not seem lightweight. i added a basic chaco support to my cairoplot branch, try wxbanker.py --debug to have a look. the python-chaco lib in karmic is kind of broken, a quick workaround fix is to patch /usr/lib/
#def move_to(*args): return _agg.GraphicsCo
def move_to(*args): return _agg.GraphicsCo
2009.10.16 mrooney: Excellent, that sounds like a great idea! I had also looked at Chaco (http://