X

NV5 Geospatial Blog

Each month, NV5 Geospatial posts new blog content across a variety of categories. Browse our latest posts below to learn about important geospatial information or use the search bar to find a specific topic or author. Stay informed of the latest blog posts, events, and technologies by joining our email list!



Mapping Earthquake Deformation in Taiwan With ENVI

Mapping Earthquake Deformation in Taiwan With ENVI

12/15/2025

Unlocking Critical Insights With ENVI® Tools Taiwan sits at the junction of major tectonic plates and regularly experiences powerful earthquakes. Understanding how the ground moves during these events is essential for disaster preparedness, public safety, and building community resilience. But traditional approaches like field... Read More >

Comparing Amplitude and Coherence Time Series With ICEYE US GTR Data and ENVI SARscape

Comparing Amplitude and Coherence Time Series With ICEYE US GTR Data and ENVI SARscape

12/3/2025

Large commercial SAR satellite constellations have opened a new era for persistent Earth monitoring, giving analysts the ability to move beyond simple two-image comparisons into robust time series analysis. By acquiring SAR data with near-identical geometry every 24 hours, Ground Track Repeat (GTR) missions minimize geometric decorrelation,... Read More >

Empowering D&I Analysts to Maximize the Value of SAR

Empowering D&I Analysts to Maximize the Value of SAR

12/1/2025

Defense and intelligence (D&I) analysts rely on high-resolution imagery with frequent revisit times to effectively monitor operational areas. While optical imagery is valuable, it faces limitations from cloud cover, smoke, and in some cases, infrequent revisit times. These challenges can hinder timely and accurate data collection and... Read More >

Easily Share Workflows With the Analytics Repository

Easily Share Workflows With the Analytics Repository

10/27/2025

With the recent release of ENVI® 6.2 and the Analytics Repository, it’s now easier than ever to create and share image processing workflows across your organization. With that in mind, we wrote this blog to: Introduce the Analytics Repository Describe how you can use ENVI’s interactive workflows to... Read More >

Deploy, Share, Repeat: AI Meets the Analytics Repository

Deploy, Share, Repeat: AI Meets the Analytics Repository

10/13/2025

The upcoming release of ENVI® Deep Learning 4.0 makes it easier than ever to import, deploy, and share AI models, including industry-standard ONNX models, using the integrated Analytics Repository. Whether you're building deep learning models in PyTorch, TensorFlow, or using ENVI’s native model creation tools, ENVI... Read More >

1345678910Last
7907 Rate this article:
No rating

Using IDL 8 Graphics (a.k.a. New Graphics)

Anonym

I’ve been using Direct Graphics (DG) in IDL since 1993. I was initially hesitant about IDL 8 Graphics (christened “New Graphics” on the comp.lang.idl-pvwave newsgroup; I’ll refer to them as NG), but I’ve been pleasantly surprised by how well they work. In particular, I like how their syntax mirrors DG and how I can use them programmatically. I also like how they handle color and how easily they make publication-ready PostScript and PNG files (among other formats). Here’s a short example of working with NG. If you’d like, please try these commands in IDL. Start by making variables to represent one cycle of a sine and a cosine wave:

 t = findgen(361)*!dtor x = sin(t) y = cos(t)

Display the sine wave:

 p = plot(t, x)

Note how I called PLOT as a function. (You can still call the DG PLOT routine as a procedure.) The PLOT function returns a reference—here, the variable “p” —that can be used to control the graphic. For example, I can use “p” to change the line color to red:

 p.color = 'red'

and the graphic updates immediately. I specified the color red by name; you could also use an RGB triple. Next, I’ll add titles to the plot:

 p.xtitle = 'Time' p.ytitle = 'Amplitude' p.title = 'Sine and Cosine Waves'

I could’ve set these properties through identical keywords in the call to PLOT. I can display the cosine wave on the same axes as the sine wave with another call to PLOT:

 q = plot(t, y, color='blue', /overplot)

The OVERPLOT keyword is the NG analog to the DG OPLOT procedure. I’ll also display a zero line:

 !null = plot(p.xrange, [0,0], linestyle='dotted', /overplot)

Note how I used “p” to get the current x-axis range of the plot. Last, I’ll add a legend positioned in the lower left corner of the graphic. Don't include the zero line in the legend.

 p.name = 'Sine' q.name = 'Cosine' pq_lgd = legend(target=[p,q], position=[2.0,-0.6], /data)

Here’s a screenshot of the window that results from these steps (this is from the Linux side of my laptop): Screen capture of NG window on Linux The graphic can be saved to a JPEG file with one command:

 p.save, 'plot_ex.jpg'

IDL uses the extension on the file name to determine the file type. The default resolution of the image is 600 dpi, which makes a 2598 x 2079 image on my laptop! NG won’t replace DG in every instance. For example, NG are typically slower than DG. This is especially true when displaying more than about 104 points. NG may not be for everyone. If you’re already comfortable with DG, please continue to use them. But when I think back to when I was learning how to go beyond the basics in DG, I remember it wasn’t always easy. (In particular, I remember the first time my advisor asked me to print a plot. That was a frustrating day. Or two.) I hope that new users of IDL will try NG, and I hope that NG just makes sense to them. If you’d like to learn more about using NG, please continue to follow me on this blog; I’ll post numerous examples of using them in the coming weeks and months.

Please login or register to post comments.