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

Home » Public Forums » archive » Re: number keyword in legend
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
Re: number keyword in legend [message #78661] Fri, 16 December 2011 10:24
simona bellavista is currently offline  simona bellavista
Messages: 56
Registered: December 2009
Member
Thank you! That's exactly what I was looking for!


On Dec 16, 7:14 pm, David Fanning <n...@dfanning.com> wrote:
> David Fanning writes:
>>
> Well, maybe I can answer this question! How about something like
> this:
>
>    lines = indgen(6)
>    items = 'linestyle '+strtrim(lines,2)
>    cgplot, dindgen(10)
>    al_legend,items,linestyle=lines, charsize=2, pspacing=1.0
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.idlcoyote.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: number keyword in legend [message #78662 is a reply to message #78661] Fri, 16 December 2011 10:20 Go to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
Use the LINSIZ Ekeyword. For example, set linsize = 0.5 to make the lines half their default length. --Wayne

On Friday, December 16, 2011 12:58:50 PM UTC-5, David Fanning wrote:
> simona bellavista writes:
>>
>> IDL> al_legend,items,linestyle=lines, charsize=2
>>
>> another legend will appear on the top, with larger fonts and longer
>> lines.
>>
>> Now, I would like to be able to change the font size, so to make my
>> labels readable, but not having gigantic lines.
>
> Ah, OK, I see what you mean.
>
> But, now we are out of my domain of expertise entirely, and
> we enter Wayne's realm. He will be in touch with us shortly,
> no doubt. :-)
>
> Cheers,
>
> David
>
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: number keyword in legend [message #78663 is a reply to message #78662] Fri, 16 December 2011 10:14 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

>
> simona bellavista writes:
>
>> OK, if you try this:
>>
>> IDL> lines = indgen(6)
>> IDL> items = 'linestyle '+strtrim(lines,2)
>> IDL> plot, dindgen(10)
>> IDL> al_legend,items,linestyle=lines, charsize=1
>>
>> You'll see that a plot with a legend will appear, where in the legend
>> there are some lines with different styles. The charsize specifies the
>> font size in the legend.
>> Now if you try
>>
>> IDL> al_legend,items,linestyle=lines, charsize=2
>>
>> another legend will appear on the top, with larger fonts and longer
>> lines.
>>
>> Now, I would like to be able to change the font size, so to make my
>> labels readable, but not having gigantic lines.
>
> Ah, OK, I see what you mean.
>
> But, now we are out of my domain of expertise entirely, and
> we enter Wayne's realm. He will be in touch with us shortly,
> no doubt. :-)

Well, maybe I can answer this question! How about something like
this:

lines = indgen(6)
items = 'linestyle '+strtrim(lines,2)
cgplot, dindgen(10)
al_legend,items,linestyle=lines, charsize=2, pspacing=1.0


Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: number keyword in legend [message #78664 is a reply to message #78663] Fri, 16 December 2011 09:58 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
simona bellavista writes:

> OK, if you try this:
>
> IDL> lines = indgen(6)
> IDL> items = 'linestyle '+strtrim(lines,2)
> IDL> plot, dindgen(10)
> IDL> al_legend,items,linestyle=lines, charsize=1
>
> You'll see that a plot with a legend will appear, where in the legend
> there are some lines with different styles. The charsize specifies the
> font size in the legend.
> Now if you try
>
> IDL> al_legend,items,linestyle=lines, charsize=2
>
> another legend will appear on the top, with larger fonts and longer
> lines.
>
> Now, I would like to be able to change the font size, so to make my
> labels readable, but not having gigantic lines.

Ah, OK, I see what you mean.

But, now we are out of my domain of expertise entirely, and
we enter Wayne's realm. He will be in touch with us shortly,
no doubt. :-)

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: number keyword in legend [message #78665 is a reply to message #78664] Fri, 16 December 2011 09:46 Go to previous message
simona bellavista is currently offline  simona bellavista
Messages: 56
Registered: December 2009
Member
>
> I have no idea what you are talking about! What, exactly,
> are you trying to do? :-)
>
> Can you show me an example?
>

:)

OK, if you try this:

IDL> lines = indgen(6)
IDL> items = 'linestyle '+strtrim(lines,2)
IDL> plot, dindgen(10)
IDL> al_legend,items,linestyle=lines, charsize=1

You'll see that a plot with a legend will appear, where in the legend
there are some lines with different styles. The charsize specifies the
font size in the legend.
Now if you try

IDL> al_legend,items,linestyle=lines, charsize=2

another legend will appear on the top, with larger fonts and longer
lines.

Now, I would like to be able to change the font size, so to make my
labels readable, but not having gigantic lines.
Re: number keyword in legend [message #78666 is a reply to message #78665] Fri, 16 December 2011 09:27 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
simona bellavista writes:

> OK,
>
> but the bottom line is:the number keyword cannot decrease the length
> of my lines under a certain value.
> this value is set by charsize, in the sense that:
>
> charsize increases ----> length of lines increases

I have no idea what you are talking about! What, exactly,
are you trying to do? :-)

Can you show me an example?

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: number keyword in legend [message #78667 is a reply to message #78666] Fri, 16 December 2011 09:10 Go to previous message
simona bellavista is currently offline  simona bellavista
Messages: 56
Registered: December 2009
Member
OK,

but the bottom line is:the number keyword cannot decrease the length
of my lines under a certain value.
this value is set by charsize, in the sense that:

charsize increases ----> length of lines increases


On Dec 16, 6:02 pm, David Fanning <n...@dfanning.com> wrote:
> simona bellavista writes:
>> Ok, it is more than possible that I did some mistakes. But look, I
>> tried the function in the interactive shell
>> (I work on linux, just to specify, and again in IDL v7.0)
>
>> IDL> window, 0, retain=2
>> IDL> plot, dindgen(100)
>> IDL> al_legend,['Plus sign','Asterisk','Period'],psym=[1,2,3]
>> % Compiled module: AL_LEGEND.
>> % Compiled module: SETDEFAULTVALUE.
>> % Compiled module: CGPLOTS.
>> % Compiled module: SETDECOMPOSEDSTATE.
>> % Compiled module: DECOMPOSEDCOLOR.
>> % Compiled module: CGCOLOR.
>> % Compiled module: STRSPLIT.
>> % Compiled module: CGSNAPSHOT.
>> % Compiled module: SYMCAT.
>> % Compiled module: CGTEXT.
>> % Compiled module: CGDEFCHARSIZE.
>> % Compiled module: STR_SIZE.
>> % Compiled module: ERROR_MESSAGE.
>
>> Traceback Report from CGTEXT:
>
>>      % Keyword ADDCMD not allowed in call to: XYOUTS
>>      % Execution halted at:  CGTEXT            258 /mypath/idl/coyote/
>> cgtext.pro
>>      %                       AL_LEGEND         492 /mypath/idl/Default/
>> al_legend.pro
>>      %                       $MAIN$
>> % Variable is undefined: WIDTH.
>> % Error occurred at: AL_LEGEND         494
>>   /mypath/idl/Default/al_legend.pro
>> %                    $MAIN$
>> % Execution halted at: $MAIN$
>
> Now that I look more closely at your error, I would
> say you need to update your Coyote Library ASAP. LOTS
> of new features for you! ;-)
>
>   http://www.idlcoyote.com/programs/zip_files/coyoteprograms.z ip
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.idlcoyote.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: number keyword in legend [message #78668 is a reply to message #78667] Fri, 16 December 2011 09:02 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
simona bellavista writes:

> Ok, it is more than possible that I did some mistakes. But look, I
> tried the function in the interactive shell
> (I work on linux, just to specify, and again in IDL v7.0)
>
> IDL> window, 0, retain=2
> IDL> plot, dindgen(100)
> IDL> al_legend,['Plus sign','Asterisk','Period'],psym=[1,2,3]
> % Compiled module: AL_LEGEND.
> % Compiled module: SETDEFAULTVALUE.
> % Compiled module: CGPLOTS.
> % Compiled module: SETDECOMPOSEDSTATE.
> % Compiled module: DECOMPOSEDCOLOR.
> % Compiled module: CGCOLOR.
> % Compiled module: STRSPLIT.
> % Compiled module: CGSNAPSHOT.
> % Compiled module: SYMCAT.
> % Compiled module: CGTEXT.
> % Compiled module: CGDEFCHARSIZE.
> % Compiled module: STR_SIZE.
> % Compiled module: ERROR_MESSAGE.
>
> Traceback Report from CGTEXT:
>
> % Keyword ADDCMD not allowed in call to: XYOUTS
> % Execution halted at: CGTEXT 258 /mypath/idl/coyote/
> cgtext.pro
> % AL_LEGEND 492 /mypath/idl/Default/
> al_legend.pro
> % $MAIN$
> % Variable is undefined: WIDTH.
> % Error occurred at: AL_LEGEND 494
> /mypath/idl/Default/al_legend.pro
> % $MAIN$
> % Execution halted at: $MAIN$

Now that I look more closely at your error, I would
say you need to update your Coyote Library ASAP. LOTS
of new features for you! ;-)

http://www.idlcoyote.com/programs/zip_files/coyoteprograms.z ip

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: number keyword in legend [message #78669 is a reply to message #78668] Fri, 16 December 2011 09:01 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
simona bellavista writes:

> Ok, it is more than possible that I did some mistakes. But look, I
> tried the function in the interactive shell
> (I work on linux, just to specify, and again in IDL v7.0)
>
> IDL> window, 0, retain=2
> IDL> plot, dindgen(100)
> IDL> al_legend,['Plus sign','Asterisk','Period'],psym=[1,2,3]
> % Compiled module: AL_LEGEND.
> % Compiled module: SETDEFAULTVALUE.
> % Compiled module: CGPLOTS.
> % Compiled module: SETDECOMPOSEDSTATE.
> % Compiled module: DECOMPOSEDCOLOR.
> % Compiled module: CGCOLOR.
> % Compiled module: STRSPLIT.
> % Compiled module: CGSNAPSHOT.
> % Compiled module: SYMCAT.
> % Compiled module: CGTEXT.
> % Compiled module: CGDEFCHARSIZE.
> % Compiled module: STR_SIZE.
> % Compiled module: ERROR_MESSAGE.
>
> Traceback Report from CGTEXT:
>
> % Keyword ADDCMD not allowed in call to: XYOUTS
> % Execution halted at: CGTEXT 258 /mypath/idl/coyote/
> cgtext.pro
> % AL_LEGEND 492 /mypath/idl/Default/
> al_legend.pro
> % $MAIN$
> % Variable is undefined: WIDTH.
> % Error occurred at: AL_LEGEND 494
> /mypath/idl/Default/al_legend.pro
> % $MAIN$
> % Execution halted at: $MAIN$

Well, I don't know. I'm running in IDL 7, too.

IDL> plot, dindgen(100)
IDL> al_legend,['Plus sign','Asterisk','Period'],psym=[1,2,3]
IDL> print, !version
{ x86_64 Win32 Windows Microsoft Windows 7.1.2 Oct 28 2009 64 64}

Works fine here. Did you download the latest this morning?

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: number keyword in legend [message #78670 is a reply to message #78669] Fri, 16 December 2011 09:00 Go to previous message
simona bellavista is currently offline  simona bellavista
Messages: 56
Registered: December 2009
Member
of course, I just needed an updating. I wonder what's wrong today ...
btw, have a nice day
I'll do it another time

On Dec 16, 5:49 pm, simona bellavista <afy...@gmail.com> wrote:
>> I would say you probably have a programmer error. :-)
>
> Ok, it is more than possible that I did some mistakes. But look, I
> tried the function in the interactive shell
> (I work on linux, just to specify, and again in IDL v7.0)
>
> IDL> window, 0, retain=2
> IDL> plot, dindgen(100)
> IDL> al_legend,['Plus sign','Asterisk','Period'],psym=[1,2,3]
> % Compiled module: AL_LEGEND.
> % Compiled module: SETDEFAULTVALUE.
> % Compiled module: CGPLOTS.
> % Compiled module: SETDECOMPOSEDSTATE.
> % Compiled module: DECOMPOSEDCOLOR.
> % Compiled module: CGCOLOR.
> % Compiled module: STRSPLIT.
> % Compiled module: CGSNAPSHOT.
> % Compiled module: SYMCAT.
> % Compiled module: CGTEXT.
> % Compiled module: CGDEFCHARSIZE.
> % Compiled module: STR_SIZE.
> % Compiled module: ERROR_MESSAGE.
>
> Traceback Report from CGTEXT:
>
>      % Keyword ADDCMD not allowed in call to: XYOUTS
>      % Execution halted at:  CGTEXT            258 /mypath/idl/coyote/
> cgtext.pro
>      %                       AL_LEGEND         492 /mypath/idl/Default/
> al_legend.pro
>      %                       $MAIN$
> % Variable is undefined: WIDTH.
> % Error occurred at: AL_LEGEND         494
>   /mypath/idl/Default/al_legend.pro
> %                    $MAIN$
> % Execution halted at: $MAIN$
> IDL>
Re: number keyword in legend [message #78671 is a reply to message #78670] Fri, 16 December 2011 08:49 Go to previous message
simona bellavista is currently offline  simona bellavista
Messages: 56
Registered: December 2009
Member
> I would say you probably have a programmer error. :-)

Ok, it is more than possible that I did some mistakes. But look, I
tried the function in the interactive shell
(I work on linux, just to specify, and again in IDL v7.0)

IDL> window, 0, retain=2
IDL> plot, dindgen(100)
IDL> al_legend,['Plus sign','Asterisk','Period'],psym=[1,2,3]
% Compiled module: AL_LEGEND.
% Compiled module: SETDEFAULTVALUE.
% Compiled module: CGPLOTS.
% Compiled module: SETDECOMPOSEDSTATE.
% Compiled module: DECOMPOSEDCOLOR.
% Compiled module: CGCOLOR.
% Compiled module: STRSPLIT.
% Compiled module: CGSNAPSHOT.
% Compiled module: SYMCAT.
% Compiled module: CGTEXT.
% Compiled module: CGDEFCHARSIZE.
% Compiled module: STR_SIZE.
% Compiled module: ERROR_MESSAGE.

Traceback Report from CGTEXT:

% Keyword ADDCMD not allowed in call to: XYOUTS
% Execution halted at: CGTEXT 258 /mypath/idl/coyote/
cgtext.pro
% AL_LEGEND 492 /mypath/idl/Default/
al_legend.pro
% $MAIN$
% Variable is undefined: WIDTH.
% Error occurred at: AL_LEGEND 494
/mypath/idl/Default/al_legend.pro
% $MAIN$
% Execution halted at: $MAIN$
IDL>
Re: number keyword in legend [message #78672 is a reply to message #78671] Fri, 16 December 2011 08:41 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
simona bellavista writes:

> isn't it for idl v8? I think they just renamed the nasa legend.pro
> routine when the built-in legend was introduced in v8. btw I tried to
> see if al_legend works with v7 and I would say it doesn't.

I would say you probably have a programmer error. :-)

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: number keyword in legend [message #78673 is a reply to message #78672] Fri, 16 December 2011 08:40 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
simona bellavista writes:

> On Dec 16, 5:15 pm, simona bellavista <afy...@gmail.com> wrote:
>> Hi,
>>
>> I use IDL v7.0  and the built-in procedure legend.
> ^^^^^^^^^^^^^^^^^^^^^^^^^
> just to say that it is not built-in, I took it from
>
> http://www.astro.washington.edu/docs/idl/

Yes, that will be VERY old. I'd get the latest AL_LEGEND
from the NASA Library. :-)

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: number keyword in legend [message #78674 is a reply to message #78673] Fri, 16 December 2011 08:39 Go to previous message
simona bellavista is currently offline  simona bellavista
Messages: 56
Registered: December 2009
Member
>
> I don't believe there *is* a built-in LEGEND procedure
> in IDL 7

Right, I took the legend.pro function from astronomy library, this one

http://www.astro.washington.edu/docs/idl/cgi-bin/getpro/libr ary02.html?LEGEND

> All that said, I think most people use AL_Legend
> from the NASA Astronomy Library:
>
>   http://www.idlcoyote.com/cg_tips/al_legend.php
>

isn't it for idl v8? I think they just renamed the nasa legend.pro
routine when the built-in legend was introduced in v8. btw I tried to
see if al_legend works with v7 and I would say it doesn't.
Re: number keyword in legend [message #78676 is a reply to message #78674] Fri, 16 December 2011 08:17 Go to previous message
simona bellavista is currently offline  simona bellavista
Messages: 56
Registered: December 2009
Member
Hi again,

On Dec 16, 5:15 pm, simona bellavista <afy...@gmail.com> wrote:
> Hi,
>
> I use IDL v7.0  and the built-in procedure legend.
^^^^^^^^^^^^^^^^^^^^^^^^^
just to say that it is not built-in, I took it from

http://www.astro.washington.edu/docs/idl/
Re: number keyword in legend [message #78677 is a reply to message #78676] Fri, 16 December 2011 08:20 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
simona bellavista writes:

> I use IDL v7.0 and the built-in procedure legend.
> I am trying to make the horizontal lines in legend shorter by using
> the number keyword, but I realized that it can just increase the
> length. By horizontal lines I mean the lines you get by specifying the
> linestyle keyword.
>
> I have also tried to use leg.pro from sterner, but it looks like it
> doesn't work with the ps device, does it?

I don't believe there *is* a built-in LEGEND procedure
in IDL 7, and I don't know much of anything about Ray
Sterner's routines, except that it would surprise me
a GREAT deal if one of Ray's programs didn't work in
PostScript!

All that said, I think most people use AL_Legend
from the NASA Astronomy Library:

http://www.idlcoyote.com/cg_tips/al_legend.php

Cheers,

David




--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: number keyword in legend
Next Topic: Re: When sshed from my macbook pro to my apple server if running command line idl opening an x window will crash the session

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

Current Time: Wed Oct 08 20:03:45 PDT 2025

Total time taken to generate the page: 0.00692 seconds