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!



NV5 at ESA’s Living Planet Symposium 2025

NV5 at ESA’s Living Planet Symposium 2025

9/16/2025

We recently presented three cutting-edge research posters at the ESA Living Planet Symposium 2025 in Vienna, showcasing how NV5 technology and the ENVI® Ecosystem support innovation across ocean monitoring, mineral exploration, and disaster management. Explore each topic below and access the full posters to learn... Read More >

Monitor, Measure & Mitigate: Integrated Solutions for Geohazard Risk

Monitor, Measure & Mitigate: Integrated Solutions for Geohazard Risk

9/8/2025

Geohazards such as slope instability, erosion, settlement, or seepage pose ongoing risks to critical infrastructure. Roads, railways, pipelines, and utility corridors are especially vulnerable to these natural and human-influenced processes, which can evolve silently until sudden failure occurs. Traditional ground surveys provide only periodic... Read More >

Geo Sessions 2025: Geospatial Vision Beyond the Map

Geo Sessions 2025: Geospatial Vision Beyond the Map

8/5/2025

Lidar, SAR, and Spectral: Geospatial Innovation on the Horizon Last year, Geo Sessions brought together over 5,300 registrants from 159 countries, with attendees representing education, government agencies, consulting, and top geospatial companies like Esri, NOAA, Airbus, Planet, and USGS. At this year's Geo Sessions, NV5 is... Read More >

Not All Supernovae Are Created Equal: Rethinking the Universe’s Measuring Tools

Not All Supernovae Are Created Equal: Rethinking the Universe’s Measuring Tools

6/3/2025

Rethinking the Reliability of Type 1a Supernovae   How do astronomers measure the universe? It all starts with distance. From gauging the size of a galaxy to calculating how fast the universe is expanding, measuring cosmic distances is essential to understanding everything in the sky. For nearby stars, astronomers use... Read More >

Using LLMs To Research Remote Sensing Software: Helpful, but Incomplete

Using LLMs To Research Remote Sensing Software: Helpful, but Incomplete

5/26/2025

Whether you’re new to remote sensing or a seasoned expert, there is no doubt that large language models (LLMs) like OpenAI’s ChatGPT or Google’s Gemini can be incredibly useful in many aspects of research. From exploring the electromagnetic spectrum to creating object detection models using the latest deep learning... Read More >

1345678910Last
«September 2025»
SunMonTueWedThuFriSat
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011
13693 Rate this article:
No rating

Displaying multiple axes with (New) Graphics

Anonym
Here’s a (slight hack of an) example of displaying two time series (5-min mean wind speed and wind direction), each with their own dependent axis, on a set of two independent axes (local time and universal time) using (New) Graphics (NG). For data, I’m using a netCDF archive file from the NCAR Mesa Lab (ML) weather station. Information about the weather station, including a link to the FTP site to download other archived data files, can be found here: http://www.eol.ucar.edu/weather/weather_ml/station.html. You can get the data I used in this example, as well as the program on which the example is based, here. Here’s a screenshot of the final plot from the Windows side of my laptop: An example of displaying multiple axes in NG
After the break, I’ll explain in detail how I made this plot. I chose a file from the archive on the date of a chinook, or windstorm, in Boulder. I think it’s neat to see how the weather station at the ML, which is situated close to the Flatirons, captures the winds in the storm [1]. Start by reading the “time_offset”, “wspd” and “wdir” variables from the archive file:
ml_file = file_which('mlab.20100615.cdf', /include_current_dir)
ml_id = ncdf_open(ml_file)
ncdf_varget, ml_id, ncdf_varid(ml_id, 'time_offset'), time
ncdf_varget, ml_id, ncdf_varid(ml_id, 'wspd'), wspd
ncdf_varget, ml_id, ncdf_varid(ml_id, 'wdir'), wdir
ncdf_close, ml_id
TIME is an offset, in seconds, from 00 UTC (18 local time). Convert it to hours:
time /= 60.0^2
Plot the wind speeds first, in red, overriding the default plot margins (expressed in normalized coordinates) to leave room for the extra axes.
plot_margin = [0.15, 0.25, 0.15, 0.15]
plot_xrange = [0,24]
p_wspd = plot(time, wspd, 'r', $
   axis_style=1, $            ; make only x & y axes, not box axes
   margin=plot_margin, $
   xrange=plot_xrange, $
   xmajor=9, $                ; 3-hr intervals
   dimensions=[700,600], $    ; embiggen window to fit extra axes
   name='Speed', $
   xtitle='Time (UTC)', $
   ytitle='Wind Speed ($m s^{-1}$)', $
   title='NCAR Mesa Lab Weather Station Winds!C2010-06-15')
Here, the short code “r” makes a red plot line. Setting AXIS_STYLE to 1 shows only left and bottom plot axes. NG allows TeX-like format codes in text annotations, like the superscript in the y-axis title. Looking ahead, the XRANGE and MARGIN values will be needed in the plot of wind direction and the NAME property will be used in the plot legend. Next, calculate local time from the UTC values in the wind speed plot P_WSPD. Use AXIS to display these values with a second x-axis, positioned just below the first:
local_time = strtrim(round(p_wspd.xtickvalues + 18) mod 24, 2)
a_time = axis('x', $
   tickname=local_time, $
   location=[0,min(p_wspd.yrange)-2,0], $ ; data coordinates
   title='Time (LST)')
I used the minimum y-axis value from P_WSPD plus an offset to position this axis slightly below the first. A better technique would be to calculate the offset as a fraction of the entire y-axis range of P_WSPD. (I’ll show this in a subsequent post.) Now plot the wind direction, in blue, in the same window as P_WSPD:
p_wdir = plot(time, wdir, 'b', $
   /current, $
   axis_style=0, $         ; display no axes
   margin=plot_margin, $   ; need to use the same margin as above
   xrange=plot_xrange, $   ; and the same xrange
   yrange=[0,360], $
   name='Direction')
The CURRENT keyword (in lieu of OVERPLOT) is the key here: it puts this plot in the same window as the first, but it doesn’t use the same data coordinate system; that’s why I have to use the same MARGIN and XRANGE as in P_WSPD to align the plot correctly in the window. Because I chose not to display axes in P_WDIR, use AXIS to make a y-axis on the right side of the plot:
a_wdir = axis('y', $
   target=p_wdir, $
   major=5, $                             ; [0, 90, 180, 270, 360]
   minor=2, $
   location=[max(p_wdir.xrange),0,0], $   ; right axis, data coordinates
   textpos=1, $                           ; text faces outward
   tickdir=1, $                           ; ticks face inward
   title='Wind Direction (deg from N)')
The TARGET keyword picks up data coordinates from P_WDIR. Note how the wind speeds peak when the wind direction is from 270 degrees, or west – a sure sign of a windstorm in Boulder! To finish, display a legend for the two plots in the default location:
!null = legend(target=[p_wspd, p_wdir])
Again, TARGET picks up properties of the plots P_WSPD and P_WDIR for display. I chose to throw away the reference returned from LEGEND by directing it to !NULL. Save this visualization to an encapsulated PostScript file with:
p.save, 'ng_multiple_axes.eps'
So, I’ve shown a slightly hacky (although not necessarily worse than some of the DG plots I’ve made) way of producing a NG plot with multiple axes. Please use this as a guide for making your own NG plots.

1. Long ago, some of my research was close to this topic: http://www.springerlink.com/content/lh02251655u0j642/. Check out those DG plots!
Please login or register to post comments.