|
From: Adrian F. <fe...@ma...> - 2000-06-30 13:21:42
|
Hi, I'm sorry for the delay.
On Sat, 10 Jun 2000, Jan Sochman wrote:
> I have two problems:
> - I used custom ticks labels with angle 90
> gtk_plot_axis_labels_set_attributes(...,90,..);
> gtk_plot_axis_use_custom_tick_labels(...);
> when I then put some texts as labels, they are drawn partialy over graph
> itself. How could I avoid this?
>
The problem is that you have to set the justification of the labels. What
I do in SG is the following:
switch(the_axis){
case 0:
if(axis->labels_attr.angle == 90 ||
axis->labels_attr.angle == 270)
axis->labels_attr.justification = GTK_JUSTIFY_CENTER;
if(axis->labels_attr.angle == 0)
axis->labels_attr.justification = GTK_JUSTIFY_RIGHT;
if(axis->labels_attr.angle == 180)
axis->labels_attr.justification = GTK_JUSTIFY_LEFT;
break;
case 1:
if(axis->labels_attr.angle == 90 ||
axis->labels_attr.angle == 270)
axis->labels_attr.justification = GTK_JUSTIFY_CENTER;
if(axis->labels_attr.angle == 0)
axis->labels_attr.justification = GTK_JUSTIFY_LEFT;
if(axis->labels_attr.angle == 180)
axis->labels_attr.justification = GTK_JUSTIFY_RIGHT;
break;
case 2:
if(axis->labels_attr.angle == 0 ||
axis->labels_attr.angle == 180)
axis->labels_attr.justification = GTK_JUSTIFY_CENTER;
if(axis->labels_attr.angle == 90)
axis->labels_attr.justification = GTK_JUSTIFY_LEFT;
if(axis->labels_attr.angle == 270)
axis->labels_attr.justification = GTK_JUSTIFY_RIGHT;
break;
case 3:
if(axis->labels_attr.angle == 0 ||
axis->labels_attr.angle == 180)
axis->labels_attr.justification = GTK_JUSTIFY_CENTER;
if(axis->labels_attr.angle == 90)
axis->labels_attr.justification = GTK_JUSTIFY_RIGHT;
if(axis->labels_attr.angle == 270)
axis->labels_attr.justification = GTK_JUSTIFY_LEFT;
}
You can also play with axis->labels_offset (distance to the axis).
> - Using only gtk_plot_axis_set_title for bottom axis I got title very
> close to bottom axis and colliding with ticks labels. How to avoid this?
>
The titles position is in
axis->title.x/y
I'm going to add methods to tha API to handle this.
>
> Jen~a
>
>
> _______________________________________________
> Scigraphica-gtkextra mailing list
> Sci...@li...
> http://lists.sourceforge.net/mailman/listinfo/scigraphica-gtkextra
>
|