cgbarplot - barnames [message #85955] |
Sat, 21 September 2013 01:12  |
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 #85957 is a reply to message #85956] |
Sat, 21 September 2013 07:40   |
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 #85978 is a reply to message #85961] |
Sun, 22 September 2013 20:44  |
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
|
|
|