|
From: SourceForge.net <no...@so...> - 2005-02-10 11:32:38
|
Feature Requests item #1118152, was opened at 2005-02-07 22:00 Message generated for change (Comment added) made by fdborges You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=442889&aid=1118152&group_id=45430 Category: Interface Improvements (example) Group: Next Release (example) Status: Open Priority: 5 Submitted By: Francisco Dellatorre Borges (fdborges) Assigned to: Nobody/Anonymous (nobody) Summary: default args for data.(list|file)(x=1,y=2) Initial Comment: All graph data entries must have a x and y coordinates. It would be more sensible to determine a default order for these in the data so as to avoid the typing of x=1,y=2 at every single data.(list|file) call. Just as users (e.g. me) of a cmd line plotting routine expect to call $ bozoplot results.dat with two columns entries: 0 1 1 3 etc and have a graph plotting these as x, y. Users (e.g. I) would expect to be able to call pyx.graph.graphxy.data. methods without having to specify at every call which is column x and which is y. Francisco. ---------------------------------------------------------------------- >Comment By: Francisco Dellatorre Borges (fdborges) Date: 2005-02-10 12:32 Message: Logged In: YES user_id=576554 1. I think a wrapper would be nice and I thought about making one myself. I have some code that already works as a wrapper but it's scathered and as I need to deliver a thesis chapter by the end of this month, I haven't actually started putting the code pieces together. 2. Yet, I still would like to be able to code some things faster and a wrapper won't help much at it. When drawing some illustrative didactic graphs for my thesis, I end up calling data.list 4 or 5 times in a file, (and that's using attr.changelist([a,b,c]) to avoid extra calls as in: g.plot([ data.list(i, x=1, y=2, text=3) for i in [pts, pts1, pts2] ], [st.line([attr.changelist( [linewidth.thick, linewidth.normal,linewidth.normal] ), attr.changelist( [linestyle.solid, linestyle.dashdotted, linestyle.dashdotted ] )]), st.text(textdx=0.5, textdy=0)]) Perhaps allow setting default values at a data.list instance initialization and then allow more instances to be created from this one? dlst = data.list(None, x=1, y=2, dy=3) # setting default values. g.plot(dlst(d1, text=4), style1) g.plot(dlst(d2, stacked=4), style2) I don't know exactly how this should be implemented, as you seem to need different data.list objects to process, the class object would have to became a object factory separating the current data.list.__init__ method into __init__ and __call__. Hackish solutions in this direction would be easy to implement and a more clean version shouldn't be too much of a problem. ---------------------------------------------------------------------- Comment By: Jörg Lehmann (joergl) Date: 2005-02-08 09:55 Message: Logged In: YES user_id=390410 I agree with André. Such a policy should not be part of the data component. In order to support quick&easy plotting, a wrapper providing some standard plot types as suggested recently by Michael Hagemann on the pyx-user is the way to go. ---------------------------------------------------------------------- Comment By: André Wobst (wobsta) Date: 2005-02-08 09:06 Message: Logged In: YES user_id=405853 Couldn't you do this within your bozoplot command? The point is that graph.data.file and the like do not know anything about the column names they need to fill with data. It's designed the other way around. You provide some data and the graph styles (by the help of the axis names available in the graph) will tell you, whether this is a valid request. I do not want to stress that too much, especially since we currently have an xy graph only, but the axis names could be completely different in an polar plot, a 3-d plot etc. And other graph styles like text, arrow, errorbars etc. want other data as well. I would not like to see a semi-guessing solution in PyX. Comments? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=442889&aid=1118152&group_id=45430 |