Re: [matplotlib-devel] Request: make plotting of a single point more convenient
I wrote a wrapper to do this for my own code because I wanted it so much. I can't see why it would be a problem to support, it's only one extra if statement. +1 from me! On Sat, Jul 25, 2009 at 1:16 AM, Jan Müller wrote: > basically this works: > > plot([1], [1], "*") > > but I think it would be more convenient to add some kind of auto casting to > the function in order to make this > > plot(1, 1, "*") > > work. > > I use those single-point-plotting-commands a lot in order to highlight a > special point in a series of data, but I forget the [] all the time. > > Besides being much more convenient (at least for me) this behavior would also > be much closer to the matlab version, since this works there without any > problems. > > Any ideas/comments/criticism on this? > > -- > ___ > Matplotlib-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel > -- Robert H. Clewley, Ph.D. Assistant Professor Department of Mathematics and Statistics and Neuroscience Institute Georgia State University 720 COE, 30 Pryor St Atlanta, GA 30303, USA tel: 404-413-6420 fax: 404-413-6403 http://www2.gsu.edu/~matrhc http://brainsbehavior.gsu.edu/ -- ___ Matplotlib-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Re: [matplotlib-devel] Request: make plotting of a single point more convenient
On Sat, Jul 25, 2009 at 3:13 PM, Rob Clewley wrote: > I wrote a wrapper to do this for my own code because I wanted it so > much. I can't see why it would be a problem to support, it's only one > extra if statement. Or zero extra statements, if one just replaces the if len(x.shape) == 1: x = x[:, np.newaxis] lines with while len(x.shape) < 2: x = x[:, np.newaxis] -- Nathaniel -- ___ Matplotlib-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Re: [matplotlib-devel] Request: make plotting of a single point more convenient
Rob Clewley wrote: > I wrote a wrapper to do this for my own code because I wanted it so > much. I can't see why it would be a problem to support, it's only one > extra if statement. > > +1 from me! Done in svn 7294. Eric > > On Sat, Jul 25, 2009 at 1:16 AM, Jan Müller wrote: >> basically this works: >> >> plot([1], [1], "*") >> >> but I think it would be more convenient to add some kind of auto casting to >> the function in order to make this >> >> plot(1, 1, "*") >> >> work. >> >> I use those single-point-plotting-commands a lot in order to highlight a >> special point in a series of data, but I forget the [] all the time. >> >> Besides being much more convenient (at least for me) this behavior would >> also be much closer to the matlab version, since this works there without >> any problems. >> >> Any ideas/comments/criticism on this? >> >> -- >> ___ >> Matplotlib-devel mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel >> > > > -- ___ Matplotlib-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
