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

Home » Public Forums » archive » cgGallery with function graphics
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: cgGallery with function graphics [message #87802 is a reply to message #87787] Thu, 27 February 2014 08:13 Go to previous messageGo to previous message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
Basic Contour Plot
http://www.idlcoyote.com/gallery/basic_contour_plot.png


=================
Copy + Paste
=================
; Example Gaussian data.
data = cgDemoData(26)

; Set up variables for the contour plot. Normally, these values
; would be passed into the program as positional and keyword parameters.
minValue = Floor(Min(data))
nLevels = 10
xtitle = 'X Axis'
ytitle = 'Y Axis'
position = [0.125, 0.125, 0.9, 0.9]
title = 'Basic Contour Plot'

;Contour levels
contourLevels = cgConLevels(data, NLevels=10, MinValue=minValue)

; Open a window and return its reference to the user.
aWindow = Window(WINDOW_TITLE="Basic Contour Plot")

;Create a contour
fgContour = Contour(data, /Current, C_Value=contourLevels, C_Color='Purple', $
XTitle=xtitle, YTitle=ytitle, Title=title)

;Add the right and top axes
; In IDL 8.2.3+ set Location='Right' or 'Top' and skip finding [xy]range.
xrange = (fgContour.Axes)[0].Range
yrange = (fgContour.Axes)[1].Range
xAxis = Axis('X', Target=fgContour, Location=[xrange[1], yrange[1], 0], $
TickFormat='(A1)', TickDir=1)
yAxis = Axis('Y', Target=fgContour, Location=[xrange[1], yrange[0], 0], $
TickFormat='(A1)', TickDir=1)





=================
Coyote Version
=================
PRO Basic_Contour_Plot_FG, WINDOW=window
; Example Gaussian data.
data = cgDemoData(26)

; Set up variables for the contour plot. Normally, these values
; would be passed into the program as positional and keyword parameters.
minValue = Floor(Min(data))
nLevels = 10
xtitle = 'X Axis'
ytitle = 'Y Axis'
position = [0.125, 0.125, 0.9, 0.9]
title = 'Basic Contour Plot'

;Contour levels
contourLevels = cgConLevels(data, NLevels=10, MinValue=minValue)

; Open a window and return its reference to the user.
aWindow = Window(WINDOW_TITLE="Basic Contour Plot")

;Create a contour
fgContour = Contour(data, /Current, C_Value=contourLevels, C_Color='Purple', $
XTitle=xtitle, YTitle=ytitle, Title=title)

;Add the right and top axes
; In IDL 8.2.3+ set Location='Right' or 'Top' and skip finding [xy]range.
xrange = (fgContour.Axes)[0].Range
yrange = (fgContour.Axes)[1].Range
xAxis = Axis('X', Target=fgContour, Location=[xrange[1], yrange[1], 0], $
TickFormat='(A1)', TickDir=1)
yAxis = Axis('Y', Target=fgContour, Location=[xrange[1], yrange[0], 0], $
TickFormat='(A1)', TickDir=1)

END ;*********************************************************** ******

; This main program shows how to call the program and produce
; various types of output.

; Display the plot in a resizeable graphics window.
Basic_Contour_Plot_FG, Window=window

; Create a PostScript file. Linestyles are not preserved in IDL 8.2.3 due
; to a bug. Only encapsulated PostScript files can be created.
window.save, 'basic_contour_plot_fg.eps'

; Create a PNG file with a width of 600 pixels. Resolution of this
; PNG file is not very good.
window.save, 'basic_contour_plot_fg.png', WIDTH=600

; For better resolution PNG files, make the PNG full-size, then resize it
; with ImageMagick. Requires ImageMagick to be installed.
window.save, 'line_plot_with_legend_fullsize.png'
Spawn, 'convert basic_contour_plot_fg_fullsize.png -resize 600 basic_contour_plot_fg_resized.png'

END
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to align two images IDL
Next Topic: Is a Class diagram of catalyst avaliable ?

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

Current Time: Sat Oct 11 06:37:15 PDT 2025

Total time taken to generate the page: 0.88045 seconds