Some issue with the subtitle box

12 views
Skip to first unread message

Eduardo

unread,
Jul 16, 2010, 7:02:52 PM7/16/10
to CairoPlot
Hi, I'm using the vertical_bar_plot and its working perfectly.
The only issue I have is toward the subtitle box in the top right of
the graph.

Sometimes, when the last group (that is below the box) has some value
high, the box hides the bars...and I can't see its values.

The question is: There is some way to move a bit the box to the
right??

I even tried to include another x_label with an space in the string,
but was not too good the result.

Thanks

Eduardo

Rodrigo Araújo

unread,
Jul 18, 2010, 8:55:31 AM7/18/10
to cair...@googlegroups.com
Hey there Eduardo,

By now, it's not possible to define other positions to the subtitles box... You might try to change its position by modifying the render_legend method, though.

I intend to add the possibility to select a corner for the legends on future versions.

Cheers,

Rodrigo


--
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.


Eduardo

unread,
Jul 19, 2010, 1:45:31 PM7/19/10
to CairoPlot
Hi Rodrigo, my problem was fixed.

First, I needed to move the legend box 100px to the right.

So, first I needed to change the create_surface method in Plot class.
I just added this:

width = width + 100

And then I changed the render_legend method under BarPlot class.
Every "cr.rectangle" call, I changed the first parameter to whatever
it was + 100.
And in the "cr.move_to" call, plus 100 again.

This makes the legend box stay outside the graph.

Thats it

Thanks Rodrigo, for the advice...it saved me a lot of time.

Cheers
> > cairoplot+...@googlegroups.com<cairoplot%2Bunsu...@googlegroups.com>
> > .

Mike Rooney

unread,
Jul 19, 2010, 1:50:26 PM7/19/10
to cair...@googlegroups.com
That sounds interesting as I am experiencing this as well on a scatter plot where the trend is generally "up and to the right". I was wondering if just having the box background be slightly transparent might work around the issue sufficiently as well, since adding 100 horizontal pixels to every graph seems like it might be too much.

I don't know that much about Cairo but I suspect this is possible. Would anyone have any tips?

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.




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

Mike Rooney

unread,
Jul 19, 2010, 6:10:09 PM7/19/10
to cair...@googlegroups.com
That's perfect, thanks so much! I've applied this locally to Bar and Scatter plots.

On Mon, Jul 19, 2010 at 1:16 PM, Rodrigo Araújo <alf.r...@gmail.com> wrote:
Just tried to add an alpha value to the set_source_rgba method on line 1077 inside the render_legend method of the BarPlot class.

        cr.set_source_rgba(1,1,1,0.5)

This way, the box gets 50% transparent. I liked the result (attached), maybe we can make this the default on a future version.



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

Rodrigo Araújo

unread,
Jul 19, 2010, 8:34:55 PM7/19/10
to cair...@googlegroups.com
Glad to help, it's great to see people using cairoplot!

> To unsubscribe from this group, send email to cairoplot+unsubscribe@goo

Reply all
Reply to author
Forward
0 new messages