comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » simple questions: position and strings
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
simple questions: position and strings [message #809] Sat, 15 May 1993 15:33 Go to next message
flatau is currently offline  flatau
Messages: 3
Registered: May 1993
Junior Member
1. In the following code what is the role of "position" keyword
in axis command ? None ?
Why is 5 ignored in the "axis" command. I.e axis doesn't start
at x=5 ?

set_plot,'tek'
erase
a=findgen(10)

plot,a,position=[0.2,0.2,0.7,0.7]
axis,5,0,position=[0.3,0.4,0.9,0.8]

2. I wonder if somebody has routine which would allow TeX strings
in IDL. I.e. I would like to write something like
xyouts \theta_i^j

This is available in one of the graphics package (SM) and I would like
to be able to do the same in IDL

3. How do I get 3 plots on one page but such that the are together
(common x-axis at the top of the first, and bottom of the next plot).
I don't think it can be done with !p.multi and margin because of
overlapping labels.

Peter
Re: Simple questions [message #2839 is a reply to message #809] Tue, 27 September 1994 07:20 Go to previous messageGo to next message
landers is currently offline  landers
Messages: 45
Registered: May 1993
Member
In article <Cwr0y2.GxA@usenet.ucs.indiana.edu>, amaravad@silver.ucs.indiana.edu (ratnakar amaravadi) writes:
[snip]
|> Once you no longer need the matrix, just set matrix=0
|> This will automatically reset the matrix to a scalar
|> and release all additional space to the OS.
|> This will help you conserve memory.

Almost right. Setting a matrix to a scalar does release the memory, but not
back to the OS - it goes back to 'free' memory available to IDL/WAVE.

The memory is still allocated to IDL/WAVE, but becomes available for you to
use for other IDL/WAVE variables.

This is a good practice, and does save memory (by encouraging memory reuse by
IDL/WAVE) - but once you've allocated memory, you can't give it back to the OS.

;Dave
Re: Simple questions [message #2841 is a reply to message #809] Mon, 26 September 1994 11:06 Go to previous messageGo to next message
amaravad is currently offline  amaravad
Messages: 11
Registered: September 1994
Junior Member
In article <1994Sep23.213634.20939@mksol.dseg.ti.com> mcook@mksol.dseg.ti.com (mark k cook) writes:
> I have a couple of recurrent problems with IDL that I was
> hoping somebody could set me straight on. I seem to be
> getting into a situation where I'll ask for a calculation
> and the variable will be represented as an array instead
> of a scalar. This causes some of the IDL routines to die.
> I'm not sure where in the code this occurs at, but can't
> IDL just take the single element value as the scalar?
> A 1-dim vector should be treated as a scalar. Since
> there is no way I can figure out where something becomes
> a vector rather than a scalar in my operations, does this
> mean I have to write extra code to handle conversions?
> How do I know what or where to write it? This would be
> ludicrous, so I must be wrong somewhere.

if result is the name of the variable that you are expecting
to be returned as a scalar, but are finding that result is a
1-D array of length one instead, then just include
result=result(0)
at the end of your code. Result will be a scalar.

>
> The other recurrent problem is an out-of-space (memory)
> problem. How can I clear away any matrices I don't want
> around anymore to free up space?

Once you no longer need the matrix, just set matrix=0
This will automatically reset the matrix to a scalar
and release all additional space to the OS.
This will help you conserve memory.

>
> There are some things I like that IDL has over MATLAB
> (more than 2 D), but these two are no problem with MATLAB.
> It's gotta be my understanding of IDL.
>
> Thanks,
> Mark Cook
> mcook@lobby.ti.com

Hope this helps...

ratnakar amaravadi
ratty@foyt.indyrad.iupui.edu
--
This is my .sig file and not yours...
Re: Simple questions [message #2847 is a reply to message #809] Sat, 24 September 1994 12:38 Go to previous messageGo to next message
mcook is currently offline  mcook
Messages: 12
Registered: March 1994
Junior Member
Bill,
Thanks for the info. I meant to write "a one-element vector should
Bill,
in to try to catch these problems, especially since it seems incorrect
and unintuitive, but will when I have to. Part of what's irritating
about it is that I can't really tell when IDL is going to up and give
me one of these 1-element vectors instead of a scalar.

I'll try DELVAR. I was wanting to use it at the "main" level so it
should help. I don't know if my memory space is fragmented or not.

Thanks again. Any other tips? I'll reread the FAQ it's been awhile.

Mark Cook
mcook@lobby.ti.com
Re: Simple questions [message #2848 is a reply to message #809] Sat, 24 September 1994 09:56 Go to previous messageGo to next message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
mcook@mksol.dseg.ti.com (mark k cook) writes:

> ... can't
> IDL just take the single element value as the scalar?
> A 1-dim vector should be treated as a scalar. ...

Yes, most of the time IDL doesn't draw a distinction between scalars and arrays
with a single element in them. Generally, when you run into trouble is when
you try to use it in an IF statement.

The simple workaround is to reference the variable or expression with a (0) to
force it to be scalar, e.g.

IF (A(0) EQ 3) THEN ...

or for an expression, surround it with ( and ), e.g.

IF ( (A*B)(0) EQ 3) THEN ...

This works even if the variable or expression is already a scalar.

> The other recurrent problem is an out-of-space (memory)
> problem. How can I clear away any matrices I don't want
> around anymore to free up space?

You can use DELVAR to delete variables, but only at the main level. Within
procedures you can clear up the space taken up by a array by redefining it to
be a scalar. However, neither of these will help if your problem is with
memory fragmentation--see the FAQ for details.

Bill Thompson
Re: Simple questions [message #2947 is a reply to message #2841] Thu, 06 October 1994 08:37 Go to previous message
rmm is currently offline  rmm
Messages: 4
Registered: June 1994
Junior Member
One slight correction to the previous post:

When you free memory by setting an array to a scalar, e.g.

huge=fltarr(1000,1000)
.
.
.
huge=0

It does not free the memory back to the OS (operating system). It does
however free the memory for IDL to reuse internally.

Robert M. Moss
Texaco Inc.
rmmoss@Texaco.COM

**********************************************
* I said it, not Texaco, so don't blame them *
**********************************************
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: 941005.news-idlusers-gateway
Next Topic: CW_PDMENU enhancement

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:19:57 PDT 2025

Total time taken to generate the page: 0.00585 seconds