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

Home » Public Forums » archive » Re: custom x axis
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: custom x axis [message #83906] Fri, 19 April 2013 15:18 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
tballinger6@gmail.com writes:

> Thanks for the advice. I am trying to plot different frequencies for each month (hence the three symbols per month), but keep getting this additional white line running the screen (across all months). Any idea how to remove that line, but keep the other symbols for each month?

Well, I guess I would add a NODATA=1 keyword on the Plot command. :-)

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: custom x axis [message #83907 is a reply to message #83906] Fri, 19 April 2013 15:05 Go to previous messageGo to next message
tballinger6 is currently offline  tballinger6
Messages: 3
Registered: April 2013
Junior Member
Hi David,

Thanks for the advice. I am trying to plot different frequencies for each month (hence the three symbols per month), but keep getting this additional white line running the screen (across all months). Any idea how to remove that line, but keep the other symbols for each month? Code below:

t = [9,10,11,12,1,2]
y1 = [8.6,6.0,3.95,0.2,0.2,0] ;monthly frequency values (high)
y2 =[5,2.8,0,0,0,0] ;monthly frequencies values (low)
y3= [9.92,3.04,0.21,0.08,0.04,0] ;monthly frequency values (other)

loadct,0,/silent
t = timegen(6, start=julday(9, 15, 2012), units='months') ;caldat=julday
void = label_date(date_format='%N')
plot, t, randomu(seed, 6), yrange=[0,15], xtickformat='label_date', $
xstyle=3, ystyle=3, xminor=1, xticks=5, charsize=1.25, charthick=4, xthick=4, ythick=4, title='Cluster 1', xtitle='Months', ytitle='Frequency'

loadct, 34, /silent
oplot, t,y1, psym=2, thick=4, color=30 ;blue asteriks (low years)
oplot, t,y2, psym=5, thick=4, color=150 ;green triangles (high years)
oplot, t,y3, psym=6, thick=4, color=250 ;red squares (other years)

if layout eq 'ps' then device,/close

end

Thanks,

TB

On Wednesday, April 17, 2013 7:06:03 PM UTC-4, David Fanning wrote:
> TB writes:
>
>
>
>>
>
>> I am trying to create a customized axis that goes 9,10,11,12,1,2 (in accordance with September through February the next calendar year). Any suggestions?
>
>
>
> IDL> t = timegen(6, start=Julday(9, 15, 2012), units='months')
>
> IDL> void = label_date(date_format='%N')
>
> IDL> cgplot, t, randomu(seed, 6), xtickformat='label_date', $
>
> xstyle=1, xticks=5
>
>
>
> 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: custom x axis [message #83939 is a reply to message #83907] Wed, 17 April 2013 16:06 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
TB writes:

>
> I am trying to create a customized axis that goes 9,10,11,12,1,2 (in accordance with September through February the next calendar year). Any suggestions?

IDL> t = timegen(6, start=Julday(9, 15, 2012), units='months')
IDL> void = label_date(date_format='%N')
IDL> cgplot, t, randomu(seed, 6), xtickformat='label_date', $
xstyle=1, xticks=5

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: custom x axis [message #84043 is a reply to message #83906] Sat, 20 April 2013 08:26 Go to previous message
TB[1] is currently offline  TB[1]
Messages: 4
Registered: October 2012
Junior Member
Worked great, thanks so much!

TB

On Friday, April 19, 2013 6:18:00 PM UTC-4, David Fanning wrote:
> tballinger6@gmail.com writes:
>
>
>
>> Thanks for the advice. I am trying to plot different frequencies for each month (hence the three symbols per month), but keep getting this additional white line running the screen (across all months). Any idea how to remove that line, but keep the other symbols for each month?
>
>
>
> Well, I guess I would add a NODATA=1 keyword on the Plot command. :-)
>
>
>
> 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: custom x axis [message #84046 is a reply to message #83907] Fri, 19 April 2013 16:22 Go to previous message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
Just for fun, here's the same code, but with function graphics:

y1 = [8.6,6.0,3.95,0.2,0.2,0] ;monthly frequency values (high)
y2 =[5,2.8,0,0,0,0] ;monthly frequencies values (low)
y3= [9.92,3.04,0.21,0.08,0.04,0] ;monthly frequency values (other)
t = timegen(6, start=julday(9, 15, 2012), units='months') ;caldat=julday
void = label_date(date_format='%N')

p = plot(t,randomu(seed,6),yrange=[0,15], $
xtickformat='label_date',title='Cluster 1', $
xtitle='Months', ytitle='Frequency',/nodata)
p1=plot(t,y1,'*b',/over,sym_thick=2,name=' low years')
p2=plot(t,y2,'gtu',/over,sym_thick=2,name=' high years')
p3=plot(t,y3,'rs',/over,sym_thick=2,name=' other years')
leg = legend(position=[0.75,0.75])

-Chris
ExelisVIS
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: plot and contour inconsistency
Next Topic: Subscripts with greek symbols

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

Current Time: Wed Oct 08 13:43:51 PDT 2025

Total time taken to generate the page: 0.00676 seconds