Norbert,
I am splitting this thread because I think different issues are involved
in different parts.
>
>> In looking at your original patch, I also wondered what is the reason
>> for supporting 3 different ways of specifying "_draw_nothing"? (I had
>> not previously noticed that there was any such thing at all, and I guess
>> I don't understand what it is for.)
>> class Line2D(Artist):
>> _lineStyles = {
>> '-' : '_draw_solid',
>> '--' : '_draw_dashed',
>> '-.' : '_draw_dash_dot',
>> ':' : '_draw_dotted',
>> 'steps': '_draw_steps',
>> 'None' : '_draw_nothing',
>> ' ' : '_draw_nothing',
>> '' : '_draw_nothing',
>> }
>>
> The idea was to be able to say something like
> plot(x,y,line='',marker='o',color=(.2,.5,.8))
> which seemed a bit more intuitive to me than line='None' when I created
> the patch. By now, I wonder about it myself...
It raises larger API questions. From the standpoint of user-level code
readability, the present array of marker and line identifiers (inherited
from Matlab) is not good. For example, why should '-' mean a solid
line, but '_' means a horizontal line marker? What is the difference
between '^' and '2', and how on earth is anyone reading the code
supposed to know what '2' means? The only justification I can see for
the 1- and 2-character codes is their convenience in interactive use for
things like "plot(x,y,'g.'". I would not want this to go away, but for
non-interactive coding I think longer names, typically corresponding to
the name of the function that generates the marker (in the case of
markers) should be available and used. Further, it may be that only the
set of unique descriptive names should be available at the level of
lines.py, and the shorthand versions should be relegated to support code
for the plot command, which is at a higher level. Going even further,
maybe the short format strings should be limited to a subset of
available lines and markers. Is it really important to let people write
"plot(x,y,'g2')" instead of "plot(x,y, color='g', marker='tri_up')"? (I
still don't know what is the difference between "tri_up" and "triangle_up".)
This needs either some broader discussion, or a command decision by John
along the lines of "Forget it; it's OK the way it is, or it is too late
to make any change in this part of the API."
Eric
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel