Render problem with dot_line_plot

73 views
Skip to first unread message

Paul

unread,
May 29, 2009, 9:35:35 AM5/29/09
to CairoPlot
Whenever I create a dot_line_plot, and even by running the examples
found here, http://linil.wordpress.com/2008/06/14/cairoplot-plotting-graphics-using-python-and-cairo/,
the render is not exactly the same as expected. There is no legend
next to the dot lines (on the right), so my graphs aren't very useful,
whithout any informations...

I'm using pycairo 1.4.12 on OpenSuse 11, and have tested several
CairoPlot version (trunk, 1.1, and the "legends" branch), without
success. Anyone has an idea of the possible cause of this problem ?

Here is the code I use:
#!/usr/bin/python
import cairo
import math

import CairoPlot

teste_data = [0, 1, 3, 8, 9, 0, 10, 10, 2, 1]
CairoPlot.dot_line_plot('teste', teste_data, 400, 300, axis=True)

teste_data_2 = {"john" : [10, 10, 10, 10, 30], "mary" : [0, 0, 3, 5,
15], "philip" : [13, 33, 11, 25, 2]}
teste_h_legend = ["jan/2008", "feb/2008", "mar/2008", "apr/2008", "may/
2008"]
CairoPlot.dot_line_plot('teste2', teste_data_2, 400, 300, axis = True,
grid = True,dots=True)

Rodrigo Araújo

unread,
May 29, 2009, 10:02:13 AM5/29/09
to cair...@googlegroups.com
Hello Paul,

Through the evolution of CairoPlot, that legend representation was removed as it had too many overlapping problems.
Using the trunk version, take a look at this example on tests.py

#Labels
data = { "john" : [-5, -2, 0, 1, 3], "mary" : [0, 0, 3, 5, 2], "philip" : [-2, -3, -4, 2, 1] }
x_labels = [ "jan/2008", "feb/2008", "mar/2008", "apr/2008", "may/2008" ]
y_labels = [ "very low", "low", "medium", "high", "very high" ]
cairoplot.dot_line_plot( "dot_line_2_dictionary_labels", data, 400, 300, x_labels = x_labels, 
                         y_labels = y_labels, axis = True, grid = True,
                         x_title = "x axis", y_title = "y axis", series_legend=True )

This example will generate a little white box on the upper right corner containing the legend of the chart :)

Hope this helps,

Rodrigo Araújo

Paul

unread,
May 29, 2009, 10:17:55 AM5/29/09
to CairoPlot
Awesome support for an awesome library. This is exactly what I needed.

Thank you very much,
Paul.

On May 29, 3:02 pm, Rodrigo Araújo <alf.rodr...@gmail.com> wrote:
> Hello Paul,
> Through the evolution of CairoPlot, that legend representation was removed
> as it had too many overlapping problems.
> Using the trunk version, take a look at this example on tests.py
>
> #Labels
>
> data = { "john" : [-5, -2, 0, 1, 3], "mary" : [0, 0, 3, 5, 2],
> "philip" : [-2, -3, -4, 2, 1] }
>
> x_labels = [ "jan/2008", "feb/2008", "mar/2008", "apr/2008", "may/2008" ]
>
> y_labels = [ "very low", "low", "medium", "high", "very high" ]
>
> cairoplot.dot_line_plot( "dot_line_2_dictionary_labels", data, 400,
> 300, x_labels = x_labels,
>
>                          y_labels = y_labels, axis = True, grid = True,
>
>                          x_title = "x axis", y_title = "y axis",
> series_legend=True )
>
> This example will generate a little white box on the upper right corner
> containing the legend of the chart :)
>
> Hope this helps,
>
> Rodrigo Araújo
>
> On Fri, May 29, 2009 at 10:35 AM, Paul <3vo...@gmail.com> wrote:
>
> > Whenever I create a dot_line_plot, and even by running the examples
> > found here,
> >http://linil.wordpress.com/2008/06/14/cairoplot-plotting-graphics-usi...
> > ,

Rodrigo Araújo

unread,
May 29, 2009, 10:22:41 AM5/29/09
to cair...@googlegroups.com
Thanks man, you're welcome to ask whenever you need :)

Best regards,

Rodrigo
Reply all
Reply to author
Forward
0 new messages