[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: graphics issues (was: Re: moving toward a 3.0 release)

From: Paul Kienzle
Subject: Re: graphics issues (was: Re: moving toward a 3.0 release)
Date: Fri, 29 Sep 2006 22:03:03 -0400

On Sep 29, 2006, at 3:16 PM, John W. Eaton wrote:

On 29-Sep-2006, Sebastien Loisel wrote:
Even if you didn't use Bill's code, there's an advantage to
having the tick and label placement logic in .m files. You're
the one who kept asking me for the least amount of stuff to
be done in C++ as possible, and the most possible in .m files.

Sure, it's a reasonable goal, but if some code already exists
to do the job and there's a way for us to use it, there's no
point in reinventing it as a .m file.  So does OpenGL have
good routines for autoplacement of tic marks and axis labels
given data ranges and font metrics?

OpenGL does not have good routines for autoplacement of tics.

I wrote Tcl code which would be easy to translate.  I address
a number of annoyances such as numbers squished too close
or entirely missing, particularly for log scales.

Linear scale tics are always placed at 'nice' numbers ending
in 1, 2 or 5 (with subtics at .2 .5 or 1 respectively).

Logarithmic scale tics also use 'nice' numbers. Depending on
the available space:
  every n decades for really wide ranges
  every decade, with minor tics at 2 and 5
  every decade, 2 and 5, with minor tics at 4,3,6,7,8,9
  every decade,2,3,4,5,6,7,8,9, with no minor tics

Autoscaling pushes the graph range one tic beyond the data.

I do not handle very small linear ranges or very large
log ranges nicely (haven't needed to yet).

Note that OpenGL does not have support for text either.
There are a couple of libraries which provide it but I
haven't used them myself.

- Paul

reply via email to

[Prev in Thread] Current Thread [Next in Thread]