plotting a tropical cyclone symbol [message #94499] |
Wed, 14 June 2017 09:26  |
Brian McNoldy
Messages: 35 Registered: July 2000
|
Member |
|
|
Something that several users of this language would likely find useful is the tropical cyclone symbol (basically a circle with two spiral arms sticking out).
In Hershey fonts, one variety exists: in the Miscellaneous font set, it is the "<" character ( https://www.harrisgeospatial.com/docs/html/images/font20.gif). With the TEXT function, it can be created using:
t=text(x,y,"<",font_name="Hershey 20")
However, that symbol has variants that would be extremely useful if they were available. If the symbol is filled in, it represents a hurricane; if it's unfilled, it represents a tropical storm. But the same two symbols should exist for the southern hemisphere too; the unfilled or filled symbol would be flipped upside-down.
These four symbols would be excellent to have in IDL... All four symbols are already available in NCL:
https://www.ncl.ucar.edu/Document/Graphics/Images/font35.png ("k" and "m")
https://www.ncl.ucar.edu/Document/Graphics/Images/font37.png ("p" and "s")
Anyone have any insights into this?
Thank you!!
Brian
|
|
|
|
|
Re: plotting a tropical cyclone symbol [message #94530 is a reply to message #94501] |
Tue, 27 June 2017 08:10   |
Kenneth Bowman
Messages: 86 Registered: November 2006
|
Member |
|
|
On Wednesday, June 14, 2017 at 1:23:43 PM UTC-5, Brian McNoldy wrote:
> Thanks for the suggestion, but I do not have or know of a TTF file with those characters/symbols. They are pretty hard to come by, but since NCL offers all of them, it would make sense that IDL would want to remain competitive.
You can draw an arbitrary filled or unfilled symbol using USERSYM and plot it with PLOTS.
We used it to create the outline of an airplane for animations of flight tracks (including rotating the direction of the plane).
This creates a filled or unfilled circular plotting symbol for when you need a finite-sized dot (as opposed to PSYM = 3).
Unfortunately you can only have on e USERSYM at at time, so you will have to redefine the symbol when switching between filled and unfilled.
Ken
PRO USERSYM_CIRCLE, FILL = fill, NPOINT = npoints
;+
; Name:
; USERSYM_CIRCLE
; Purpose:
; Define a circular plotting symbol using USERSYM.
; Calling sequence:
; USERSYM_CIRCLE
; Inputs:
; None
; Output:
; Changes definition of user-defined symbol (PSYM = 8).
; Keywords:
; FILL : If set, make the symbol filled
; Author and history:
; K. Bowman. 2006-07-11
;-
COMPILE_OPT IDL2 ;Set compile options
IF (N_ELEMENTS(npoints) EQ 0) THEN npoints = 17
USERSYM, 0.5*COS(2.0*!PI*FINDGEN(npoints)/npoints), $ ;Create circular plotting symbol
0.5*SIN(2.0*!PI*FINDGEN(npoints)/npoints), $
FILL = fill
END
|
|
|
|