From: Sameer R. <re...@gm...> - 2009-08-20 06:01:53
|
We are working on plotting mesh (in hermes2d: http://hpfem.math.unr.edu/projects/hermes2d-new/) We created a python function to plot mesh but initially without curves. Later we also tried to work on curved elements but we are having some problems. In the hermes2d examples curves are defined as [4, 7, 45] where 4,7 are vertices indices, and 45 is center angle. But in matplotlib we do not see any function to plot curve with these data, we have to convert them into something more useful to those functions available in matplotlib. For ex: 1) matplot.path porvides a way to plot curve with three points http://matplotlib.sourceforge.net/api/path_api.html#module-matplotlib.path p1 -> starting Point p2 -> control point p3 -> end point iI we want to go this way we do have p1 & p3 but have to calclate p2 (control point) 2) matplot.patch.arc provides a way to plot an arc http://matplotlib.sourceforge.net/api/artist_api.html#module-matplotlib.patches but it needs -> center of circle -> start angle -> end angle -> radius of circle we have to calculate all these with data available to us We didn't find other ways of plotting curves using matplotlib...and in our view method 1 is the best way for us because currently we have implemented matplotlib.path to draw mesh without curves, and it will be easy to fill color this way. We tried the method 1 but the result was a garbled mesh. I would appreciate if anybody could guide us how we can use the matplotlib functions to draw curved elements if we are given information as described above. Thanks |