new label/value formatters branch

26 views
Skip to first unread message

mrooney

unread,
Jul 17, 2010, 5:41:11 PM7/17/10
to CairoPlot
Hello, and thanks for the wonderful project!

I recently pushed up a branch at https://code.launchpad.net/~mrooney/cairoplot/label-formatters
which adds the ability to specify formatters for some labels and
values. This allows you to turn your numbers into something more
recognizable by the user, such as a date or currency, by passing in a
function which will return a string from your value. Here are two
screenshots of them in action with currency:

y_formatter on a scatter plot: http://dl.dropbox.com/u/315881/Screenshot-wxBanker-formatters.png
value_formatter on a vertical_bar_plot:
http://dl.dropbox.com/u/315881/Screenshot-wxBanker-formatters1.png

I've proposed it for a merge at https://code.launchpad.net/~mrooney/cairoplot/label-formatters/+merge/30192
so I'd love feedback/thoughts.

This brings me another question: might we hope see some merges and a
release in the near future? My branch is itself a branch of lp:~kolmis/
cairoplot/speedup, and I saw on the list other people are using
unofficial branches, so it seems like it would be great to unify these
improvements and make a 1.2 release or something which merges a few of
the branches people are using, so the community isn't divided up as
much.

Rodrigo Araújo

unread,
Jul 17, 2010, 5:52:40 PM7/17/10
to cair...@googlegroups.com
Hello Michael,

You've done some great work on this branch. I'm on the process of reviewing another one (the handlers branch) and, once I merge it, I'll get to merging the speed up branch and yours.

Maybe I can release a 1.2 version by then.

Cheers,

Rodrigo Araujo


--
You received this message because you are subscribed to the Google Groups "CairoPlot" group.
To post to this group, send email to cair...@googlegroups.com.
To unsubscribe from this group, send email to cairoplot+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cairoplot?hl=en.


Rodrigo Araújo

unread,
Jul 18, 2010, 5:36:12 PM7/18/10
to cair...@googlegroups.com
Hey there Michael, 

Looking carefully through your code today, I devised these new x and y formatters should be added to the DotLinePlot and FunctionPlot as well. I believe it's only a matter of adding the parameters to the classes' __init__ methods and the corresponding functions.

Would you mind adding that?

Thanks a lot,

Rodrigo Araujo

P.S.: Just merged the speed up branch on the main trunk. Next step is to merge yours and Tim Swast, so I can release 1.2.

Mike Rooney

unread,
Jul 18, 2010, 10:12:54 PM7/18/10
to cair...@googlegroups.com
I could probably be coerced to do that. I guess it also needs to go on horizontal_bar_plot, as I think it only works on a vertical one now (there seemed to be a lot of duplication there and also with stacked bar plots).

Is there some file that will generate an image / application using one of each style for checking? Having never used most of these types, it would be really helpful to just run something and see that they all work with some pre-existing data.

Anyway thanks for the fast responses and for your work on integrating these branches!

- Mike
--
Michael Rooney
mro...@ubuntu.com

Rodrigo Araújo

unread,
Jul 19, 2010, 4:20:52 PM7/19/10
to cair...@googlegroups.com
Hey there Mike, 

I might create one of these files soon, but I believe you can test using the included tests.py file. It won't work with your branch right now.

About the duplications on the BarPlot classes, it's true. I have already tried to fix some of that (hence the creation of the BarPlot class), but I guess I didn't get to the bottom of the problem...

Cheers,

Rodrigo Araujo

Rodrigo Araújo

unread,
Mar 10, 2011, 6:26:41 PM3/10/11
to Mike Tafel, cair...@googlegroups.com
Hey Mike,

You replied only to me. I'm forwarding your email to the list.
I'll be glad to help as soon as I get my laptop back from maintenance, which might take a week or two. Maybe Mike Rooney can help you out.

Best regards,

Rodrigo

On Thu, Mar 10, 2011 at 8:22 PM, Mike Tafel <michae...@gmail.com> wrote:
Hi Mike and Rodrigo,

Can you provide a small code sample on how you're using the value
formatter? I think its a great idea and would love to use it to add
commas, percent signs and the like. I am struggling to get it to
work.

Love the library and look forward to a new release.

Thanks in advance,

--Mike


On Jul 19 2010, 1:20 pm, Rodrigo Araújo <alf.rodr...@gmail.com> wrote:
> Hey there Mike,
>
> I might create one of these files soon, but I believe you can test using the
> included tests.py file. It won't work with your branch right now.
>
> About the duplications on the BarPlot classes, it's true. I have already
> tried to fix some of that (hence the creation of the BarPlot class), but I
> guess I didn't get to the bottom of the problem...
>
> Cheers,
>
> Rodrigo Araujo
>
>
>
>
>
>
>
> On Sun, Jul 18, 2010 at 11:12 PM, Mike Rooney <mroo...@gmail.com> wrote:
> > I could probably be coerced to do that. I guess it also needs to go on
> > horizontal_bar_plot, as I think it only works on a vertical one now (there
> > seemed to be a lot of duplication there and also with stacked bar plots).
>
> > Is there some file that will generate an image / application using one of
> > each style for checking? Having never used most of these types, it would be
> > really helpful to just run something and see that they all work with some
> > pre-existing data.
>
> > Anyway thanks for the fast responses and for your work on integrating these
> > branches!
>
> > - Mike
>
> > On Sun, Jul 18, 2010 at 2:36 PM, Rodrigo Araújo <alf.rodr...@gmail.com>wrote:
>
> >> Hey there Michael,
>
> >> Looking carefully through your code today, I devised these new x and y
> >> formatters should be added to the DotLinePlot and FunctionPlot as well. I
> >> believe it's only a matter of adding the parameters to the classes' __init__
> >> methods and the corresponding functions.
>
> >> Would you mind adding that?
>
> >> Thanks a lot,
>
> >> Rodrigo Araujo
>
> >> P.S.: Just merged the speed up branch on the main trunk. Next step is to
> >> merge yours and Tim Swast, so I can release 1.2.
>
> >> On Sat, Jul 17, 2010 at 6:52 PM, Rodrigo Araújo <alf.rodr...@gmail.com>wrote:
>
> >>> Hello Michael,
>
> >>> You've done some great work on this branch. I'm on the process of
> >>> reviewing another one (the handlers branch) and, once I merge it, I'll get
> >>> to merging the speed up branch and yours.
>
> >>> Maybe I can release a 1.2 version by then.
>
> >>> Cheers,
>
> >>> Rodrigo Araujo
>
> >>> On Sat, Jul 17, 2010 at 6:41 PM, mrooney <mroo...@gmail.com> wrote:
>
> >>>> Hello, and thanks for the wonderful project!
>
> >>>> I recently pushed up a branch at
> >>>>https://code.launchpad.net/~mrooney/cairoplot/label-formatters
> >>>> which adds the ability to specify formatters for some labels and
> >>>> values. This allows you to turn your numbers into something more
> >>>> recognizable by the user, such as a date or currency, by passing in a
> >>>> function which will return a string from your value. Here are two
> >>>> screenshots of them in action with currency:
>
> >>>> y_formatter on a scatter plot:
> >>>>http://dl.dropbox.com/u/315881/Screenshot-wxBanker-formatters.png
> >>>> value_formatter on a vertical_bar_plot:
> >>>>http://dl.dropbox.com/u/315881/Screenshot-wxBanker-formatters1.png
>
> >>>> I've proposed it for a merge at

> >>>> so I'd love feedback/thoughts.
>
> >>>> This brings me another question: might we hope see some merges and a
> >>>> release in the near future? My branch is itself a branch of lp:~kolmis/
> >>>> cairoplot/speedup, and I saw on the list other people are using
> >>>> unofficial branches, so it seems like it would be great to unify these
> >>>> improvements and make a 1.2 release or something which merges a few of
> >>>> the branches people are using, so the community isn't divided up as
> >>>> much.
>
> >>>> --
> >>>> You received this message because you are subscribed to the Google
> >>>> Groups "CairoPlot" group.
> >>>> To post to this group, send email to cair...@googlegroups.com.
> >>>> To unsubscribe from this group, send email to

> >>>> .
> >>>> For more options, visit this group at
> >>>>http://groups.google.com/group/cairoplot?hl=en.
>
> >>  --
> >> You received this message because you are subscribed to the Google Groups
> >> "CairoPlot" group.
> >> To post to this group, send email to cair...@googlegroups.com.
> >> To unsubscribe from this group, send email to

> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/cairoplot?hl=en.
>
> > --
> > Michael Rooney

>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "CairoPlot" group.
> > To post to this group, send email to cair...@googlegroups.com.
> > To unsubscribe from this group, send email to

Mike Rooney

unread,
Mar 12, 2011, 5:43:33 AM3/12/11
to cair...@googlegroups.com, Rodrigo Araújo, Mike Tafel
Sure! Check out http://bazaar.launchpad.net/~wxbanker-devs/wxbanker/trunk/view/head:/wxbanker/plots/cairopanel.py, lines 68 and 121. I'm actually not sure why I'm using a lambda, looking at it now, but anyway, you just provide a function which takes the value and returns a string to use instead.

Hope this helps,
Mike

To unsubscribe from this group, send email to cairoplot+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages