rcklion.blogg.se

Cplot remote printing
Cplot remote printing









Use >1d-4 to avoid a divide-by-zero at each charge's center. FUNCTION ex_contour_function, x, y, userdata COMPILE_OPT IDL2 charge = USERDATA.charge xcoord = USERDATA.xcoord ycoord = USERDATA.ycoord Use Gauss's law to convert to an electric potential.

#Cplot remote printing code#

We can now repeat the above example using a function.įirst, create a new IDL routine called ex_contour_function and save it in a file ex_contour_function.pro on IDL's path: This code displays the electric field, in terms of voltage, made from three point charges. You cannot pass parameters into your equation.Īs a different approach, create an IDL function containing your equation and then pass the function name to the Equation argument.You cannot easily change the equation unless you set a new string.Using an equation string has some limitations: In all of these cases, as the contour plot range changes, IDL recomputes the equation with new X and Y values that span the range. You can also programmatically change the plot range:Ĭplot.XRANGE = cplot.YRANGE =.Use the mouse wheel to zoom in or out, or hold down the key and draw a zoom box.Try clicking with the middle mouse button on the graphic and panning around.Once IDL creates the visualization, test out its dynamic capabilities: This should produce the following graphic:

cplot remote printing

title = 'Electric potential (V/k) of three point charges' cplot = CONTOUR(equation, XRANGE=, YRANGE=, $ RGB_TABLE= 55, /FILL, $ C_VALUE=, $ TITLE=title, DIMENSIONS=, ASPECT_RATIO= 1) cb = COLORBAR(TARGET=cplot, /BORDER) Construct our equation as a function of X and Y. To avoid huge values, the value of the electric potential is divided by k. Here, we will consider three point charges, the first, of 9 coulombs, at location (2, 4), the second, of 12 coulombs at (5, 2), and the third, of 25 coulombs, at (4, 5). The electric potential of a point charge is given by Gauss's law, V = kQ/r, where Q is the electric charge, k= 8.987x10 9 V m C -1 is Coulomb's constant, and r is the distance from the charge. Using an Equation Stringįor the first example, we will have IDL compute the electric potential for three point charges. Once IDL creates the contour visualization, if you then interactively adjust the contour plot range, IDL will automatically recompute the equation to cover the new range. The function should return a two-dimensional result array.

  • If Equation is a function name, then CALL_FUNCTION is called once, with the X and Y arrays as input arguments.
  • Note that in certain circumstances (such as the IDL Virtual Machine), you may not be able to use the EXECUTE function.
  • If Equation is an expression, then IDL calls the EXECUTE function once with the X and Y arrays.
  • cplot remote printing

    The result of the equation (or the function) should be a two-dimensional array of Z coordinates to be contoured. The Equation argument on the CONTOUR function allows you to specify either a string giving an equation of X and Y, or the name of an IDL function that accepts X and Y as arguments. This topic explores ways you can use the EQUATION property to create dynamic, interactive contour visualizations. The CONTOUR function's Equation argument (and the EQUATION property) adds flexibility to the creation of contour plots.









    Cplot remote printing