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

Home » Public Forums » archive » cgbarplot - barnames
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
cgbarplot - barnames [message #85955] Sat, 21 September 2013 01:12 Go to next message
gunvicsin11 is currently offline  gunvicsin11
Messages: 93
Registered: November 2012
Member
Hello everyone,
I am barplot, But I need only barnames at few locations in the xaxis. Because my barnames are in years and they are 23. So overlap is happening if I give all the barnames. So I need to name few bars.

Please let me know how to do this.

thanking you in advance
sid
Re: cgbarplot - barnames [message #85956 is a reply to message #85955] Sat, 21 September 2013 06:53 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
sid writes:

> I am barplot, But I need only barnames at few locations in the xaxis. Because my barnames are in years and they are 23. So overlap is happening if I give all the barnames. So I need to name few bars.
>
> Please let me know how to do this.

You can do something like this:

IDL> barnames = StrTrim(Indgen(23)+1995)
IDL> print, barnames
1995 1996 1997 1998 1999 2000 2001
2002 2003 2004 2005 2006 2007 2008
2009 2010 2011 2012 2013 2014 2015
2016 2017
IDL> blanks = Indgen(10)*2+1
IDL> barnames[blanks] = ""
IDL> print, barnames
1995 1997 1999 2001 2003 2005
2007 2009 2011 2013 2015 2016 2017

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgbarplot - barnames [message #85957 is a reply to message #85956] Sat, 21 September 2013 07:40 Go to previous messageGo to next message
gunvicsin11 is currently offline  gunvicsin11
Messages: 93
Registered: November 2012
Member
On Saturday, September 21, 2013 7:23:26 PM UTC+5:30, David Fanning wrote:
> sid writes:
>
>
>
>> I am barplot, But I need only barnames at few locations in the xaxis. Because my barnames are in years and they are 23. So overlap is happening if I give all the barnames. So I need to name few bars.
>
>>
>
>> Please let me know how to do this.
>
>
>
> You can do something like this:
>
>
>
> IDL> barnames = StrTrim(Indgen(23)+1995)
>
> IDL> print, barnames
>
> 1995 1996 1997 1998 1999 2000 2001
>
> 2002 2003 2004 2005 2006 2007 2008
>
> 2009 2010 2011 2012 2013 2014 2015
>
> 2016 2017
>
> IDL> blanks = Indgen(10)*2+1
>
> IDL> barnames[blanks] = ""
>
> IDL> print, barnames
>
> 1995 1997 1999 2001 2003 2005
>
> 2007 2009 2011 2013 2015 2016 2017
>
>
>
> Cheers,
>
>
>
> David
>
>
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")

Respected sir,
But I get zeros in the plot whereever the blanks are there.
Please let me know how to get rid of this zeroes
thanking you
sid
Re: cgbarplot - barnames [message #85958 is a reply to message #85957] Sat, 21 September 2013 07:50 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
sid writes:

> But I get zeros in the plot whereever the blanks are there.
> Please let me know how to get rid of this zeroes

Whoops! Instead of this:

barnames[blanks] = ""

Use this:

barnames[blanks] = " "

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: cgbarplot - barnames [message #85960 is a reply to message #85958] Sat, 21 September 2013 09:52 Go to previous messageGo to next message
gunvicsin11 is currently offline  gunvicsin11
Messages: 93
Registered: November 2012
Member
On Saturday, September 21, 2013 8:20:48 PM UTC+5:30, David Fanning wrote:
> sid writes:
>
>
>
>> But I get zeros in the plot whereever the blanks are there.
>
>> Please let me know how to get rid of this zeroes
>
>
>
> Whoops! Instead of this:
>
>
>
> barnames[blanks] = ""
>
>
>
> Use this:
>
>
>
> barnames[blanks] = " "
>
>
>
> Cheers,
>
>
>
> David
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")

Respected sir,
I tried this, but no change the same result with zeroes. could you please let me know of some other suggestion.
thanking you
sid
Re: cgbarplot - barnames [message #85961 is a reply to message #85960] Sat, 21 September 2013 10:07 Go to previous messageGo to next message
Phillip Bitzer is currently offline  Phillip Bitzer
Messages: 223
Registered: June 2006
Senior Member
There are no zeros in the ticks when I execute:

barnames = StrTrim(Indgen(23)+1995, 2) ;slightly changed from David's snippet
blanks = Indgen(11)*2+1 ;also slightly changed from David's snippet
barnames[blanks] = " "
cgbarplot, findgen(23), barnames=barnames

Are you sure you're using the latest and greatest version of the Coyote library?
Re: cgbarplot - barnames [message #85978 is a reply to message #85961] Sun, 22 September 2013 20:44 Go to previous message
gunvicsin11 is currently offline  gunvicsin11
Messages: 93
Registered: November 2012
Member
On Saturday, September 21, 2013 10:37:37 PM UTC+5:30, Phillip Bitzer wrote:
> There are no zeros in the ticks when I execute:
>
>
>
> barnames = StrTrim(Indgen(23)+1995, 2) ;slightly changed from David's snippet
>
> blanks = Indgen(11)*2+1 ;also slightly changed from David's snippet
>
> barnames[blanks] = " "
>
> cgbarplot, findgen(23), barnames=barnames
>
>
>
> Are you sure you're using the latest and greatest version of the Coyote library?

Respected sir,
It works fine.
thanking you
sid
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL log scale issues
Next Topic: Searching for Rob Moore

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

Current Time: Wed Oct 08 09:15:02 PDT 2025

Total time taken to generate the page: 0.02954 seconds