display points using log scale
Don Murray
dmurray at unidata.ucar.edu
Mon Mar 26 13:36:25 MDT 2007
Hi Celine-
Attached is a program that lets the user switch between
log and non-log Y axis. It's based on the LogTest file
I sent you earlier off list. Note that as before you
need to explicitly set the range for the logMap. I'm
not sure why it doesn't autoscale.
Hope it helps.
Don
Don Murray wrote:
> Hi Celine-
>
> I'm travelling and don't have time to do this justice, but
> here's my take on it. I have not been able to follow your
> code in detail, but here's my take on it. You have some
> X or Y values. You can use X or Y for those real types.
> For the Log values, you can create a RealType (e.g. LogX,
> LogY) which is used for the reference realtype of the
> LogCoordinateSystem. VisAD automatically does the calculations
> converting the values to the log values. What you have below
> looks like you are trying to go the other way. Your Integer1DSet
> has index as the reference of the CS so values of 0,1,2,3 will
> get converted to the log of those values when index is mapped
> to a scale. I would think you would want it the other way.
>
> Another question is are you removing the non-log scalar maps
> when you switch to log displays and vice-versa?
>
> Again, I'm travelling so may not answer until I get back.
>
> Don
>
>
> Celine Gestas wrote:
>> Thank you for your answer but there is no change : points are
>> displayed but
>> not in the log scale, it keeps the default scale. What I changed is :
>>
>> index = RealType.getRealType("index",
>> CommonUnit.promiscuous);
>> indexLog = RealType.getRealType("indexLog",
>> CommonUnit.promiscuous); // new RealType
>> referenceIndex = new RealTupleType(index);
>> LogCoordinateSystem logCSindex = new
>> LogCoordinateSystem(referenceIndex, base);
>> rangeIndex = new RealTupleType(indexLog,
>> logCSindex,
>> null); // use the new
>> RealType
>> index_set = new Integer1DSet(rangeIndex,
>> x_vals[0].length, logCSindex, null, null);
>>
>> 2007/3/26, Bill Hibbard <hiding at japan.com>:
>>>
>>> Hi Celine,
>>>
>>> If someone has an idea ...
>>>
>>> RealTupleType rangeIndex = null;
>>>
>>> // create the index
>>> if (log.equals("logX") || log.equals("logY")
>>> ||log.equals("loglog")) {
>>> index = RealType.getRealType("index",
>>> CommonUnit.promiscuous);
>>> RealTupleType referenceIndex = new RealTupleType(index);
>>> LogCoordinateSystem logCSindex = new
>>> LogCoordinateSystem(referenceIndex, base);
>>> rangeIndex = new RealTupleType(index, logCSindex, null);
>>> index_set = new Integer1DSet(rangeIndex, x_vals[0].length,
>>> logCSindex, null, null);
>>> }
>>>
>>> I think the problem is that the RealTupleTypes referenceIndex and
>>> rangeIndex are both
>>> defined as (index), that is they are both a RealTupleType of the same
>>> single RealType.
>>> This may also explain the very mysterious Exception you reported in your
>>> other recent
>>> message to the list. Try using different RealTypes in the
>>> constructors for
>>> referenceIndex
>>> and rangeIndex.
>>>
>>> Good luck,
>>> Bill
>>>
>>>
>>> --
>>>
>>> <http://a8-asy.a8ww.net/a8-ads/adftrclick?redirectid=en-mail_a_01>
>>>
>>
>
--
*************************************************************
Don Murray UCAR Unidata Program
dmurray at unidata.ucar.edu P.O. Box 3000
(303) 497-8628 Boulder, CO 80307
http://www.unidata.ucar.edu/staff/donm
*************************************************************
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: LogDisplay.java
Url: http://mailman.unidata.ucar.edu/mailing_lists/archives/visad/attachments/20070327/a0f0c190/attachment.ksh
More information about the visad
mailing list