PetscDraw (Graphics) - Low-level Interface

PetscDraw is PETSc's simple graphics layer (X11 windows, image files, or a null device) with line graphs (PetscDrawLG), scatter plots (PetscDrawSP), histograms (PetscDrawHG), bar charts (PetscDrawBar) and axes. PetscViewerDrawOpen on the PetscViewer page uses it to plot vectors and matrix structure.

Basic Usage

using PETSc, MPI
MPI.Init()
petsclib = PETSc.getlib()
PETSc.initialize(petsclib)

# "" selects the default display; the type comes from -draw_type (x, image, null, ...)
draw = LibPETSc.PetscDrawCreate(petsclib, MPI.COMM_SELF, "", "Line graph",
                                Cint(0), Cint(0), Cint(400), Cint(300))
LibPETSc.PetscDrawSetType(petsclib, draw, LibPETSc.PETSC_DRAW_NULL)   # headless
LibPETSc.PetscDrawSetFromOptions(petsclib, draw)

lg = LibPETSc.PetscDrawLGCreate(petsclib, draw, 1)      # one curve
for i in 0:9
    LibPETSc.PetscDrawLGAddPoint(petsclib, lg, [Float64(i)], [sin(i)])
end
LibPETSc.PetscDrawLGDraw(petsclib, lg)
LibPETSc.PetscDrawFlush(petsclib, draw)

LibPETSc.PetscDrawLGDestroy(petsclib, lg)
LibPETSc.PetscDrawDestroy(petsclib, draw)
PETSc.finalize(petsclib)

Function Reference

PetscDraw

PETSc.LibPETSc.PetscDrawAppendTitle — Method
PetscDrawAppendTitle(petsclib::PetscLibType, draw::PetscDraw, title::String)

Appends to the title of a PetscDraw context.

Collective

Input Parameters:

  • draw - the graphics context
  • title - the title

Level: advanced

See also: PetscDraw, PetscDrawSetTitle(), PetscDrawGetTitle()

External Links

source
PETSc.LibPETSc.PetscDrawArrow — Method
PetscDrawArrow(petsclib::PetscLibType, draw::PetscDraw, xl::PetscReal, yl::PetscReal, xr::PetscReal, yr::PetscReal, cl::Cint)

draws a line with arrow head at end if the line is long enough

Not Collective

Input Parameters:

  • draw - the drawing context
  • xl - horizontal coordinate of first end point
  • yl - vertical coordinate of first end point
  • xr - horizontal coordinate of second end point
  • yr - vertical coordinate of second end point
  • cl - the colors of the endpoints

Level: beginner

See also: PetscDraw, PetscDrawLine(), PetscDrawLineSetWidth(), PetscDrawLineGetWidth(), PetscDrawRectangle(), PetscDrawTriangle(), PetscDrawEllipse(), PetscDrawMarker(), PetscDrawPoint()

External Links

source
PETSc.LibPETSc.PetscDrawAxisCreate — Method
axis::PetscDrawAxis = PetscDrawAxisCreate(petsclib::PetscLibType, draw::PetscDraw)

Generate the axis data structure.

Collective

Input Parameter:

  • draw - PetscDraw object where axis to be made

Output Parameter:

  • axis - the axis datastructure

See also: PetscDrawLGCreate(), PetscDrawLG, PetscDrawSPCreate(), PetscDrawSP, PetscDrawHGCreate(), PetscDrawHG, PetscDrawBarCreate(), PetscDrawBar, PetscDrawLGGetAxis(), PetscDrawSPGetAxis(), PetscDrawHGGetAxis(), PetscDrawBarGetAxis(), PetscDrawAxis, PetscDrawAxisDestroy(), PetscDrawAxisSetColors(), PetscDrawAxisSetLabels(), PetscDrawAxisSetLimits(), PetscDrawAxisGetLimits(), PetscDrawAxisSetHoldLimits(), PetscDrawAxisDraw()

External Links

source
PETSc.LibPETSc.PetscDrawAxisDestroy — Method
PetscDrawAxisDestroy(petsclib::PetscLibType, axis::Union{PetscDrawAxis, Ref{PetscDrawAxis}})

Frees the space used by an axis structure.

Collective

Input Parameter:

  • axis - the axis context

Level: advanced

See also: PetscDraw, PetscDrawAxisCreate(), PetscDrawAxis

External Links

source
PETSc.LibPETSc.PetscDrawAxisDraw — Method
PetscDrawAxisDraw(petsclib::PetscLibType, axis::PetscDrawAxis)

draws an axis.

Collective

Input Parameter:

  • axis - PetscDrawAxis structure

Level: advanced

See also: PetscDrawAxisCreate(), PetscDrawAxis, PetscDrawAxisGetLimits(), PetscDrawAxisSetLimits(), PetscDrawAxisSetLabels(), PetscDrawAxisSetColors()

External Links

source
PETSc.LibPETSc.PetscDrawAxisGetLimits — Method
xmin::PetscReal,xmax::PetscReal,ymin::PetscReal,ymax::PetscReal = PetscDrawAxisGetLimits(petsclib::PetscLibType, axis::PetscDrawAxis)

Gets the limits (in user coords) of the axis

Not Collective

Input Parameters:

  • axis - the axis
  • xmin - the lower x limit
  • xmax - the upper x limit
  • ymin - the lower y limit
  • ymax - the upper y limit

Level: advanced

See also: PetscDrawAxisCreate(), PetscDrawAxis, PetscDrawAxisSetHoldLimits(), PetscDrawAxisSetLimits(), PetscDrawAxisSetLabels(), PetscDrawAxisSetColors()

External Links

source
PETSc.LibPETSc.PetscDrawAxisSetColors — Method
PetscDrawAxisSetColors(petsclib::PetscLibType, axis::PetscDrawAxis, ac::Cint, tc::Cint, cc::Cint)

Sets the colors to be used for the axis, tickmarks, and text.

Logically Collective

Input Parameters:

  • axis - the axis
  • ac - the color of the axis lines
  • tc - the color of the tick marks
  • cc - the color of the text strings

Level: advanced

See also: PetscDraw, PetscDrawAxisCreate(), PetscDrawAxis, PetscDrawAxisSetLabels(), PetscDrawAxisDraw(), PetscDrawAxisSetLimits()

External Links

source
PETSc.LibPETSc.PetscDrawAxisSetHoldLimits — Method
PetscDrawAxisSetHoldLimits(petsclib::PetscLibType, axis::PetscDrawAxis, hold::PetscBool)

Causes an axis to keep the same limits until this is called again

Logically Collective

Input Parameters:

  • axis - the axis
  • hold - PETSC_TRUE - hold current limits, PETSC_FALSE allow limits to be changed

Level: advanced

See also: PetscDrawAxisCreate(), PetscDrawAxis, PetscDrawAxisGetLimits(), PetscDrawAxisSetLimits(), PetscDrawAxisSetLabels(), PetscDrawAxisSetColors()

External Links

source
PETSc.LibPETSc.PetscDrawAxisSetLabels — Method
PetscDrawAxisSetLabels(petsclib::PetscLibType, axis::PetscDrawAxis, top::String, xlabel::String, ylabel::String)

Sets the x and y axis labels.

Logically Collective

Input Parameters:

  • axis - the axis
  • top - the label at the top of the image
  • xlabel - the x axis label
  • ylabel - the y axis label

Level: advanced

See also: PetscDraw, PetscDrawAxisCreate(), PetscDrawAxis, PetscDrawAxisSetColors(), PetscDrawAxisDraw(), PetscDrawAxisSetLimits()

External Links

source
PETSc.LibPETSc.PetscDrawAxisSetLimits — Method
PetscDrawAxisSetLimits(petsclib::PetscLibType, axis::PetscDrawAxis, xmin::PetscReal, xmax::PetscReal, ymin::PetscReal, ymax::PetscReal)

Sets the limits (in user coords) of the axis

Logically Collective

Input Parameters:

  • axis - the axis
  • xmin - the lower x limit
  • xmax - the upper x limit
  • ymin - the lower y limit
  • ymax - the upper y limit

Options Database Key:

  • -drawaxis_hold - hold the initial set of axis limits for future plotting

Level: advanced

See also: PetscDrawAxisSetHoldLimits(), PetscDrawAxisGetLimits(), PetscDrawAxisSetLabels(), PetscDrawAxisSetColors()

External Links

source
PETSc.LibPETSc.PetscDrawBOP — Method
PetscDrawBOP(petsclib::PetscLibType, draw::PetscDraw)

Begins a new page or frame on the selected graphical device.

Logically Collective

Input Parameter:

  • draw - the drawing context

Level: advanced

See also: PetscDrawEOP(), PetscDrawClear()

External Links

source
PETSc.LibPETSc.PetscDrawBarCreate — Method
bar::PetscDrawBar = PetscDrawBarCreate(petsclib::PetscLibType, draw::PetscDraw)

Creates a bar graph data structure.

Collective

Input Parameter:

  • draw - The window where the graph will be made

Output Parameter:

  • bar - The bar graph context

See also: PetscDrawBar, PetscDrawLGCreate(), PetscDrawLG, PetscDrawSPCreate(), PetscDrawSP, PetscDrawHGCreate(), PetscDrawHG, PetscDrawBarDestroy(), PetscDrawBarSetData(), PetscDrawBarDraw(), PetscDrawBarSave(), PetscDrawBarSetColor(), PetscDrawBarSort(), PetscDrawBarSetLimits(), PetscDrawBarGetAxis(), PetscDrawAxis, PetscDrawBarGetDraw(), PetscDrawBarSetFromOptions()

External Links

source
PETSc.LibPETSc.PetscDrawBarDestroy — Method
PetscDrawBarDestroy(petsclib::PetscLibType, bar::Union{PetscDrawBar, Ref{PetscDrawBar}})

Frees all space taken up by bar graph data structure.

Collective

Input Parameter:

  • bar - The bar graph context

Level: intermediate

See also: PetscDrawBar, PetscDrawBarCreate()

External Links

source
PETSc.LibPETSc.PetscDrawBarDraw — Method
PetscDrawBarDraw(petsclib::PetscLibType, bar::PetscDrawBar)

Redraws a bar graph.

Collective

Input Parameter:

  • bar - The bar graph context

Level: intermediate

See also: PetscDrawBar, PetscDrawBarCreate(), PetscDrawBarSetData()

External Links

source
PETSc.LibPETSc.PetscDrawBarGetAxis — Method
axis::PetscDrawAxis = PetscDrawBarGetAxis(petsclib::PetscLibType, bar::PetscDrawBar)

Gets the axis context associated with a bar graph. This is useful if one wants to change some axis property, such as labels, color, etc. The axis context should not be destroyed by the application code.

Not Collective, axis is parallel if bar is parallel

Input Parameter:

  • bar - The bar graph context

Output Parameter:

  • axis - The axis context

Level: intermediate

See also: PetscDrawBar, PetscDrawBarCreate(), PetscDrawAxis, PetscDrawAxisCreate()

External Links

source
PETSc.LibPETSc.PetscDrawBarGetDraw — Method
draw::PetscDraw = PetscDrawBarGetDraw(petsclib::PetscLibType, bar::PetscDrawBar)

Gets the draw context associated with a bar graph.

Not Collective, draw is parallel if bar is parallel

Input Parameter:

  • bar - The bar graph context

Output Parameter:

  • draw - The draw context

Level: intermediate

See also: PetscDrawBar, PetscDraw, PetscDrawBarCreate(), PetscDrawBarDraw()

External Links

source
PETSc.LibPETSc.PetscDrawBarSave — Method
PetscDrawBarSave(petsclib::PetscLibType, bar::PetscDrawBar)

Saves a drawn bar graph

Collective

Input Parameter:

  • bar - The bar graph context

Level: intermediate

See also: PetscDrawSave(), PetscDrawBar, PetscDrawBarCreate(), PetscDrawBarGetDraw(), PetscDrawSetSave(), PetscDrawBarSetData()

External Links

source
PETSc.LibPETSc.PetscDrawBarSetColor — Method
PetscDrawBarSetColor(petsclib::PetscLibType, bar::PetscDrawBar, color::Cint)

Sets the color the bars will be drawn with.

Logically Collective

Input Parameters:

  • bar - The bar graph context
  • color - one of the colors defined in petscdraw.h or PETSC_DRAW_ROTATE to make each bar a

different color

Level: intermediate

See also: PetscDrawBarCreate(), PetscDrawBar, PetscDrawBarSetData(), PetscDrawBarDraw(), PetscDrawBarGetAxis()

External Links

source
PETSc.LibPETSc.PetscDrawBarSetData — Method
PetscDrawBarSetData(petsclib::PetscLibType, bar::PetscDrawBar, bins::PetscInt, data::Vector{PetscReal}, labels::String)

Set the data for a bar graph

Logically Collective

Input Parameters:

  • bar - The bar graph context.
  • bins - number of items
  • data - values of each item
  • labels - optional label for each bar, NULL terminated array of strings

Level: intermediate

See also: PetscDrawBar, PetscDrawBarCreate(), PetscDrawBarDraw()

External Links

source
PETSc.LibPETSc.PetscDrawBarSetFromOptions — Method
PetscDrawBarSetFromOptions(petsclib::PetscLibType, bar::PetscDrawBar)

Sets options related to the display of the PetscDrawBar

Collective

Input Parameter:

  • bar - the bar graph context

Options Database Key:

  • -bar_sort - sort the entries before drawing the bar graph

Level: intermediate

See also: PetscDrawBar, PetscDrawBarDestroy(), PetscDrawBarCreate(), PetscDrawBarSort()

External Links

source
PETSc.LibPETSc.PetscDrawBarSetLimits — Method
PetscDrawBarSetLimits(petsclib::PetscLibType, bar::PetscDrawBar, y_min::PetscReal, y_max::PetscReal)

Sets the axis limits for a bar graph. If more points are added after this call, the limits will be adjusted to include those additional points.

Logically Collective

Input Parameters:

  • bar - The bar graph context
  • y_min - The lower limit
  • y_max - The upper limit

Level: intermediate

See also: PetscDrawBar, PetscDrawBarCreate(), PetscDrawBarGetAxis(), PetscDrawBarSetData(), PetscDrawBarDraw()

External Links

source
PETSc.LibPETSc.PetscDrawBarSort — Method
PetscDrawBarSort(petsclib::PetscLibType, bar::PetscDrawBar, sort::PetscBool, tolerance::PetscReal)

Sorts the values before drawing the bar chart, the bars will be in ascending order from left to right

Logically Collective

Input Parameters:

  • bar - The bar graph context
  • sort - PETSC_TRUE to sort the values
  • tolerance - discard values less than tolerance

Level: intermediate

See also: PetscDrawBar, PetscDrawBarCreate(), PetscDrawBarSetData(), PetscDrawBarSetColor(), PetscDrawBarDraw(), PetscDrawBarGetAxis()

External Links

source
PETSc.LibPETSc.PetscDrawClear — Method
PetscDrawClear(petsclib::PetscLibType, draw::PetscDraw)

Clears graphical output. All processors must call this routine. Does not return until the draw in context is clear.

Collective

Input Parameter:

  • draw - the drawing context

Level: intermediate

See also: PetscDrawBOP(), PetscDrawEOP()

External Links

source
PETSc.LibPETSc.PetscDrawCoordinateToPixel — Method
i::Cint,j::Cint = PetscDrawCoordinateToPixel(petsclib::PetscLibType, draw::PetscDraw, x::PetscReal, y::PetscReal)

given a coordinate in a PetscDraw returns the pixel location

Not Collective

Input Parameters:

  • draw - the draw where the coordinates are defined
  • x - the horizontal coordinate
  • y - the vertical coordinate

Output Parameters:

  • i - the horizontal pixel location
  • j - the vertical pixel location

Level: developer

See also: PetscDraw

External Links

source
PETSc.LibPETSc.PetscDrawCreate — Method
indraw::PetscDraw = PetscDrawCreate(petsclib::PetscLibType, comm::MPI_Comm, display::String, title::String, x::Cint, y::Cint, w::Cint, h::Cint)

Creates a graphics context.

Collective

Input Parameters:

  • comm - MPI communicator
  • display - X display when using X Windows
  • title - optional title added to top of window
  • x - horizonatl coordinate of lower left corner of window or PETSC_DECIDE
  • y - vertical coordinate of lower left corner of window or PETSC_DECIDE
  • w - width of window, PETSC_DECIDE, PETSC_DRAW_HALF_SIZE, PETSC_DRAW_FULL_SIZE, PETSC_DRAW_THIRD_SIZE or PETSC_DRAW_QUARTER_SIZE
  • h - height of window, PETSC_DECIDE, PETSC_DRAW_HALF_SIZE, PETSC_DRAW_FULL_SIZE, PETSC_DRAW_THIRD_SIZE or PETSC_DRAW_QUARTER_SIZE

Output Parameter:

  • indraw - location to put the PetscDraw context

Level: beginner

See also: PetscDrawSetType(), PetscDrawSetFromOptions(), PetscDrawDestroy(), PetscDrawLGCreate(), PetscDrawSPCreate(), PetscDrawViewPortsCreate(), PetscDrawViewPortsSet(), PetscDrawAxisCreate(), PetscDrawHGCreate(), PetscDrawBarCreate(), PetscViewerDrawGetDraw(), PetscDrawSetSave(), PetscDrawSetSaveMovie(), PetscDrawSetSaveFinalImage(), PetscDrawOpenX(), PetscDrawOpenImage(), PetscDrawIsNull(), PetscDrawGetPopup(), PetscDrawCheckResizedWindow(), PetscDrawResizeWindow(), PetscDrawGetWindowSize(), PetscDrawLine(), PetscDrawArrow(), PetscDrawLineSetWidth(), PetscDrawLineGetWidth(), PetscDrawMarker(), PetscDrawPoint(), PetscDrawRectangle(), PetscDrawTriangle(), PetscDrawEllipse(), PetscDrawString(), PetscDrawStringCentered(), PetscDrawStringBoxed(), PetscDrawStringVertical(), PetscDrawSetViewPort(), PetscDrawGetViewPort(), PetscDrawSplitViewPort(), PetscDrawSetTitle(), PetscDrawAppendTitle(), PetscDrawGetTitle(), PetscDrawSetPause(), PetscDrawGetPause(), PetscDrawPause(), PetscDrawSetDoubleBuffer(), PetscDrawClear(), PetscDrawFlush(), PetscDrawGetSingleton(), PetscDrawGetMouseButton(), PetscDrawZoom(), PetscDrawGetBoundingBox()

External Links

source
PETSc.LibPETSc.PetscDrawDestroy — Method
PetscDrawDestroy(petsclib::PetscLibType, draw::Union{PetscDraw, Ref{PetscDraw}})

Deletes a draw context.

Collective

Input Parameter:

  • draw - the drawing context

Level: beginner

See also: PetscDraw, PetscDrawCreate()

External Links

source
PETSc.LibPETSc.PetscDrawEOP — Method
PetscDrawEOP(petsclib::PetscLibType, draw::PetscDraw)

Ends a page or frame on the selected graphical device.

Logically Collective

Input Parameter:

  • draw - the drawing context

Level: advanced

See also: PetscDrawBOP(), PetscDrawClear()

External Links

source
PETSc.LibPETSc.PetscDrawEllipse — Method
PetscDrawEllipse(petsclib::PetscLibType, draw::PetscDraw, x::PetscReal, y::PetscReal, a::PetscReal, b::PetscReal, c::Cint)

Draws an ellipse onto a drawable.

Not Collective

Input Parameters:

  • draw - The drawing context
  • x - The x coordinate of the center
  • y - The y coordinate of the center
  • a - The major axes length
  • b - The minor axes length
  • c - The color

Level: beginner

See also: PetscDraw, PetscDrawRectangle(), PetscDrawTriangle(), PetscDrawMarker(), PetscDrawPoint(), PetscDrawString(), PetscDrawArrow()

External Links

source
PETSc.LibPETSc.PetscDrawFlush — Method
PetscDrawFlush(petsclib::PetscLibType, draw::PetscDraw)

Flushes graphical output.

Collective

Input Parameter:

  • draw - the drawing context

Level: beginner

See also: PetscDraw, PetscDrawClear()

External Links

source
PETSc.LibPETSc.PetscDrawGetBoundingBox — Method
xl::PetscReal,yl::PetscReal,xr::PetscReal,yr::PetscReal = PetscDrawGetBoundingBox(petsclib::PetscLibType, draw::PetscDraw)

Gets the bounding box of all PetscDrawStringBoxed() commands

Not Collective

Input Parameter:

  • draw - the drawing context

Output Parameters:

  • xl - horizontal coordinate of lower left corner of bounding box
  • yl - vertical coordinate of lower left corner of bounding box
  • xr - horizontal coordinate of upper right corner of bounding box
  • yr - vertical coordinate of upper right corner of bounding box

Level: intermediate

See also: PetscDraw, PetscDrawPushCurrentPoint(), PetscDrawPopCurrentPoint(), PetscDrawSetCurrentPoint()

External Links

source
PETSc.LibPETSc.PetscDrawGetCoordinates — Method
xl::PetscReal,yl::PetscReal,xr::PetscReal,yr::PetscReal = PetscDrawGetCoordinates(petsclib::PetscLibType, draw::PetscDraw)

Gets the application coordinates of the corners of the window (or page).

Not Collective

Input Parameter:

  • draw - the drawing object

Output Parameters:

  • xl - the horizontal coordinate of the lower left corner of the drawing region.
  • yl - the vertical coordinate of the lower left corner of the drawing region.
  • xr - the horizontal coordinate of the upper right corner of the drawing region.
  • yr - the vertical coordinate of the upper right corner of the drawing region.

Level: advanced

See also: PetscDraw, PetscDrawSetCoordinates()

External Links

source
PETSc.LibPETSc.PetscDrawGetCurrentPoint — Method
x::PetscReal,y::PetscReal = PetscDrawGetCurrentPoint(petsclib::PetscLibType, draw::PetscDraw)

Gets the current draw point, some codes use this point to determine where to draw next

Not Collective

Input Parameter:

  • draw - the drawing context

Output Parameters:

  • x - horizontal coordinate of the current point
  • y - vertical coordinate of the current point

Level: intermediate

See also: PetscDraw, PetscDrawPushCurrentPoint(), PetscDrawPopCurrentPoint(), PetscDrawSetCurrentPoint()

External Links

source
PETSc.LibPETSc.PetscDrawGetMarkerType — Method
mtype::PetscDrawMarkerType = PetscDrawGetMarkerType(petsclib::PetscLibType, draw::PetscDraw)

gets the type of marker to display with PetscDrawMarker()

Not Collective

Input Parameters:

  • draw - the drawing context
  • mtype - either PETSC_DRAW_MARKER_CROSS (default) or PETSC_DRAW_MARKER_POINT

Level: beginner

See also: PetscDraw, PetscDrawPoint(), PetscDrawMarker(), PetscDrawSetMarkerType(), PetscDrawMarkerType

External Links

source
PETSc.LibPETSc.PetscDrawGetMouseButton — Method
button::PetscDrawButton,x_user::PetscReal,y_user::PetscReal,x_phys::PetscReal,y_phys::PetscReal = PetscDrawGetMouseButton(petsclib::PetscLibType, draw::PetscDraw)

Returns location of mouse and which button was pressed. Waits for button to be pressed.

Collective

Input Parameter:

  • draw - the window to be used

Output Parameters:

  • button - one of PETSC_BUTTON_LEFT, PETSC_BUTTON_CENTER, PETSC_BUTTON_RIGHT, PETSC_BUTTON_WHEEL_UP, PETSC_BUTTON_WHEEL_DOWN
  • x_user - horizontal user coordinate of location (user may pass in NULL).
  • y_user - vertical user coordinate of location (user may pass in NULL).
  • x_phys - horizontal window coordinate (user may pass in NULL).
  • y_phys - vertical window coordinate (user may pass in NULL).

See also: PetscDraw, PetscDrawButton

External Links

source
PETSc.LibPETSc.PetscDrawGetPause — Method
lpause::PetscReal = PetscDrawGetPause(petsclib::PetscLibType, draw::PetscDraw)

Gets the amount of time that program pauses after a PetscDrawPause() is called.

Not Collective

Input Parameters:

  • draw - the drawing object
  • lpause - number of seconds to pause, -1 implies until user input

Level: intermediate

See also: PetscDraw, PetscDrawSetPause(), PetscDrawPause()

External Links

source
PETSc.LibPETSc.PetscDrawGetPopup — Method
popup::PetscDraw = PetscDrawGetPopup(petsclib::PetscLibType, draw::PetscDraw)

Creates a popup window associated with a PetscDraw window.

Collective

Input Parameter:

  • draw - the original window

Output Parameter:

  • popup - the new popup window

Level: advanced

See also: PetscDraw, PetscDrawScalePopup(), PetscDrawCreate()

External Links

source
PETSc.LibPETSc.PetscDrawGetSingleton — Method
sdraw::PetscDraw = PetscDrawGetSingleton(petsclib::PetscLibType, draw::PetscDraw)

Gain access to a PetscDraw object as if it were owned by the one process.

Collective

Input Parameter:

  • draw - the original window

Output Parameter:

  • sdraw - the singleton window

Level: advanced

See also: PetscDraw, PetscDrawRestoreSingleton(), PetscViewerGetSingleton(), PetscViewerRestoreSingleton()

External Links

source
PETSc.LibPETSc.PetscDrawGetTitle — Method
title::String = PetscDrawGetTitle(petsclib::PetscLibType, draw::PetscDraw)

Gets pointer to title of a PetscDraw context.

Not Collective

Input Parameter:

  • draw - the graphics context

Output Parameter:

  • title - the title

Level: intermediate

See also: PetscDraw, PetscDrawSetTitle()

External Links

source
PETSc.LibPETSc.PetscDrawGetType — Method
type::String = PetscDrawGetType(petsclib::PetscLibType, draw::PetscDraw)

Gets the PetscDraw type as a string from the PetscDraw object.

Not Collective

Input Parameter:

  • draw - Krylov context

Output Parameter:

  • type - name of PetscDraw method

Level: advanced

See also: PetscDraw, PetscDrawType, PetscDrawSetType(), PetscDrawCreate(), PetscObjectTypeCompare(), PetscObjectTypeCompareAny()

External Links

source
PETSc.LibPETSc.PetscDrawGetViewPort — Method
xl::PetscReal,yl::PetscReal,xr::PetscReal,yr::PetscReal = PetscDrawGetViewPort(petsclib::PetscLibType, draw::PetscDraw)

Gets the portion of the window (page) to which draw routines will write.

Collective

Input Parameter:

  • draw - the drawing context

Output Parameters:

  • xl - the horizontal coordinate of the lower left corner of the subwindow.
  • yl - the vertical coordinate of the lower left corner of the subwindow.
  • xr - the horizontal coordinate of the upper right corner of the subwindow.
  • yr - the vertical coordinate of the upper right corner of the subwindow.

Level: advanced

See also: PetscDraw, PetscDrawSplitViewPort(), PetscDrawSetViewPort()

External Links

source
PETSc.LibPETSc.PetscDrawGetWindowSize — Method
w::Cint,h::Cint = PetscDrawGetWindowSize(petsclib::PetscLibType, draw::PetscDraw)

Gets the size of the window.

Not Collective

Input Parameter:

  • draw - the window

Output Parameters:

  • w - the window width
  • h - the window height

Level: intermediate

See also: PetscDraw, PetscDrawResizeWindow(), PetscDrawCheckResizedWindow()

External Links

source
PETSc.LibPETSc.PetscDrawHGAddValue — Method
PetscDrawHGAddValue(petsclib::PetscLibType, hist::PetscDrawHG, value::PetscReal)

Adds another value to the histogram.

Logically Collective

Input Parameters:

  • hist - The histogram
  • value - The value

Level: intermediate

See also: PetscDrawHGCreate(), PetscDrawHG, PetscDrawHGDraw(), PetscDrawHGReset(), PetscDrawHGAddWeightedValue()

External Links

source
PETSc.LibPETSc.PetscDrawHGAddWeightedValue — Method
PetscDrawHGAddWeightedValue(petsclib::PetscLibType, hist::PetscDrawHG, value::PetscReal, weight::PetscReal)

Adds another value to the histogram with a weight.

Logically Collective

Input Parameters:

  • hist - The histogram
  • value - The value
  • weight - The value weight

Level: intermediate

See also: PetscDrawHGCreate(), PetscDrawHG, PetscDrawHGDraw(), PetscDrawHGReset(), PetscDrawHGAddValue()

External Links

source
PETSc.LibPETSc.PetscDrawHGCalcStats — Method
PetscDrawHGCalcStats(petsclib::PetscLibType, hist::PetscDrawHG, calc::PetscBool)

Turns on calculation of descriptive statistics associated with the histogram

Not Collective

Input Parameters:

  • hist - The histogram context
  • calc - Flag for calculation

Level: intermediate

See also: PetscDrawHG, PetscDrawHGCreate(), PetscDrawHGAddValue(), PetscDrawHGView(), PetscDrawHGDraw()

External Links

source
PETSc.LibPETSc.PetscDrawHGCreate — Method
hist::PetscDrawHG = PetscDrawHGCreate(petsclib::PetscLibType, draw::PetscDraw, bins::Cint)

Creates a histogram data structure.

Collective

Input Parameters:

  • draw - The window where the graph will be made
  • bins - The number of bins to use

Output Parameter:

  • hist - The histogram context

Level: intermediate

See also: PetscDrawHGDestroy(), PetscDrawHG, PetscDrawBarCreate(), PetscDrawBar, PetscDrawLGCreate(), PetscDrawLG, PetscDrawSPCreate(), PetscDrawSP, PetscDrawHGSetNumberBins(), PetscDrawHGReset(), PetscDrawHGAddValue(), PetscDrawHGDraw(), PetscDrawHGSave(), PetscDrawHGView(), PetscDrawHGSetColor(), PetscDrawHGSetLimits(), PetscDrawHGCalcStats(), PetscDrawHGIntegerBins(), PetscDrawHGGetAxis(), PetscDrawAxis, PetscDrawHGGetDraw()

External Links

source
PETSc.LibPETSc.PetscDrawHGDestroy — Method
PetscDrawHGDestroy(petsclib::PetscLibType, hist::Union{PetscDrawHG, Ref{PetscDrawHG}})

Frees all space taken up by histogram data structure.

Collective

Input Parameter:

  • hist - The histogram context

Level: intermediate

See also: PetscDrawHGCreate(), PetscDrawHG

External Links

source
PETSc.LibPETSc.PetscDrawHGDraw — Method
PetscDrawHGDraw(petsclib::PetscLibType, hist::PetscDrawHG)

Redraws a histogram.

Collective

Input Parameter:

  • hist - The histogram context

Level: intermediate

See also: PetscDrawHGCreate(), PetscDrawHG, PetscDrawHGAddValue(), PetscDrawHGReset()

External Links

source
PETSc.LibPETSc.PetscDrawHGGetAxis — Method
axis::PetscDrawAxis = PetscDrawHGGetAxis(petsclib::PetscLibType, hist::PetscDrawHG)

Gets the axis context associated with a histogram. This is useful if one wants to change some axis property, such as labels, color, etc. The axis context should not be destroyed by the application code.

Not Collective, axis is parallel if hist is parallel

Input Parameter:

  • hist - The histogram context

Output Parameter:

  • axis - The axis context

Level: intermediate

See also: PetscDrawHG, PetscDrawAxis, PetscDrawHGCreate(), PetscDrawHGAddValue(), PetscDrawHGView(), PetscDrawHGDraw(), PetscDrawHGSetColor(), PetscDrawHGSetLimits()

External Links

source
PETSc.LibPETSc.PetscDrawHGGetDraw — Method
draw::PetscDraw = PetscDrawHGGetDraw(petsclib::PetscLibType, hist::PetscDrawHG)

Gets the draw context associated with a histogram.

Not Collective, draw is parallel if hist is parallel

Input Parameter:

  • hist - The histogram context

Output Parameter:

  • draw - The draw context

Level: intermediate

See also: PetscDraw, PetscDrawHG, PetscDrawHGCreate(), PetscDrawHGAddValue(), PetscDrawHGView(), PetscDrawHGDraw(), PetscDrawHGSetColor(), PetscDrawAxis, PetscDrawHGSetLimits()

External Links

source
PETSc.LibPETSc.PetscDrawHGIntegerBins — Method
PetscDrawHGIntegerBins(petsclib::PetscLibType, hist::PetscDrawHG, ints::PetscBool)

Turns on integer width bins

Not Collective

Input Parameters:

  • hist - The histogram context
  • ints - Flag for integer width bins

Level: intermediate

See also: PetscDrawHG, PetscDrawHGCreate(), PetscDrawHGAddValue(), PetscDrawHGView(), PetscDrawHGDraw(), PetscDrawHGSetColor()

External Links

source
PETSc.LibPETSc.PetscDrawHGReset — Method
PetscDrawHGReset(petsclib::PetscLibType, hist::PetscDrawHG)

Clears histogram to allow for reuse with new data.

Logically Collective

Input Parameter:

  • hist - The histogram context.

Level: intermediate

See also: PetscDrawHGCreate(), PetscDrawHG, PetscDrawHGDraw(), PetscDrawHGAddValue()

External Links

source
PETSc.LibPETSc.PetscDrawHGSave — Method
PetscDrawHGSave(petsclib::PetscLibType, hg::PetscDrawHG)

Saves a drawn image

Collective

Input Parameter:

  • hg - The histogram context

Level: intermediate

See also: PetscDrawSave(), PetscDrawHGCreate(), PetscDrawHGGetDraw(), PetscDrawSetSave(), PetscDrawHGDraw()

External Links

source
PETSc.LibPETSc.PetscDrawHGSetColor — Method
PetscDrawHGSetColor(petsclib::PetscLibType, hist::PetscDrawHG, color::Cint)

Sets the color the bars will be drawn with.

Logically Collective

Input Parameters:

  • hist - The histogram context
  • color - one of the colors defined in petscdraw.h or PETSC_DRAW_ROTATE to make each bar a different color

Level: intermediate

See also: PetscDrawHG, PetscDrawHGCreate(), PetscDrawHGGetDraw(), PetscDrawSetSave(), PetscDrawSave(), PetscDrawHGDraw(), PetscDrawHGGetAxis()

External Links

source
PETSc.LibPETSc.PetscDrawHGSetLimits — Method
PetscDrawHGSetLimits(petsclib::PetscLibType, hist::PetscDrawHG, x_min::PetscReal, x_max::PetscReal, y_min::Cint, y_max::Cint)

Sets the axis limits for a histogram. If more points are added after this call, the limits will be adjusted to include those additional points.

Logically Collective

Input Parameters:

  • hist - The histogram context
  • x_min - the horizontal lower limit
  • x_max - the horizontal upper limit
  • y_min - the vertical lower limit
  • y_max - the vertical upper limit

Level: intermediate

See also: PetscDrawHG, PetscDrawHGCreate(), PetscDrawHGGetDraw(), PetscDrawSetSave(), PetscDrawSave(), PetscDrawHGDraw(), PetscDrawHGGetAxis()

External Links

source
PETSc.LibPETSc.PetscDrawHGSetNumberBins — Method
PetscDrawHGSetNumberBins(petsclib::PetscLibType, hist::PetscDrawHG, bins::Cint)

Change the number of bins that are to be drawn in the histogram

Logically Collective

Input Parameters:

  • hist - The histogram context.
  • bins - The number of bins.

Level: intermediate

See also: PetscDrawHGCreate(), PetscDrawHG, PetscDrawHGDraw(), PetscDrawHGIntegerBins()

External Links

source
PETSc.LibPETSc.PetscDrawHGView — Method
PetscDrawHGView(petsclib::PetscLibType, hist::PetscDrawHG, viewer::PetscViewer)

Prints the histogram information to a viewer

Not Collective

Input Parameters:

  • hist - The histogram context
  • viewer - The viewer to view it with

Level: beginner

See also: PetscDrawHG, PetscViewer, PetscDrawHGCreate(), PetscDrawHGGetDraw(), PetscDrawSetSave(), PetscDrawSave(), PetscDrawHGDraw()

External Links

source
PETSc.LibPETSc.PetscDrawIndicatorFunction — Method
PetscDrawIndicatorFunction(petsclib::PetscLibType, draw::PetscDraw, xmin::PetscReal, xmax::PetscReal, ymin::PetscReal, ymax::PetscReal, c::Cint, indicator::external, ctx::Ptr{Cvoid})

Draws an indicator function (where a relationship is true) on a PetscDraw

Not Collective

Input Parameters:

  • draw - a PetscDraw
  • xmin - region to draw indicator function
  • xmax - region to draw indicator function
  • ymin - region to draw indicator function
  • ymax - region to draw indicator function
  • c - the color of the region
  • indicator - the indicator function
  • ctx - the context to pass to the indicator function

Level: developer

See also: PetscDraw

External Links

source
PETSc.LibPETSc.PetscDrawInitializePackage — Method
PetscDrawInitializePackage(petsclib::PetscLibType)

This function initializes everything in the PetscDraw package. It is called from PetscDLLibraryRegister_petsc() when using dynamic libraries, and on the call to PetscInitialize() when using shared or static libraries.

Level: developer

See also: PetscDraw, PetscInitialize()

External Links

source
PETSc.LibPETSc.PetscDrawIsNull — Method
yes::PetscBool = PetscDrawIsNull(petsclib::PetscLibType, draw::PetscDraw)

Returns PETSC_TRUE if draw is a null draw object.

Not Collective

Input Parameter:

  • draw - the draw context

Output Parameter:

  • yes - PETSC_TRUE if it is a null draw object; otherwise PETSC_FALSE

Level: advanced

See also: PetscDraw, PETSC_DRAW_NULL, PetscDrawOpenX()

External Links

source
PETSc.LibPETSc.PetscDrawLGAddCommonPoint — Method
PetscDrawLGAddCommonPoint(petsclib::PetscLibType, lg::PetscDrawLG, x::PetscReal, y::Vector{PetscReal})

Adds another point to each of the line graphs. All the points share the same new X coordinate. The new point must have an X coordinate larger than the old points.

Logically Collective

Input Parameters:

  • lg - the line graph context
  • x - the common x coordinate point
  • y - the new y coordinate point for each curve.

Level: intermediate

See also: PetscDrawLG, PetscDrawLGCreate(), PetscDrawLGAddPoints(), PetscDrawLGAddPoint(), PetscDrawLGReset(), PetscDrawLGDraw()

External Links

source
PETSc.LibPETSc.PetscDrawLGAddPoint — Method
PetscDrawLGAddPoint(petsclib::PetscLibType, lg::PetscDrawLG, x::Vector{PetscReal}, y::Vector{PetscReal})

Adds another point to each of the line graphs. The new point must have an X coordinate larger than the old points.

Logically Collective

Input Parameters:

  • lg - the line graph context
  • x - array containing the x coordinate for the point on each curve
  • y - array containing the y coordinate for the point on each curve

Level: intermediate

See also: PetscDrawLG, PetscDrawLGCreate(), PetscDrawLGAddPoints(), PetscDrawLGAddCommonPoint(), PetscDrawLGReset(), PetscDrawLGDraw()

External Links

source
PETSc.LibPETSc.PetscDrawLGAddPoints — Method
PetscDrawLGAddPoints(petsclib::PetscLibType, lg::PetscDrawLG, n::PetscInt, xx::Union{Ptr, AbstractArray{PetscReal}}, yy::Union{Ptr, AbstractArray{PetscReal}})

Adds several points to each of the line graphs. The new points must have an X coordinate larger than the old points.

Logically Collective

Input Parameters:

  • lg - the line graph context
  • xx - array of pointers that point to arrays containing the new x coordinates for each curve.
  • yy - array of pointers that point to arrays containing the new y points for each curve.
  • n - number of points being added

Level: intermediate

See also: PetscDrawLG, PetscDrawLGCreate(), PetscDrawLGAddPoint(), PetscDrawLGAddCommonPoint(), PetscDrawLGReset(), PetscDrawLGDraw()

External Links

source
PETSc.LibPETSc.PetscDrawLGCreate — Method
outlg::PetscDrawLG = PetscDrawLGCreate(petsclib::PetscLibType, draw::PetscDraw, dim::PetscInt)

Creates a line graph data structure.

Collective

Input Parameters:

  • draw - the window where the graph will be made.
  • dim - the number of curves which will be drawn

Output Parameter:

  • outlg - the line graph context

Level: intermediate

See also: PetscDrawLGDestroy(), PetscDrawLGAddPoint(), PetscDrawLGAddCommonPoint(), PetscDrawLGAddPoints(), PetscDrawLGDraw(), PetscDrawLGSave(), PetscDrawLGView(), PetscDrawLGReset(), PetscDrawLGSetDimension(), PetscDrawLGGetDimension(), PetscDrawLGSetLegend(), PetscDrawLGGetAxis(), PetscDrawLGGetDraw(), PetscDrawLGSetUseMarkers(), PetscDrawLGSetLimits(), PetscDrawLGSetColors(), PetscDrawLGSetOptionsPrefix(), PetscDrawLGSetFromOptions()

External Links

source
PETSc.LibPETSc.PetscDrawLGDestroy — Method
PetscDrawLGDestroy(petsclib::PetscLibType, lg::Union{PetscDrawLG, Ref{PetscDrawLG}})

Frees all space taken up by line graph data structure.

Collective

Input Parameter:

  • lg - the line graph context

Level: intermediate

See also: PetscDrawLG, PetscDrawLGCreate()

External Links

source
PETSc.LibPETSc.PetscDrawLGDraw — Method
PetscDrawLGDraw(petsclib::PetscLibType, lg::PetscDrawLG)

Redraws a line graph.

Collective

Input Parameter:

  • lg - the line graph context

Level: intermediate

See also: PetscDrawLG, PetscDrawSPDraw(), PetscDrawLGSPDraw(), PetscDrawLGReset()

External Links

source
PETSc.LibPETSc.PetscDrawLGGetAxis — Method
axis::PetscDrawAxis = PetscDrawLGGetAxis(petsclib::PetscLibType, lg::PetscDrawLG)

Gets the axis context associated with a line graph. This is useful if one wants to change some axis property, such as labels, color, etc. The axis context should not be destroyed by the application code.

Not Collective, if lg is parallel then axis is parallel

Input Parameter:

  • lg - the line graph context

Output Parameter:

  • axis - the axis context

Level: advanced

See also: PetscDrawLGCreate(), PetscDrawAxis, PetscDrawLG

External Links

source
PETSc.LibPETSc.PetscDrawLGGetData — Method
dim::PetscInt,n::PetscInt,x::Vector{PetscReal},y::Vector{PetscReal} = PetscDrawLGGetData(petsclib::PetscLibType, lg::PetscDrawLG)

Get the data being plotted.

Not Collective

Input Parameter:

  • lg - the line graph context

Output Parameters:

  • dim - the number of curves
  • n - the number of points on each line
  • x - The x-value of each point, x[p * dim + c]
  • y - The y-value of each point, y[p * dim + c]

Level: intermediate

See also: PetscDrawLGC, PetscDrawLGCreate(), PetscDrawLGGetDimension()

External Links

source
PETSc.LibPETSc.PetscDrawLGGetDimension — Method
dim::PetscInt = PetscDrawLGGetDimension(petsclib::PetscLibType, lg::PetscDrawLG)

Get the number of curves that are to be drawn.

Not Collective

Input Parameter:

  • lg - the line graph context.

Output Parameter:

  • dim - the number of curves.

Level: intermediate

See also: PetscDrawLGC, PetscDrawLGCreate(), PetscDrawLGSetDimension()

External Links

source
PETSc.LibPETSc.PetscDrawLGGetDraw — Method
draw::PetscDraw = PetscDrawLGGetDraw(petsclib::PetscLibType, lg::PetscDrawLG)

Gets the draw context associated with a line graph.

Not Collective, if lg is parallel then draw is parallel

Input Parameter:

  • lg - the line graph context

Output Parameter:

  • draw - the draw context

Level: intermediate

See also: PetscDrawLGCreate(), PetscDraw, PetscDrawLG

External Links

source
PETSc.LibPETSc.PetscDrawLGReset — Method
PetscDrawLGReset(petsclib::PetscLibType, lg::PetscDrawLG)

Clears line graph to allow for reuse with new data.

Logically Collective

Input Parameter:

  • lg - the line graph context.

Level: intermediate

See also: PetscDrawLG, PetscDrawLGCreate()

External Links

source
PETSc.LibPETSc.PetscDrawLGSPDraw — Method
PetscDrawLGSPDraw(petsclib::PetscLibType, lg::PetscDrawLG, spin::PetscDrawSP)

Redraws a line graph and a scatter plot on the same PetscDraw they must share

Collective

Input Parameters:

  • lg - the line graph context
  • spin - the scatter plot

Level: intermediate

See also: PetscDrawLGDraw(), PetscDrawSPDraw()

External Links

source
PETSc.LibPETSc.PetscDrawLGSave — Method
PetscDrawLGSave(petsclib::PetscLibType, lg::PetscDrawLG)

Saves a drawn image

Collective

Input Parameter:

  • lg - The line graph context

Level: intermediate

See also: PetscDrawLG, PetscDrawSave(), PetscDrawLGCreate(), PetscDrawLGGetDraw(), PetscDrawSetSave()

External Links

source
PETSc.LibPETSc.PetscDrawLGSetColors — Method
PetscDrawLGSetColors(petsclib::PetscLibType, lg::PetscDrawLG, colors::Vector{Cint})

Sets the color of each line graph drawn

Logically Collective

Input Parameters:

  • lg - the line graph context.
  • colors - the colors, an array of length the value set with PetscDrawLGSetDimension()

Level: intermediate

See also: PetscDrawLG, PetscDrawLGCreate(), PetscDrawLGSetDimension(), PetscDrawLGGetDimension()

External Links

source
PETSc.LibPETSc.PetscDrawLGSetDimension — Method
PetscDrawLGSetDimension(petsclib::PetscLibType, lg::PetscDrawLG, dim::PetscInt)

Change the number of curves that are to be drawn.

Logically Collective

Input Parameters:

  • lg - the line graph context.
  • dim - the number of curves.

Level: intermediate

See also: PetscDrawLGCreate(), PetscDrawLGGetDimension()

External Links

source
PETSc.LibPETSc.PetscDrawLGSetFromOptions — Method
PetscDrawLGSetFromOptions(petsclib::PetscLibType, lg::PetscDrawLG)

Sets options related to the line graph object

Collective

Input Parameters:

  • lg - the line graph context

Options Database Key:

  • -lg_use_markers (true|false) - true means it draws a marker for each point

Level: intermediate

See also: PetscDrawLG, PetscDrawLGDestroy(), PetscDrawLGCreate()

External Links

source
PETSc.LibPETSc.PetscDrawLGSetLegend — Method
PetscDrawLGSetLegend(petsclib::PetscLibType, lg::PetscDrawLG, names::String)

sets the names of each curve plotted

Logically Collective

Input Parameters:

  • lg - the line graph context.
  • names - the names for each curve

Level: intermediate

See also: PetscDrawLGGetAxis(), PetscDrawAxis, PetscDrawAxisSetColors(), PetscDrawAxisSetLabels(), PetscDrawAxisSetHoldLimits()

External Links

source
PETSc.LibPETSc.PetscDrawLGSetLimits — Method
PetscDrawLGSetLimits(petsclib::PetscLibType, lg::PetscDrawLG, x_min::PetscReal, x_max::PetscReal, y_min::PetscReal, y_max::PetscReal)

Sets the axis limits for a line graph. If more points are added after this call, the limits will be adjusted to include those additional points.

Logically Collective

Input Parameters:

  • lg - the line graph context
  • x_min - the horizontal lower limit
  • x_max - the horizontal upper limit
  • y_min - the vertical lower limit
  • y_max - the vertical upper limit

Level: intermediate

See also: PetscDrawLGCreate(), PetscDrawLG, PetscDrawAxis

External Links

source
PETSc.LibPETSc.PetscDrawLGSetOptionsPrefix — Method
PetscDrawLGSetOptionsPrefix(petsclib::PetscLibType, lg::PetscDrawLG, prefix::String)

Sets the prefix used for searching for all PetscDrawLG options in the database.

Logically Collective

Input Parameters:

  • lg - the line graph context
  • prefix - the prefix to prepend to all option names

Level: advanced

See also: PetscDrawLG, PetscDrawLGSetFromOptions(), PetscDrawLGCreate()

External Links

source
PETSc.LibPETSc.PetscDrawLGSetUseMarkers — Method
PetscDrawLGSetUseMarkers(petsclib::PetscLibType, lg::PetscDrawLG, flg::PetscBool)

Causes the line graph object to draw a marker for each data-point.

Logically Collective

Input Parameters:

  • lg - the linegraph context
  • flg - should mark each data point

Options Database Key:

  • -lg_use_markers (true|false) - true means it draws a marker for each point

Level: intermediate

See also: PetscDrawLG, PetscDrawLGCreate()

External Links

source
PETSc.LibPETSc.PetscDrawLGView — Method
PetscDrawLGView(petsclib::PetscLibType, lg::PetscDrawLG, viewer::PetscViewer)

Prints a line graph.

Collective

Input Parameters:

  • lg - the line graph context
  • viewer - the viewer to view it with

Level: beginner

See also: PetscDrawLG, PetscDrawLGCreate()

External Links

source
PETSc.LibPETSc.PetscDrawLine — Method
PetscDrawLine(petsclib::PetscLibType, draw::PetscDraw, xl::PetscReal, yl::PetscReal, xr::PetscReal, yr::PetscReal, cl::Cint)

draws a line onto a drawable.

Not Collective

Input Parameters:

  • draw - the drawing context
  • xl - horizontal coordinate of first end point
  • yl - vertical coordinate of first end point
  • xr - horizontal coordinate of second end point
  • yr - vertical coordinate of second end point
  • cl - the colors of the endpoints

Level: beginner

See also: PetscDraw, PetscDrawArrow(), PetscDrawLineSetWidth(), PetscDrawLineGetWidth(), PetscDrawRectangle(), PetscDrawTriangle(), PetscDrawEllipse(), PetscDrawMarker(), PetscDrawPoint()

External Links

source
PETSc.LibPETSc.PetscDrawLineGetWidth — Method
width::PetscReal = PetscDrawLineGetWidth(petsclib::PetscLibType, draw::PetscDraw)

Gets the line width for future draws. The width is relative to the user coordinates of the window; 0.0 denotes the natural width; 1.0 denotes the interior viewport.

Not Collective

Input Parameter:

  • draw - the drawing context

Output Parameter:

  • width - the width in user coordinates

Level: advanced

See also: PetscDraw, PetscDrawLineSetWidth(), PetscDrawLine(), PetscDrawArrow()

External Links

source
PETSc.LibPETSc.PetscDrawLineSetWidth — Method
PetscDrawLineSetWidth(petsclib::PetscLibType, draw::PetscDraw, width::PetscReal)

Sets the line width for future draws. The width is relative to the user coordinates of the window; 0.0 denotes the natural width; 1.0 denotes the entire viewport.

Not Collective

Input Parameters:

  • draw - the drawing context
  • width - the width in user coordinates

Level: advanced

See also: PetscDraw, PetscDrawLineGetWidth(), PetscDrawLine(), PetscDrawArrow()

External Links

source
PETSc.LibPETSc.PetscDrawMarker — Method
PetscDrawMarker(petsclib::PetscLibType, draw::PetscDraw, xl::PetscReal, yl::PetscReal, cl::Cint)

draws a marker onto a drawable.

Not Collective

Input Parameters:

  • draw - the drawing context
  • xl - horizontal coordinate of the marker
  • yl - vertical coordinate of the marker
  • cl - the color of the marker

Level: beginner

See also: PetscDraw, PetscDrawPoint(), PetscDrawString(), PetscDrawSetMarkerType(), PetscDrawGetMarkerType()

External Links

source
PETSc.LibPETSc.PetscDrawOpenImage — Method
draw::PetscDraw = PetscDrawOpenImage(petsclib::PetscLibType, comm::MPI_Comm, filename::String, w::Cint, h::Cint)

Opens an image for use with the PetscDraw routines.

Collective

Input Parameters:

  • comm - the communicator that will share image
  • filename - optional name of the file where the image will be stored
  • w - the image width in pixels
  • h - the image height in pixels

Output Parameter:

  • draw - the drawing context.

Level: beginner

See also: PetscDraw, PETSC_DRAW_IMAGE, PETSC_DRAW_X, PetscDrawSetSave(), PetscDrawSetFromOptions(), PetscDrawCreate(), PetscDrawDestroy()

External Links

source
PETSc.LibPETSc.PetscDrawOpenNull — Method
win::PetscDraw = PetscDrawOpenNull(petsclib::PetscLibType, comm::MPI_Comm)

Opens a null drawing context. All draw commands to it are ignored.

Input Parameter:

  • comm - MPI communicator

Output Parameter:

  • win - the drawing context

Level: advanced

See also: PetscDraw, PetscDrawIsNull(), PETSC_DRAW_NULL, PetscDrawOpenX()

External Links

source
PETSc.LibPETSc.PetscDrawOpenX — Method
draw::PetscDraw = PetscDrawOpenX(petsclib::PetscLibType, comm::MPI_Comm, display::String, title::String, x::Cint, y::Cint, w::Cint, h::Cint)

Opens an X-window for use with the PetscDraw routines.

Collective

Input Parameters:

  • comm - the communicator that will share X-window
  • display - the X display on which to open, or NULL for the local machine
  • title - the title to put in the title bar, or NULL for no title
  • x - the x screen coordinates of the upper left corner of window (or PETSC_DECIDE)
  • y - the y screen coordinates of the upper left corner of window (or PETSC_DECIDE)
  • w - the screen width in pixels of (or PETSC_DRAW_HALF_SIZE, PETSC_DRAW_FULL_SIZE, or PETSC_DRAW_THIRD_SIZE or PETSC_DRAW_QUARTER_SIZE)
  • h - the screen height in pixels of (or PETSC_DRAW_HALF_SIZE, PETSC_DRAW_FULL_SIZE, or PETSC_DRAW_THIRD_SIZE or PETSC_DRAW_QUARTER_SIZE)

Output Parameter:

  • draw - the drawing context.

Options Database Keys:

  • -nox - Disables all x-windows output
  • -display name - Sets name of machine for the X display
  • -draw_pause pause - Sets time (in seconds) that the program pauses after PetscDrawPause() has been called

(0 is default, -1 implies until user input).

  • -draw_cmap name - Sets the colormap to use.
  • -draw_cmap_reverse - Reverses the colormap.
  • -draw_cmap_brighten - Brighten (0 < beta < 1) or darken (-1 < beta < 0) the colormap.
  • -draw_x_shared_colormap - Causes PETSc to use a shared colormap. By default PETSc creates a separate color

for its windows, you must put the mouse into the graphics window to see the correct colors. This options forces PETSc to use the default colormap which will usually result in bad contour plots.

  • -draw_fast - Does not create colormap for contour plots.
  • -draw_double_buffer - Uses double buffering for smooth animation.
  • -geometry - Indicates location and size of window.

Level: beginner

See also: PetscDrawFlush(), PetscDrawDestroy(), PetscDrawCreate()

External Links

source
PETSc.LibPETSc.PetscDrawPause — Method
PetscDrawPause(petsclib::PetscLibType, draw::PetscDraw)

Waits n seconds or until user input, depending on input to PetscDrawSetPause().

Collective

Input Parameter:

  • draw - the drawing context

Level: beginner

See also: PetscDraw, PetscDrawSetPause(), PetscDrawGetPause()

External Links

source
PETSc.LibPETSc.PetscDrawPixelToCoordinate — Method
x::PetscReal,y::PetscReal = PetscDrawPixelToCoordinate(petsclib::PetscLibType, draw::PetscDraw, i::Cint, j::Cint)

given a pixel in a PetscDraw returns the coordinate

Not Collective

Input Parameters:

  • draw - the draw where the coordinates are defined
  • i - the horizontal pixel location
  • j - the vertical pixel location

Output Parameters:

  • x - the horizontal coordinate
  • y - the vertical coordinate

Level: developer

See also: PetscDraw

External Links

source
PETSc.LibPETSc.PetscDrawPoint — Method
PetscDrawPoint(petsclib::PetscLibType, draw::PetscDraw, xl::PetscReal, yl::PetscReal, cl::Cint)

draws a point onto a drawable.

Not Collective

Input Parameters:

  • draw - the drawing context
  • xl - horizatonal coordinate of the point
  • yl - vertical coordinate of the point
  • cl - the color of the point

Level: beginner

See also: PetscDraw, PetscDrawPointPixel(), PetscDrawPointSetSize(), PetscDrawLine(), PetscDrawRectangle(), PetscDrawTriangle(), PetscDrawEllipse(), PetscDrawMarker(), PetscDrawString(), PetscDrawArrow()

External Links

source
PETSc.LibPETSc.PetscDrawPointPixel — Method
PetscDrawPointPixel(petsclib::PetscLibType, draw::PetscDraw, x::Cint, y::Cint, c::Cint)

draws a point onto a drawable, in pixel coordinates

Not Collective

Input Parameters:

  • draw - the drawing context
  • x - horizontal pixel coordinates of the point
  • y - vertical pixel coordinates of the point
  • c - the color of the point

Level: beginner

See also: PetscDraw, PetscDrawPoint(), PetscDrawPointSetSize()

External Links

source
PETSc.LibPETSc.PetscDrawPointSetSize — Method
PetscDrawPointSetSize(petsclib::PetscLibType, draw::PetscDraw, width::PetscReal)

Sets the point size for future draws. The size is relative to the user coordinates of the window; 0.0 denotes the natural width, 1.0 denotes the entire viewport.

Not Collective

Input Parameters:

  • draw - the drawing context
  • width - the width in user coordinates

Level: advanced

See also: PetscDraw, PetscDrawPoint(), PetscDrawMarker()

External Links

source
PETSc.LibPETSc.PetscDrawPopCurrentPoint — Method
PetscDrawPopCurrentPoint(petsclib::PetscLibType, draw::PetscDraw)

Pops a current draw point (discarding it)

Not Collective

Input Parameter:

  • draw - the drawing context

Level: intermediate

See also: PetscDraw, PetscDrawPushCurrentPoint(), PetscDrawSetCurrentPoint(), PetscDrawGetCurrentPoint()

External Links

source
PETSc.LibPETSc.PetscDrawPushCurrentPoint — Method
PetscDrawPushCurrentPoint(petsclib::PetscLibType, draw::PetscDraw, x::PetscReal, y::PetscReal)

Pushes a new current draw point, retaining the old one, some codes use this point to determine where to draw next

Not Collective

Input Parameters:

  • draw - the drawing context
  • x - horizontal coordinate of the current point
  • y - vertical coordinate of the current point

Level: intermediate

See also: PetscDraw, PetscDrawPopCurrentPoint(), PetscDrawGetCurrentPoint()

External Links

source
PETSc.LibPETSc.PetscDrawRectangle — Method
PetscDrawRectangle(petsclib::PetscLibType, draw::PetscDraw, xl::PetscReal, yl::PetscReal, xr::PetscReal, yr::PetscReal, c1::Cint, c2::Cint, c3::Cint, c4::Cint)

draws a rectangle onto a PetscDraw object

Not Collective

Input Parameters:

  • draw - the drawing context
  • xl - coordinates of the lower left corner
  • yl - coordinates of the lower left corner
  • xr - coordinate of the upper right corner
  • yr - coordinate of the upper right corner
  • c1 - the color of the first corner
  • c2 - the color of the second corner
  • c3 - the color of the third corner
  • c4 - the color of the fourth corner

Level: beginner

See also: PetscDraw, PetscDrawLine(), PetscDrawTriangle(), PetscDrawEllipse(), PetscDrawMarker(), PetscDrawPoint(), PetscDrawString(), PetscDrawArrow()

External Links

source
PETSc.LibPETSc.PetscDrawRegister — Method
PetscDrawRegister(petsclib::PetscLibType, sname::String, fnc::external)

Adds a method to the graphics package.

Not Collective, No Fortran Support

Input Parameters:

  • sname - name of a new user-defined graphics class
  • function - routine to create method context

Level: developer

See also: PetscDraw, PetscDrawRegisterAll(), PetscDrawRegisterDestroy(), PetscDrawType, PetscDrawSetType()

External Links

source
PETSc.LibPETSc.PetscDrawResizeWindow — Method
PetscDrawResizeWindow(petsclib::PetscLibType, draw::PetscDraw, w::Cint, h::Cint)

Allows one to resize a window from a program.

Collective

Input Parameters:

  • draw - the window
  • w - the new width of the window
  • h - the new height of the window

Level: intermediate

See also: PetscDraw, PetscDrawCheckResizedWindow()

External Links

source
PETSc.LibPETSc.PetscDrawRestoreSingleton — Method
PetscDrawRestoreSingleton(petsclib::PetscLibType, draw::PetscDraw, sdraw::PetscDraw)

Remove access to a PetscDraw object obtained with PetscDrawGetSingleton() by the one process.

Collective

Input Parameters:

  • draw - the original window
  • sdraw - the singleton window

Level: advanced

See also: PetscDraw, PetscDrawGetSingleton(), PetscViewerGetSingleton(), PetscViewerRestoreSingleton()

External Links

source
PETSc.LibPETSc.PetscDrawSPAddPoint — Method
x::PetscReal,y::PetscReal = PetscDrawSPAddPoint(petsclib::PetscLibType, sp::PetscDrawSP)

Adds another point to each of the scatter plot point curves.

Not Collective

Input Parameters:

  • sp - the scatter plot data structure
  • x - the x coordinate values (of length dim) for the points of the curve
  • y - the y coordinate values (of length dim) for the points of the curve

Level: intermediate

See also: PetscDrawSPAddPoints(), PetscDrawSP, PetscDrawSPCreate(), PetscDrawSPReset(), PetscDrawSPDraw(), PetscDrawSPAddPointColorized()

External Links

source
PETSc.LibPETSc.PetscDrawSPAddPointColorized — Method
x::PetscReal,y::PetscReal,z::PetscReal = PetscDrawSPAddPointColorized(petsclib::PetscLibType, sp::PetscDrawSP)

Adds another point to each of the scatter plots as well as a numeric value to be used to colorize the scatter point.

Not Collective

Input Parameters:

  • sp - the scatter plot data structure
  • x - array of length dim containing the new x coordinate values for each of the point curves.
  • y - array of length dim containing the new y coordinate values for each of the point curves.
  • z - array of length dim containing the numeric values that will be mapped to [0,255] and used for scatter point colors.

Level: intermediate

See also: PetscDrawSPAddPoints(), PetscDrawSP, PetscDrawSPCreate(), PetscDrawSPReset(), PetscDrawSPDraw(), PetscDrawSPAddPoint()

External Links

source
PETSc.LibPETSc.PetscDrawSPAddPoints — Method
PetscDrawSPAddPoints(petsclib::PetscLibType, sp::PetscDrawSP, n::Cint, xx::Union{Ptr, AbstractArray{PetscReal}}, yy::Union{Ptr, AbstractArray{PetscReal}})

Adds several points to each of the scatter plot point curves.

Not Collective

Input Parameters:

  • sp - the scatter plot context
  • xx - array of pointers that point to arrays containing the new x coordinates for each curve.
  • yy - array of pointers that point to arrays containing the new y points for each curve.
  • n - number of points being added, each represents a subarray of length dim where dim is the value from PetscDrawSPGetDimension()

Level: intermediate

See also: PetscDrawSPAddPoint(), PetscDrawSP, PetscDrawSPCreate(), PetscDrawSPReset(), PetscDrawSPDraw(), PetscDrawSPAddPointColorized()

External Links

source
PETSc.LibPETSc.PetscDrawSPCreate — Method
drawsp::PetscDrawSP = PetscDrawSPCreate(petsclib::PetscLibType, draw::PetscDraw, dim::Cint)

Creates a scatter plot data structure.

Collective

Input Parameters:

  • draw - the window where the graph will be made.
  • dim - the number of sets of points which will be drawn

Output Parameter:

  • drawsp - the scatter plot context

Level: intermediate

See also: PetscDrawLGCreate(), PetscDrawLG, PetscDrawBarCreate(), PetscDrawBar, PetscDrawHGCreate(), PetscDrawHG, PetscDrawSPDestroy(), PetscDraw, PetscDrawSP, PetscDrawSPSetDimension(), PetscDrawSPReset(), PetscDrawSPAddPoint(), PetscDrawSPAddPoints(), PetscDrawSPDraw(), PetscDrawSPSave(), PetscDrawSPSetLimits(), PetscDrawSPGetAxis(), PetscDrawAxis, PetscDrawSPGetDraw()

External Links

source
PETSc.LibPETSc.PetscDrawSPDestroy — Method
PetscDrawSPDestroy(petsclib::PetscLibType, sp::Union{PetscDrawSP, Ref{PetscDrawSP}})

Frees all space taken up by scatter plot data structure.

Collective

Input Parameter:

  • sp - the scatter plot context

Level: intermediate

See also: PetscDrawSPCreate(), PetscDrawSP, PetscDrawSPReset()

External Links

source
PETSc.LibPETSc.PetscDrawSPDraw — Method
PetscDrawSPDraw(petsclib::PetscLibType, sp::PetscDrawSP, clear::PetscBool)

Redraws a scatter plot.

Collective

Input Parameters:

  • sp - the scatter plot context
  • clear - clear the window before drawing the new plot

Level: intermediate

See also: PetscDrawLGDraw(), PetscDrawLGSPDraw(), PetscDrawSP, PetscDrawSPCreate(), PetscDrawSPReset(), PetscDrawSPAddPoint(), PetscDrawSPAddPoints()

External Links

source
PETSc.LibPETSc.PetscDrawSPGetAxis — Method
axis::PetscDrawAxis = PetscDrawSPGetAxis(petsclib::PetscLibType, sp::PetscDrawSP)

Gets the axis context associated with a scatter plot

Not Collective

Input Parameter:

  • sp - the scatter plot context

Output Parameter:

  • axis - the axis context

Level: intermediate

See also: PetscDrawSP, PetscDrawSPCreate(), PetscDrawSPDraw(), PetscDrawSPAddPoint(), PetscDrawSPAddPoints(), PetscDrawAxis, PetscDrawAxisCreate()

External Links

source
PETSc.LibPETSc.PetscDrawSPGetDimension — Method
dim::Cint = PetscDrawSPGetDimension(petsclib::PetscLibType, sp::PetscDrawSP)

Get the number of sets of points that are to be drawn at each PetscDrawSPAddPoint()

Not Collective

Input Parameter:

  • sp - the scatter plot context.

Output Parameter:

  • dim - the number of point curves on this process

Level: intermediate

See also: PetscDrawSP, PetscDrawSPCreate(), PetscDrawSPAddPoint(), PetscDrawSPAddPoints()

External Links

source
PETSc.LibPETSc.PetscDrawSPGetDraw — Method
draw::PetscDraw = PetscDrawSPGetDraw(petsclib::PetscLibType, sp::PetscDrawSP)

Gets the draw context associated with a scatter plot

Not Collective

Input Parameter:

  • sp - the scatter plot context

Output Parameter:

  • draw - the draw context

Level: intermediate

See also: PetscDrawSP, PetscDrawSPCreate(), PetscDrawSPDraw(), PetscDraw

External Links

source
PETSc.LibPETSc.PetscDrawSPReset — Method
PetscDrawSPReset(petsclib::PetscLibType, sp::PetscDrawSP)

Clears scatter plot to allow for reuse with new data.

Not Collective

Input Parameter:

  • sp - the scatter plot context.

Level: intermediate

See also: PetscDrawSP, PetscDrawSPCreate(), PetscDrawSPAddPoint(), PetscDrawSPAddPoints(), PetscDrawSPDraw()

External Links

source
PETSc.LibPETSc.PetscDrawSPSave — Method
PetscDrawSPSave(petsclib::PetscLibType, sp::PetscDrawSP)

Saves a drawn image

Collective

Input Parameter:

  • sp - the scatter plot context

Level: intermediate

See also: PetscDrawSPCreate(), PetscDrawSPGetDraw(), PetscDrawSetSave(), PetscDrawSave()

External Links

source
PETSc.LibPETSc.PetscDrawSPSetDimension — Method
PetscDrawSPSetDimension(petsclib::PetscLibType, sp::PetscDrawSP, dim::Cint)

Change the number of points that are added at each PetscDrawSPAddPoint()

Not Collective

Input Parameters:

  • sp - the scatter plot context.
  • dim - the number of point curves on this process

Level: intermediate

See also: PetscDrawSP, PetscDrawSPCreate(), PetscDrawSPAddPoint(), PetscDrawSPAddPoints()

External Links

source
PETSc.LibPETSc.PetscDrawSPSetLimits — Method
PetscDrawSPSetLimits(petsclib::PetscLibType, sp::PetscDrawSP, x_min::PetscReal, x_max::PetscReal, y_min::PetscReal, y_max::PetscReal)

Sets the axis limits for a scatter plot. If more points are added after this call, the limits will be adjusted to include those additional points.

Not Collective

Input Parameters:

  • sp - the line graph context
  • x_min - the horizontal lower limit
  • x_max - the horizontal upper limit
  • y_min - the vertical lower limit
  • y_max - the vertical upper limit

Level: intermediate

See also: PetscDrawSP, PetscDrawAxis, PetscDrawSPCreate(), PetscDrawSPDraw(), PetscDrawSPAddPoint(), PetscDrawSPAddPoints(), PetscDrawSPGetAxis()

External Links

source
PETSc.LibPETSc.PetscDrawSave — Method
PetscDrawSave(petsclib::PetscLibType, draw::PetscDraw)

Saves a drawn image

Collective

Input Parameter:

  • draw - the drawing context

Level: advanced

See also: PetscDraw, PetscDrawSetSave()

External Links

source
PETSc.LibPETSc.PetscDrawSaveMovie — Method
PetscDrawSaveMovie(petsclib::PetscLibType, draw::PetscDraw)

Saves a movie from previously saved images

Collective

Input Parameter:

  • draw - the drawing context

Level: advanced

See also: PetscDraw, PetscDrawSetSave(), PetscDrawSetSaveMovie()

External Links

source
PETSc.LibPETSc.PetscDrawScalePopup — Method
PetscDrawScalePopup(petsclib::PetscLibType, popup::PetscDraw, min::PetscReal, max::PetscReal)

draws a contour scale window.

Collective

Input Parameters:

  • popup - the window (often a window obtained via PetscDrawGetPopup()
  • min - minimum value being plotted
  • max - maximum value being plotted

Level: intermediate

See also: PetscDraw, PetscDrawGetPopup(), PetscDrawTensorContour()

External Links

source
PETSc.LibPETSc.PetscDrawSetCoordinates — Method
PetscDrawSetCoordinates(petsclib::PetscLibType, draw::PetscDraw, xl::PetscReal, yl::PetscReal, xr::PetscReal, yr::PetscReal)

Sets the application coordinates of the corners of the window (or page).

Not Collective

Input Parameters:

  • draw - the drawing object
  • xl - the lower left x coordinate
  • yl - the lower left y coordinate
  • xr - the upper right x coordinate
  • yr - the upper right y coordinate

Level: advanced

See also: PetscDraw, PetscDrawGetCoordinates()

External Links

source
PETSc.LibPETSc.PetscDrawSetCurrentPoint — Method
PetscDrawSetCurrentPoint(petsclib::PetscLibType, draw::PetscDraw, x::PetscReal, y::PetscReal)

Sets the current draw point, some codes use this point to determine where to draw next

Not Collective

Input Parameters:

  • draw - the drawing context
  • x - horizontal coordinate of the current point
  • y - vertical coordinate of the current point

Level: intermediate

See also: PetscDraw, PetscDrawPushCurrentPoint(), PetscDrawPopCurrentPoint(), PetscDrawGetCurrentPoint()

External Links

source
PETSc.LibPETSc.PetscDrawSetDisplay — Method
PetscDrawSetDisplay(petsclib::PetscLibType, draw::PetscDraw, display::String)

Sets the display where a PetscDraw object will be displayed

Input Parameters:

  • draw - the drawing context
  • display - the X windows display

Level: advanced

See also: PetscDraw, PetscDrawOpenX(), PetscDrawCreate()

External Links

source
PETSc.LibPETSc.PetscDrawSetFromOptions — Method
PetscDrawSetFromOptions(petsclib::PetscLibType, draw::PetscDraw)

Sets the graphics type from the options database. Defaults to a PETSc X Windows graphics.

Collective

Input Parameter:

  • draw - the graphics context

Options Database Keys:

  • -nox - do not use X graphics (ignore graphics calls, but run program correctly)
  • -nox_warning - when X Windows support is not installed this prevents the warning message from being printed
  • -draw_pause seconds - -1 indicates wait for mouse input, -2 indicates pause when window is to be destroyed
  • -draw_marker_type (x|point) - set the marker type
  • -draw_save [filename] - (X Windows only) saves each image before it is cleared to a file
  • -draw_save_final_image [filename] - (X Windows only) saves the final image displayed in a window
  • -draw_save_movie - converts image files to a movie at the end of the run. See PetscDrawSetSave()
  • -draw_save_single_file - saves each new image in the same file, normally each new image is saved in a new file with 'filename/filename_%d.ext'
  • -draw_save_on_clear - saves an image on each clear, mainly for debugging
  • -draw_save_on_flush - saves an image on each flush, mainly for debugging

Level: intermediate

See also: PetscDraw, PetscDrawCreate(), PetscDrawSetType(), PetscDrawSetSave(), PetscDrawSetSaveFinalImage(), PetscDrawPause(), PetscDrawSetPause()

External Links

source
PETSc.LibPETSc.PetscDrawSetMarkerType — Method
PetscDrawSetMarkerType(petsclib::PetscLibType, draw::PetscDraw, mtype::PetscDrawMarkerType)

sets the type of marker to display with PetscDrawMarker()

Not Collective

Input Parameters:

  • draw - the drawing context
  • mtype - either PETSC_DRAW_MARKER_CROSS (default) or PETSC_DRAW_MARKER_POINT

Options Database Key:

  • -draw_marker_type - x or point

Level: beginner

See also: PetscDraw, PetscDrawPoint(), PetscDrawMarker(), PetscDrawGetMarkerType(), PetscDrawMarkerType

External Links

source
PETSc.LibPETSc.PetscDrawSetOptionsPrefix — Method
PetscDrawSetOptionsPrefix(petsclib::PetscLibType, draw::PetscDraw, prefix::String)

Sets the prefix used for searching for all PetscDraw options in the database.

Logically Collective

Input Parameters:

  • draw - the draw context
  • prefix - the prefix to prepend to all option names

Level: advanced

See also: PetscDraw, PetscDrawSetFromOptions(), PetscDrawCreate()

External Links

source
PETSc.LibPETSc.PetscDrawSetPause — Method
PetscDrawSetPause(petsclib::PetscLibType, draw::PetscDraw, lpause::PetscReal)

Sets the amount of time that program pauses after a PetscDrawPause() is called.

Logically Collective

Input Parameters:

  • draw - the drawing object
  • lpause - number of seconds to pause, -1 implies until user input, -2 pauses only on the PetscDrawDestroy()

Options Database Key:

  • -draw_pause value - set the time to pause

Level: intermediate

See also: PetscDraw, PetscDrawGetPause(), PetscDrawPause()

External Links

source
PETSc.LibPETSc.PetscDrawSetSave — Method
PetscDrawSetSave(petsclib::PetscLibType, draw::PetscDraw, filename::String)

Saves images produced in a PetscDraw into a file

Collective

Input Parameters:

  • draw - the graphics context
  • filename - name of the file, if .ext then uses name of draw object plus .ext using .ext to determine the image type

Options Database Keys:

  • -draw_save filename filename - filename could be name.ext or .ext (where .ext determines the type of graphics file to save, for example .png)
  • -draw_save_final_image [filename] - saves the final image displayed in a window
  • -draw_save_single_file - saves each new image in the same file, normally each new image is saved in a new file with filename/filename_%d.ext

Level: intermediate

See also: PetscDraw, PetscDrawOpenX(), PetscDrawOpenImage(), PetscDrawSetFromOptions(), PetscDrawCreate(), PetscDrawDestroy(), PetscDrawSetSaveFinalImage()

External Links

source
PETSc.LibPETSc.PetscDrawSetSaveFinalImage — Method
PetscDrawSetSaveFinalImage(petsclib::PetscLibType, draw::PetscDraw, filename::String)

Saves the final image produced in a PetscDraw into a file

Collective

Input Parameters:

  • draw - the graphics context
  • filename - name of the file, if NULL or empty uses name set with PetscDrawSetSave() or the name of the draw object

Options Database Key:

  • -draw_save_final_image filename - filename could be name.ext or .ext (where .ext determines the type of graphics file to save, for example .png)

Level: intermediate

See also: PetscDraw, PetscDrawSetSave(), PetscDrawSetFromOptions(), PetscDrawCreate(), PetscDrawDestroy()

External Links

source
PETSc.LibPETSc.PetscDrawSetSaveMovie — Method
PetscDrawSetSaveMovie(petsclib::PetscLibType, draw::PetscDraw, movieext::String)

Saves a movie produced from a PetscDraw into a file

Collective

Input Parameters:

  • draw - the graphics context
  • movieext - optional extension defining the movie format

Options Database Key:

  • -draw_save_movie .ext - saves a movie with extension .ext

Level: intermediate

See also: PetscDraw, PetscDrawSetSave(), PetscDrawSetFromOptions(), PetscDrawCreate(), PetscDrawDestroy()

External Links

source
PETSc.LibPETSc.PetscDrawSetTitle — Method
PetscDrawSetTitle(petsclib::PetscLibType, draw::PetscDraw, title::String)

Sets the title of a PetscDraw context.

Collective

Input Parameters:

  • draw - the graphics context
  • title - the title

Level: intermediate

See also: PetscDraw, PetscDrawGetTitle(), PetscDrawAppendTitle()

External Links

source
PETSc.LibPETSc.PetscDrawSetType — Method
PetscDrawSetType(petsclib::PetscLibType, draw::PetscDraw, type::String)

Builds graphics object for a particular implementation

Collective

Input Parameters:

  • draw - the graphics context
  • type - for example, PETSC_DRAW_X

Options Database Key:

  • -draw_type (x|null|win32|tikz|image) - Sets the type; see PetscDrawType

Level: intermediate

See also: PetscDraw, PETSC_DRAW_X, PETSC_DRAW_TIKZ, PETSC_DRAW_IMAGE, PetscDrawSetFromOptions(), PetscDrawCreate(), PetscDrawDestroy(), PetscDrawType

External Links

source
PETSc.LibPETSc.PetscDrawSetViewPort — Method
PetscDrawSetViewPort(petsclib::PetscLibType, draw::PetscDraw, xl::PetscReal, yl::PetscReal, xr::PetscReal, yr::PetscReal)

Sets the portion of the window (page) to which draw routines will write.

Collective

Input Parameters:

  • xl - the horizontal coordinate of the lower left corner of the subwindow.
  • yl - the vertical coordinate of the lower left corner of the subwindow.
  • xr - the horizontal coordinate of the upper right corner of the subwindow.
  • yr - the vertical coordinate of the upper right corner of the subwindow.
  • draw - the drawing context

Level: advanced

See also: PetscDrawGetViewPort(), PetscDraw, PetscDrawSplitViewPort(), PetscDrawViewPortsCreate()

External Links

source
PETSc.LibPETSc.PetscDrawSetVisible — Method
PetscDrawSetVisible(petsclib::PetscLibType, draw::PetscDraw, visible::PetscBool)

Sets if the drawing surface (the 'window') is visible on its display.

Input Parameters:

  • draw - the drawing window
  • visible - if the surface should be visible

Level: intermediate

See also: PetscDraw

External Links

source
PETSc.LibPETSc.PetscDrawSplitViewPort — Method
PetscDrawSplitViewPort(petsclib::PetscLibType, draw::PetscDraw)

Splits a window shared by several processes into smaller view ports. One for each process.

Collective

Input Parameter:

  • draw - the drawing context

Level: advanced

See also: PetscDrawDivideViewPort(), PetscDrawSetViewPort()

External Links

source
PETSc.LibPETSc.PetscDrawString — Method
PetscDrawString(petsclib::PetscLibType, draw::PetscDraw, xl::PetscReal, yl::PetscReal, cl::Cint, text::String)

draws text onto a drawable.

Not Collective

Input Parameters:

  • draw - the drawing context
  • xl - coordinate of lower left corner of text
  • yl - coordinate of lower left corner of text
  • cl - the color of the text
  • text - the text to draw

Level: beginner

See also: PetscDraw, PetscDrawStringVertical(), PetscDrawStringCentered(), PetscDrawStringBoxed(), PetscDrawStringSetSize(), PetscDrawStringGetSize(), PetscDrawLine(), PetscDrawRectangle(), PetscDrawTriangle(), PetscDrawEllipse(), PetscDrawMarker(), PetscDrawPoint()

External Links

source
PETSc.LibPETSc.PetscDrawStringBoxed — Method
w::PetscReal,h::PetscReal = PetscDrawStringBoxed(petsclib::PetscLibType, draw::PetscDraw, sxl::PetscReal, syl::PetscReal, sc::Cint, bc::Cint, text::String)

Draws a string with a box around it

Not Collective

Input Parameters:

  • draw - the drawing context
  • sxl - the coordinates of center of the box
  • syl - the coordinates of top line of box
  • sc - the color of the text
  • bc - the color of the bounding box
  • text - the text to draw

Output Parameters:

  • w - the width of the resulting box (optional)
  • h - the height of resulting box (optional)

Level: beginner

See also: PetscDraw, PetscDrawStringVertical(), PetscDrawString(), PetscDrawStringCentered(), PetscDrawStringSetSize(), PetscDrawStringGetSize()

External Links

source
PETSc.LibPETSc.PetscDrawStringCentered — Method
PetscDrawStringCentered(petsclib::PetscLibType, draw::PetscDraw, xc::PetscReal, yl::PetscReal, cl::Cint, text::String)

draws text onto a drawable centered at a point

Not Collective

Input Parameters:

  • draw - the drawing context
  • xc - the coordinates of right-left center of text
  • yl - the coordinates of lower edge of text
  • cl - the color of the text
  • text - the text to draw

Level: beginner

See also: PetscDraw, PetscDrawStringVertical(), PetscDrawString(), PetscDrawStringBoxed(), PetscDrawStringSetSize(), PetscDrawStringGetSize()

External Links

source
PETSc.LibPETSc.PetscDrawStringGetSize — Method
width::PetscReal,height::PetscReal = PetscDrawStringGetSize(petsclib::PetscLibType, draw::PetscDraw)

Gets the size for character text. The width is relative to the user coordinates of the window.

Not Collective

Input Parameters:

  • draw - the drawing context
  • width - the width in user coordinates
  • height - the character height

Level: advanced

See also: PetscDraw, PetscDrawStringVertical(), PetscDrawString(), PetscDrawStringCentered(), PetscDrawStringBoxed(), PetscDrawStringSetSize()

External Links

source
PETSc.LibPETSc.PetscDrawStringSetSize — Method
PetscDrawStringSetSize(petsclib::PetscLibType, draw::PetscDraw, width::PetscReal, height::PetscReal)

Sets the size for character text.

Not Collective

Input Parameters:

  • draw - the drawing context
  • width - the width in user coordinates
  • height - the character height in user coordinates

Level: advanced

See also: PetscDraw, PetscDrawStringVertical(), PetscDrawString(), PetscDrawStringCentered(), PetscDrawStringBoxed(), PetscDrawStringGetSize()

External Links

source
PETSc.LibPETSc.PetscDrawStringVertical — Method
PetscDrawStringVertical(petsclib::PetscLibType, draw::PetscDraw, xl::PetscReal, yl::PetscReal, cl::Cint, text::String)

draws text onto a drawable.

Not Collective

Input Parameters:

  • draw - the drawing context
  • xl - coordinate of upper left corner of text
  • yl - coordinate of upper left corner of text
  • cl - the color of the text
  • text - the text to draw

Level: beginner

See also: PetscDraw, PetscDrawString(), PetscDrawStringCentered(), PetscDrawStringBoxed(), PetscDrawStringSetSize(), PetscDrawStringGetSize()

External Links

source
PETSc.LibPETSc.PetscDrawTensorContour — Method
PetscDrawTensorContour(petsclib::PetscLibType, draw::PetscDraw, m::Cint, n::Cint, xi::Vector{PetscReal}, yi::Vector{PetscReal}, v::Vector{PetscReal})

draws a contour plot for a two-dimensional array

Collective, but draw must be sequential

Input Parameters:

  • draw - the draw context
  • m - the number of local mesh points in the x direction
  • n - the number of local mesh points in the y direction
  • xi - the locations of the global mesh points in the horizontal direction (optional, use NULL to indicate uniform spacing on [0,1])
  • yi - the locations of the global mesh points in the vertical direction (optional, use NULL to indicate uniform spacing on [0,1])
  • v - the values

Options Database Keys:

  • -draw_x_shared_colormap - Indicates use of private colormap
  • -draw_contour_grid - draws grid contour

Level: intermediate

See also: PetscDraw, PetscDrawTensorContourPatch(), PetscDrawScalePopup()

External Links

source
PETSc.LibPETSc.PetscDrawTensorContourPatch — Method
x::PetscReal,y::PetscReal,v::PetscReal = PetscDrawTensorContourPatch(petsclib::PetscLibType, draw::PetscDraw, m::Cint, n::Cint, min::PetscReal, max::PetscReal)

draws a rectangular patch of a contour plot for a two-dimensional array.

Not Collective

Input Parameters:

  • draw - the draw context
  • m - the number of local mesh points in the x direction
  • n - the number of local mesh points in the y direction
  • x - the horizontal locations of the local mesh points
  • y - the vertical locations of the local mesh points
  • min - the minimum value in the entire contour
  • max - the maximum value in the entire contour
  • v - the data

Options Database Key:

  • -draw_x_shared_colormap - Activates private colormap

Level: advanced

See also: PetscDraw, PetscDrawTensorContour()

External Links

source
PETSc.LibPETSc.PetscDrawTriangle — Method
PetscDrawTriangle(petsclib::PetscLibType, draw::PetscDraw, x1::PetscReal, y_1::PetscReal, x2::PetscReal, y2::PetscReal, x3::PetscReal, y3::PetscReal, c1::Cint, c2::Cint, c3::Cint)

draws a triangle onto a drawable.

Not Collective

Input Parameters:

  • draw - the drawing context
  • x1 - coordinate of the first vertex
  • y_1 - coordinate of the first vertex
  • x2 - coordinate of the second vertex
  • y2 - coordinate of the second vertex
  • x3 - coordinate of the third vertex
  • y3 - coordinate of the third vertex
  • c1 - color of the first vertex
  • c2 - color of the second vertex
  • c3 - color of the third vertext

Level: beginner

See also: PetscDraw, PetscDrawLine(), PetscDrawRectangle(), PetscDrawEllipse(), PetscDrawMarker(), PetscDrawPoint(), PetscDrawArrow()

External Links

source
PETSc.LibPETSc.PetscDrawUtilitySetCmap — Method
PetscDrawUtilitySetCmap(petsclib::PetscLibType, colormap::String, mapsize::Cint, char::Vector{Cuchar}, M_char::Vector{Cuchar}, M_char_2::Vector{Cuchar})

Populate the RGB entries of a colormap from a named palette, honoring options-database overrides for the colormap name, reversal, and brightness.

Not Collective

Input Parameters:

  • colormap - the name of the colormap (e.g. "hue", "gray", "jet", "viridis"), or NULL/empty for the default
  • mapsize - the number of colormap entries to fill

Output Parameters:

  • R - the red channel of length mapsize
  • G - the green channel of length mapsize
  • B - the blue channel of length mapsize

Options Database Keys:

  • -draw_cmap name - select the colormap by name
  • -draw_cmap_reverse - reverse the colormap
  • -draw_cmap_brighten value - brighten (positive) or darken (negative) the colormap; value must be in (-1, 1)

Level: developer

See also: PetscDraw, PetscDrawUtilitySetGamma()

External Links

source
PETSc.LibPETSc.PetscDrawUtilitySetGamma — Method
PetscDrawUtilitySetGamma(petsclib::PetscLibType, g::PetscReal)

Set the monitor gamma-correction value used by the drawing colormap utilities.

Not Collective

Input Parameter:

  • g - the gamma value; a typical value is 2.0

Level: developer

See also: PetscDraw, PetscDrawUtilitySetCmap()

External Links

source
PETSc.LibPETSc.PetscDrawView — Method
PetscDrawView(petsclib::PetscLibType, indraw::PetscDraw, viewer::PetscViewer)

Prints the PetscDraw data structure.

Collective

Input Parameters:

  • indraw - the PetscDraw context
  • viewer - visualization context

See PetscDrawSetFromOptions() for options database keys

See also: PetscDraw, PetscViewerASCIIOpen(), PetscViewer

External Links

source
PETSc.LibPETSc.PetscDrawViewFromOptions — Method
PetscDrawViewFromOptions(petsclib::PetscLibType, A::PetscDraw, obj, name::String)

View a PetscDraw from the option database

Collective

Input Parameters:

  • A - the PetscDraw context
  • obj - Optional object
  • name - command line option

Options Database Key:

  • -name [viewertype][:...] - option name and values. See PetscObjectViewFromOptions() for the possible arguments

Level: intermediate

See also: PetscDraw, PetscDrawView, PetscObjectViewFromOptions(), PetscDrawCreate()

External Links

source
PETSc.LibPETSc.PetscDrawViewPortsCreate — Method
newports::Ptr{PetscDrawViewPorts} = PetscDrawViewPortsCreate(petsclib::PetscLibType, draw::PetscDraw, nports::PetscInt)

Splits a window into smaller view ports. Each processor shares all the viewports.

Collective

Input Parameters:

  • draw - the drawing context
  • nports - the number of ports

Output Parameter:

  • newports - a PetscDrawViewPorts context (C structure)

Options Database Key:

  • -draw_ports - display multiple fields in the same window with PetscDrawPorts() instead of in separate windows

Level: advanced

See also: PetscDrawSplitViewPort(), PetscDrawSetViewPort(), PetscDrawViewPortsSet(), PetscDrawViewPortsDestroy()

External Links

source
PETSc.LibPETSc.PetscDrawViewPortsCreateRect — Method
newports::Ptr{PetscDrawViewPorts} = PetscDrawViewPortsCreateRect(petsclib::PetscLibType, draw::PetscDraw, nx::PetscInt, ny::PetscInt)

Splits a window into smaller view ports. Each processor shares all the viewports. The number of views in the x- and y-directions is specified.

Collective

Input Parameters:

  • draw - the drawing context
  • nx - the number of x divisions
  • ny - the number of y divisions

Output Parameter:

  • newports - a PetscDrawViewPorts context (C structure)

Level: advanced

See also: PetscDrawSplitViewPort(), PetscDrawSetViewPort(), PetscDrawViewPortsSet(), PetscDrawViewPortsDestroy(), PetscDrawViewPorts

External Links

source
PETSc.LibPETSc.PetscDrawViewPortsDestroy — Method
PetscDrawViewPortsDestroy(petsclib::PetscLibType, ports::Vector{PetscDrawViewPorts})

frees a PetscDrawViewPorts object

Collective on the PetscDraw inside ports

Input Parameter:

  • ports - the PetscDrawViewPorts object

Level: advanced

See also: PetscDrawViewPorts, PetscDrawSplitViewPort(), PetscDrawSetViewPort(), PetscDrawViewPortsSet(), PetscDrawViewPortsCreate()

External Links

source
PETSc.LibPETSc.PetscDrawViewPortsSet — Method
PetscDrawViewPortsSet(petsclib::PetscLibType, ports::Vector{PetscDrawViewPorts}, port::PetscInt)

sets a draw object to use a particular subport

Logically Collective on the PetscDraw inside ports

Input Parameters:

  • ports - the PetscDrawViewPorts object
  • port - the port number, from 0 to nports-1

Level: advanced

See also: PetscDrawViewPorts, PetscDrawSplitViewPort(), PetscDrawSetViewPort(), PetscDrawViewPortsDestroy(), PetscDrawViewPortsCreate()

External Links

source
PETSc.LibPETSc.PetscDrawZoom — Method
PetscDrawZoom(petsclib::PetscLibType, draw::PetscDraw, func::external, ctx::Ptr{Cvoid})

Allows one to provide a function that gets called for zooming in on a drawing using the mouse buttons

Collective draw

Input Parameters:

  • draw - the window where the graph will be made.
  • func - users function that draws the graphic
  • ctx - pointer to any application required data

Calling sequence of func:

  • draw - the PetscDraw object to zoom on
  • ctx - the context for the zooming operation

Level: advanced

See also: PetscDraw, PetscDrawCreate()

External Links

source