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

Home » Public Forums » archive » How to disable tick labels on right and top when using cgMap?
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
How to disable tick labels on right and top when using cgMap? [message #89033] Thu, 17 July 2014 06:14 Go to next message
atmospheric physics is currently offline  atmospheric physics
Messages: 121
Registered: June 2010
Senior Member
Hello,

In the coyote plot gallery, how can I disable the right (latitude) and top (longitude) tick labels in the figure shown at http://www.idlcoyote.com/gallery/point_source_plot.png

The code is given at:
http://www.idlcoyote.com/gallery/point_source_plot.pro

Thanks in advance,
Re: How to disable tick labels on right and top when using cgMap? [message #89034 is a reply to message #89033] Thu, 17 July 2014 06:27 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Madhavan Bomidi writes:

> In the coyote plot gallery, how can I disable the right (latitude) and top (longitude) tick labels in the figure shown at http://www.idlcoyote.com/gallery/point_source_plot.png
>
> The code is given at:
> http://www.idlcoyote.com/gallery/point_source_plot.pro

Set the BLABEL keyword to 1 on the cgMap_Grid 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: How to disable tick labels on right and top when using cgMap? [message #89035 is a reply to message #89034] Thu, 17 July 2014 07:45 Go to previous messageGo to next message
atmospheric physics is currently offline  atmospheric physics
Messages: 121
Registered: June 2010
Senior Member
Hello David,

It works. Thanks.

I have another question. I am using cgHistoplot function to plot a probability density function (PDF) for my data. When I see the plot, I find that the ticks on x-axis are both inward and outward. How can I disable outward ticks? Where am I going wrong in my below code? Please correct me!!!

Below are the command lines I am using for the plot:

data1 = randomu(seed,99)
data2 = randomu(seed,99)

cgHistoplot,data1, /NAN, DataColorName=cgColor('red'),Thick=3, $
XRange=[0.0,1.2],YRange=[0.0,1.0],Charsize=0.85,/Outline, $
XTitle='data1 / data2',Font=-1, $
XTICKFORMAT='(F0.1)',YTICKFORMAT='(F0.1)', Line_Thick=3, $
XSTYLE=8, YSTYLE=1,/Frequency, $
YTitle='Probablity Density Function (PDF)'

cgHistoplot,data2, /NAN, DataColorName=cgColor('black'),Thick=3, $
Line_Thick=3,/OPLOT,/Frequency,/Outline

cgLegend,Title=['data1', 'data2'], $
LineStyle=[0,0],Length=0.01,Vspace=1.3, $
Color=cgColor('red'),cgColor('black')], $
Location=[0.1,0.95],Charsize=0.68, $
TT_Font='Simplex Roman',/Data

Thanks in advance
Re: How to disable tick labels on right and top when using cgMap? [message #89036 is a reply to message #89035] Thu, 17 July 2014 08:29 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Madhavan Bomidi writes:

> I have another question. I am using cgHistoplot function to plot a probability density function (PDF) for my data. When I see the plot, I find that the ticks on x-axis are both inward and outward. How can I disable outward ticks? Where am I going wrong in my below code? Please correct me!!!
>
> Below are the command lines I am using for the plot:
>
> data1 = randomu(seed,99)
> data2 = randomu(seed,99)
>
> cgHistoplot,data1, /NAN, DataColorName=cgColor('red'),Thick=3, $
> XRange=[0.0,1.2],YRange=[0.0,1.0],Charsize=0.85,/Outline, $
> XTitle='data1 / data2',Font=-1, $
> XTICKFORMAT='(F0.1)',YTICKFORMAT='(F0.1)', Line_Thick=3, $
> XSTYLE=8, YSTYLE=1,/Frequency, $
> YTitle='Probablity Density Function (PDF)'
>
> cgHistoplot,data2, /NAN, DataColorName=cgColor('black'),Thick=3, $
> Line_Thick=3,/OPLOT,/Frequency,/Outline
>
> cgLegend,Title=['data1', 'data2'], $
> LineStyle=[0,0],Length=0.01,Vspace=1.3, $
> Color=cgColor('red'),cgColor('black')], $
> Location=[0.1,0.95],Charsize=0.68, $
> TT_Font='Simplex Roman',/Data
>
> Thanks in advance

I notice you like to use a lot of keywords and such that are unnecessary
with Coyote Graphics. For example, you can delete ALL references to
cgColor in this code, and just use the colors themselves. In fact, you
will get into trouble if you use cgColor like this sooner or later.

In this case, the problem is your use of the XSTYLE keyword. Why are you
using it? In cgHistoplot, I first draw the plot in "invisible" mode,
just to establish the coordinate system. This is necessary because I
have to repair the axes later, after I damage them by drawing polygons.
To draw axes "invisibly", I have to set the XSTYLE keyword on the Plot
command. But, your use of XSTYLE here overrules mine (keyword
inheritance biting us in the butt again!) and it draws just the X axis,
but visibly this time. Unfortunately, you are drawing the axis with the
ticks up, and I want to draw them with the ticks down, so... You see
what happens.

I don't see any obvious reason why you are using XSTYLE here. Doesn't
this code give you what you want?

cgHistoplot,data1, /NAN, DataColorName='red', $
XRange=[0.0,1.2],YRange=[0.0,1.0],Charsize=0.85,/Outline, $
XTitle='data1 / data2',$
XTICKFORMAT='(F0.1)',YTICKFORMAT='(F0.1)', $
/Frequency, $
YTitle='Probablity Density Function (PDF)'

cgHistoplot,data2, /NAN, DataColorName='black', $
/OPLOT,/Frequency,/Outline

cgLegend,Title=['data1', 'data2'], $
LineStyle=[0,0],Length=0.01,Vspace=1.3, $
Color=['red','black'], $
Location=[0.1,0.95],Charsize=0.68, $
TT_Font='Simplex Roman',/Data


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: How to disable tick labels on right and top when using cgMap? [message #89037 is a reply to message #89036] Thu, 17 July 2014 08:56 Go to previous messageGo to next message
atmospheric physics is currently offline  atmospheric physics
Messages: 121
Registered: June 2010
Senior Member
Hello David,

I want my ticks up (inwards) and not down. Is it not possible to do that when using cgHistoplot?

Thanks in advance
Re: How to disable tick labels on right and top when using cgMap? [message #89038 is a reply to message #89037] Thu, 17 July 2014 09:01 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Madhavan Bomidi writes:

> I want my ticks up (inwards) and not down. Is it not possible to do that when using cgHistoplot?

Not with the code as written. Upward ticks interfere with the histogram
polygons that are drawn. Of course, you aren't using polygons, but this
seems like a needless complication to me. You can probably get what you
want, just by using PLOT, Histogram(data), ..., PSYM=10.

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: How to disable tick labels on right and top when using cgMap? [message #89047 is a reply to message #89038] Fri, 18 July 2014 01:17 Go to previous message
atmospheric physics is currently offline  atmospheric physics
Messages: 121
Registered: June 2010
Senior Member
Thanks for the clarification and suggestion.

Regards,
Madhavan
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Plotting results from z-buffer are diffrenet than xwindow.
Next Topic: Matrix a*b in loop

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

Current Time: Wed Oct 08 15:05:37 PDT 2025

Total time taken to generate the page: 0.00594 seconds