I had tried making a pointer and continually failed, so I really love
the "extra effort" way since it is very readable and makes sense as
just a wrapper function that returns what plslabel really wants.  I
wish I had thought of that!

Thanks for the great example,

Ryan

On Fri, Sep 16, 2011 at 8:20 AM, Hazen Babcock <[email protected]> wrote:
>
> I'm still hoping that one of the authors of the function might answer
> your question, though it is possible that no one knows at this point or
> it not actually possible. My guess is that you'd have to use CFFI to
> create a c style pointer to your data.
>
> I think you can work around the need to pass in extra data with a little
> extra effort, e.g. something like this:
>
> def my_label_func(extra_data):
>        local = extra_data
>        def label_func(axis, value, data):
>                .. do something with local..
>
>        return label_func
>
> plslabelfunc(my_label_func(my_data))
>
> -Hazen
>
> On 09/14/2011 04:26 PM, Ryan Hamilton wrote:
>> Hi,
>>
>> Could anyone provide an example of how to pass additional information
>> to the custom label function (plslabelfunc) in Python?  I can't seem
>> to get it right, everything I try to pass dies with a type error and
>> Example 19 just passes None.  I'm using 5.9.8, but that shouldn't
>> matter for this since I think it's a problem of mine and not plplot's.
>>   Thanks!
>>
>> Ryan Hamilton
>> Graduate Student
>> NMSU Astronomy
>> [email protected]
>>
>> ------------------------------------------------------------------------------
>> BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
>> Learn about the latest advances in developing for the
>> BlackBerry&reg; mobile platform with sessions, labs&  more.
>> See new tools and technologies. Register for BlackBerry&reg; DevCon today!
>> http://p.sf.net/sfu/rim-devcon-copy1
>> _______________________________________________
>> Plplot-general mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/plplot-general
>
>
>
>

------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
http://p.sf.net/sfu/rim-devcon-copy2
_______________________________________________
Plplot-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-general

Reply via email to