X

Help Articles are product support tips and information straight from the NV5 Geospatial Technical Support team developed to help you use our products to their fullest potential.



125 Rate this article:
No rating

How to build a vertical filled plot in IDL

IDL includes a routine called FILLPLOT which allows to create horizontal filled plots. However it does not support vertical filled plots:

https://www.nv5geospatialsoftware.com/docs/FILLPLOT.html

 

The easiest way to build vertical filled plots is then to use the POLYGON routine instead:

https://www.nv5geospatialsoftware.com/docs/POLYGON.html

 

The code example below is showing how to use POLYGON routine to build a vertical filled PLOT

 

PRO TEST_VERTICAL_FILLED_PLOT


; create X data as Mineral %

x=[1,5,2,3,4,5,6,6,2,0,0,0,2,3,4,5,4,3,1,2]

; create Y data as Depth

y=INDGEN(20)


; retrieve X and Y minimum and maximum values

xpmin=min(x)

xpmax=max(x)

ypmin=min(y)

ypmax=max(y)


; dsiplay data, with increasing depth from top to bottom of Y axis

g = PLOT(x, y, YTITLE='Depth',XRANGE=[xpmin,xpmax],YRANGE=[ypmax,ypmin])

g['axis0'].SHOWTEXT =0

g['axis2']. TITLE='Mineral %'

g['axis2'].SHOWTEXT =1



; build the polygon by adding  the points: 
; [ xpmin, ypmax] , [ xpmin, ypmin]  and [ x[0], y[0]] to the input data to close the polygon along the vertical Y axis

xExt = [ x, xpmin, xpmin, x[0]]

yExt = [ y, ypmax, ypmin, y[0]]


; draw the polygon

pol = POLYGON(xExt, yExt, /DATA, FILL_BACKGROUND=1, FILL_COLOR='Yellow',TARGET=g2)


END

 

A graphic similar to the following will be generated:

---------------------------------------

created by BC on 2/19/2025

reviewed by BC (US) on 2/19/2025

 

Please login or register to post comments.
Featured

End-of-Life Policy Enforcement for ENVI 5.3 / IDL 8.5 and Earlier Versions

5/6/2024

April 1, 2024 Dear ENVI/IDL Customer,  We are reaching out to notify you of our supported... more »

How to Upgrade licenses to ENVI 6.x / IDL 9.x

12/5/2023

What is the new Upgrade function? Starting with ENVI 6.0 and IDL 9.0, we have implemented an... more »

What to do if the 'License Administrator - License Server' for the Next-Generation License Server does not start?

6/13/2023

Background: With the release of ENVI 5.7 & IDL 8.9 and the corresponding Next-Generation licensing... more »

Next-Generation Licensing FAQ

4/28/2023

  NV5 Geospatial has adopted a new licensing technology for all future releases of our ENVI, IDL... more »

The IDL Virtual Machine

6/6/2013

What is the IDL Virtual Machine? An IDL Virtual Machine is a runtime version of IDL that can... more »