Manuel Metz wrote:
> May I ask again: Is there any interest in a step-plotting function?
Yes, so thanks for taking the initiative and for being persistent.
> 
> If so, who will commit the patch? Do I have to add more myself 
> (documentation for sure needs to be added, what else ?)
Please add a docstring and a simple demo suitable for the examples 
subdirectory.  I will commit the patch, or some modification of it.
> 
> Manuel
> 
> Manuel Metz wrote:
>> Hi,
>> okay, I have added a keyword 'where' as suggested. I also now changed 
>> the way the incoming data is converted. I took this from the axes.pie() 
>> function. I don't know much about the unit types yet :-(
>>
>> Concerning masked arrays: Do I have to consider something special there?
I think that if you change the npy.asarray to npyma.array, and similarly 
for the zeros(), that will provide basic masked array support. Please 
look at masked_demo.py for an example of the use of masked arrays.  (It 
is very artificial, of course.  A typical use case for masked arrays is 
when you have a data stream with some bad points that you want to edit 
out, but you want to keep the array dimensions unchanged.  In the case 
of a line plot or step plot, you want the line to break at the missing 
point to show that a point has been removed.)

Eric

>>
>> Manuel
>>
>> Ted Drain wrote:
>>> At 10:36 AM 8/14/2007, Eric Firing wrote:
>>>> Ted Drain wrote:
>>>>> Manuel,
>>>>> We do plots like this all the time.  One thing we've found that's 
>>>>> nice to have is a keyword that controls when the increase in y 
>>>>> happens.  We use a step style keyword that can be 'pre' (go up then 
>>>>> right), 'post' (go right then up), and 'mid' (right 0.5, up, right 
>>>>> 0.5).
>>>> Good idea.
>>>>> Regarding your patch, you might want to check other areas in MPL for 
>>>>> data processing examples.  I could be wrong but I'm not sure you can 
>>>>> assume that incoming data is a float.  Some of the unit conversion 
>>>>> examples or the line collection code might have better examples.
>>>> Incoming data can be any numeric type, but it ends up getting 
>>>> converted to the default float type (not float32) internally.
>>>>
>>>> Whenever possible, it is good to support masked array input.
>>> Agreed - but the way the patch was written, I don't think it will 
>>> support anything but float (especially not the unit types).
>>>
>>>> Eric
>>>>> Ted
>>>>> At 07:59 AM 8/14/2007, Manuel Metz wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I have created a patch against latest svn that adds a function step 
>>>>>> to the axes class to plot step-functions ;-) It's really simple but 
>>>>>> nice ... Any interest in adding this?
>>>>>>
>>>>>> Manuel
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Index: axes.py
>>>>>> ===================================================================
>>>>>> --- axes.py     (revision 3709)
>>>>>> +++ axes.py     (working copy)
>>>>>> @@ -4995,6 +4995,18 @@
>>>>>>                                                   steps=[1, 2, 5, 10],
>>>>>>                                                   integer=True))
>>>>>>          return im
>>>>>> +
>>>>>> +    def step(self, x, y, *args, **kwargs):
>>>>>> +        x2 = npy.zeros((2*len(x)), npy.float32)
>>>>>> +        y2 = npy.zeros((2*len(x)), npy.float32)
>>>>>> +
>>>>>> +        x2[0::2] = x
>>>>>> +        x2[1::2] = x
>>>>>> +
>>>>>> +        y2[1::2] = y
>>>>>> +        y2[2::2] = y[:-1]
>>>>>> +
>>>>>> +        self.plot(x2, y2, *args, **kwargs)
>>>>>>
>>>>>>  class SubplotBase:
>>>>>>      """
>>>>>>
>>>>>> -------------------------------------------------------------------------
>>>>>>  
>>>>>>
>>>>>> This SF.net email is sponsored by: Splunk Inc.
>>>>>> Still grepping through log files to find problems?  Stop.
>>>>>> Now Search log events and configuration files using AJAX and a 
>>>>>> browser.
>>>>>> Download your FREE copy of Splunk now >>  http://get.splunk.com/
>>>>>> _______________________________________________
>>>>>> Matplotlib-devel mailing list
>>>>>> Matplotlib-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>>>>> ------------------------------------------------------------------------ 
>>>>>
>>>>> ------------------------------------------------------------------------- 
>>>>>
>>>>> This SF.net email is sponsored by: Splunk Inc.
>>>>> Still grepping through log files to find problems?  Stop.
>>>>> Now Search log events and configuration files using AJAX and a browser.
>>>>> Download your FREE copy of Splunk now >>  http://get.splunk.com/
>>>>>
>>>>> ------------------------------------------------------------------------ 
>>>>>
>>>>> _______________________________________________
>>>>> Matplotlib-devel mailing list
>>>>> Matplotlib-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>>>
>>> ------------------------------------------------------------------------
>>>
>>> -------------------------------------------------------------------------
>>> This SF.net email is sponsored by: Splunk Inc.
>>> Still grepping through log files to find problems?  Stop.
>>> Now Search log events and configuration files using AJAX and a browser.
>>> Download your FREE copy of Splunk now >>  http://get.splunk.com/
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Matplotlib-devel mailing list
>>> Matplotlib-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>> ------------------------------------------------------------------------
>>
>>
>> ------------------------------------------------------------------------
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Splunk Inc.
>> Still grepping through log files to find problems?  Stop.
>> Now Search log events and configuration files using AJAX and a browser.
>> Download your FREE copy of Splunk now >>  http://get.splunk.com/
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Matplotlib-devel mailing list
>> Matplotlib-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/
> _______________________________________________
> Matplotlib-devel mailing list
> Matplotlib-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to