octave-maintainers
[Top][All Lists]
Advanced

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

Re: help with graphics


From: John W. Eaton
Subject: Re: help with graphics
Date: Tue, 25 Oct 2011 19:23:54 -0400

On 26-Oct-2011, Michael Goffioul wrote:

| On Tue, Oct 25, 2011 at 11:47 PM, John W. Eaton <address@hidden> wrote:
| > I'm trying to make the OpenGL renderer do the Matlab compatible thing
| > for log plots with all negative data and I'm having some trouble
| > understanding where to make the changes.  Would someone be willing to
| > give me some pointers?
| >
| > There were some recent changes to the gnuplot renderer so that it
| > could handle negative data for log plots and that seems to mostly
| > work, but the way the OpenGL renderer is constructed doesn't seem to
| > allow this kind of simple change.  In the gnuplot code, it is OK to
| > modify properties in the local copy of the axis_obj structure because
| > it is just a copy of the properties.  But the OpenGL code is typically
| > working directly with get_X methods, so we have to work with local
| > copies of individual data elements, and it seems decisions about what
| > to do for log scale plots with negative data have to be made in
| > several locations.  Any help with sorting this out would be most
| > appreciated.
| 
| As I wrote part of that code, I'd be glad to help, but I'm not sure I
| understand the problem and what you're trying to achieve. Could you
| give me some pointers?

Matlab apparently allows things like

  n = 10;
  x = (1:n)';
  y = logspace (2.5, 4.5, 10);

  semilogy (x, -y);

and creates a semilogy plot with the Y axis going from -10^5 at the
bottom to -10^2 at the top.

The ydata property should contain the unaltered negative data.  The
ylimmode property should be "auto" and the ylim property should be set
to [-(10^5), -(10^2)].  Since the properties don't change, the
renderer must handle all the negative data and do something correct
with it.  Currently, we are just calling transformation functions with
negative data and generating NaNs.  So first I think we have to detect
that we have the case of all negative data, set the limits
appropriately, then negate and scale the data.  I tried to do that,
but I'm apparently still missing something because no plot ever shows
up for me.

jwe


reply via email to

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