Re: logarithmic axis/grids
- From: Fabian Foerg <fabian foerg gmx de>
- To: Laurent Perez <laurent perez unicaen fr>, gtkdatabox-list gnome org, gustavo users sourceforge net
- Subject: Re: logarithmic axis/grids
- Date: Tue, 16 Oct 2007 21:37:26 +0200
Laurent Perez wrote:
Hello ;
According to Gtk documentation, GtkRuler is considered too specialized
and will eventually be removed from Gtk. NxpRuler seems to be what
GtkDatabox lacks to be the perfect widget we need.
I've created 2 packages from Fabian's cournol [1] that can be found here
[2] :
- NxpRuler ;
- modified version of GtkDatabox to use NxpRuler.
I wrote a small example (ex-1.c in examples dir) but unfortunately I
didn't succeed in :
- making changes on the ruler to change accordingly the graph ;
- using ruler log mode.
As far as I can see, cournol didn't use the modified version of
GtkDatabox. So, Fabian, am I doing something wrong ?
Thanks.
Laurent.
References :
¯¯¯¯¯¯¯¯¯¯¯¯
[1] http://cournol.k-2007.de
[2] http://laurent.perez2.free.fr/download/gtk
_______________________________________________
gtkdatabox-list mailing list
gtkdatabox-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkdatabox-list
Cournol uses the modified version of gtkdatabox, i. e. the rulers from
counrol are nxprulers not gtk rulers. The modification patch is under
patches/gtkdatabox.diff in the cournol source archive.
Cournol does not use logarithmic scales, though. You can easily replace
the linear scale with a logarithmic one by adding the line
"nxp_ruler_set_mode(NXP_RULER(ruler), NXP_RULER_LOG);" after the
initialization of "ruler". Your ex-1.c looks like lib/nxpruler/test.c
from the gnumexp sources. So actually it should work.
> I wrote a small example (ex-1.c in examples dir) but unfortunately I
> didn't succeed in :
> - making changes on the ruler to change accordingly the graph ;
What do you mean? In ex-1.c no graph, only a drawing area is drawn.
Here, the scales change appropriately when you resize the window.
For changing the range of the scale, you would write, for example:
"nxp_ruler_adjustment_set_range(nxp_ruler_get_adjustment(NXP_RULER(vruler)),
0, 10);". This changes the scale range from 0 to 10.
While testing the logarithmic scale, I encountered a problem.
---snip---
nxp_ruler_set_mode(NXP_RULER(vruler), NXP_RULER_LOG);
nxp_ruler_adjustment_set_range(nxp_ruler_get_adjustment(NXP_RULER(vruler)),
x, y);
---snip---
This code sets a scale range from 10^x to 10^y for vruler.
Actually, I had expected a scale from x to y which gets logarithmically
"denser" (or "wider", respectively) from one side to the other side.
Maybe I totally misunderstood the concept.
Gustavo, any ideas?
Greets,
Fabian
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]