Plots#

Pydidas uses ESRF’s silx toolkit for plotting, with some minor additional functionality. The individual plots are presented below:

Pydidas ImageView#

The PydidasImageView is a subclassed silx ImageView with additional features useful in pydidas.

Its layout is shown below:

../../../_images/standard_imageview.png
  • The menu

    The menu bar allows access to all generic silx and additional pydidas functionality. The detailed menu icons and actions are described below in the menu entries description.

  • The image display

    This plot shows the image data. Depending on the zoom level, this is either the full image or a sub-region.

  • The overview & pan area

    This widget shows the current zoom region with respect to the full image, if the user zoomed in on a subregion. In addition, it allows to pan the image region by dragging the zoom region.

  • The histograms

    The vertical and horizontal histograms display the histograms for the selected image region.

  • The position information

    This widget displays the coordinates and data values of the data under the mouse cursor.

Pydidas 2D plot#

The PydidasPlot2d is a subclassed silx Plot2d with additional features useful in pydidas.

../../../_images/standard_plot2d.png
  • The menu

    The menu bar allows access to all generic silx and additional pydidas functionality. The detailed menu icons and actions are described below in the menu entries description.

  • The image display

    This widget shows the image data. Depending on the zoom level, this is either the full image or a sub-region.

  • The colorbar

    The colorbar shows the reference for the used colormap to map data levels to colors.

  • The position information

    This widget displays the coordinates and data values of the data under the mouse cursor.

Two-dimensional plots are presented in a silx Plot2D widget. The toolbar options will be explained in detail below. Moving the mouse over the canvas will update the labels for x/y position and data value at the bottom of the canvas. Note that the x and y axis positions for each pixel are defined at the pixel center and the given values must be treated carefully with respect to the pixel shape, especially for coarse pixels.

Tip

The scaling of the results can be achieved by modifying the colormap settings.

menu entries description#

menu icon

description

../../../_images/menu_zoom.png

Zoom mode: clicking with the mouse and dragging spans a new selection of the data to be visualized.

../../../_images/menu_pan.png

Panning mode: clicking with the mouse and dragging moves the data on the canvas.

../../../_images/menu_unzoom.png

Unzoom: Reset the display region to the full data.

../../../_images/menu_match_canvas.png

Match canvas: Set the aspect ratio to 1 and match the canvas size to the data to allow a tight fit.

../../../_images/menu_expand_canvas.png

Expand canvas: Reset the canvas size to take up all available space. This option does also change the data aspect to make use of the full canvas.

../../../_images/menu_palette.png

Open the colormap editor. This button opens a window with selections for the colormap and scaling of the displayed minimum and maximum values.

../../../_images/menu_crop_histogram_outliers.png

Crop histogram outliers: Calculate the histogram of the image and set the colormap to ignore the low x% and the top *y% of the image histogram. The levels of x and y can be adjusted in the pydidas user settings.

../../../_images/menu_cmap_autoscale.png

Autoscale the colormap to the image mean value +/- 3 standard deviations.

../../../_images/menu_aspect.png

This action allows to control the aspect of the displayed data and allows to stretch the data to fill the available canvas or keep its original aspect ratio.

../../../_images/menu_orientation.png

Control the position of the origin in the image: Select between the top left and bottom left corner.

../../../_images/menu_colorbar.png

Display or hide the colorbar on the drawing canvas.

../../../_images/menu_mask.png

Mask tools: This button opens an additional widget at the bottom of the canvas with tools for importing or setting a mask to mask certain data regions.

../../../_images/menu_coordinate_system.png

Set coordinate system: This button will open a submenu which allows to select the coordinate system (cartesian or cylindrical). Note that the cylindrical coordinate system use the global DiffractionExperimentContext calibration to determine the beam center. Therefore, looking at data with a different calibration will display a wrong center and therefore also wrong coordinates.

../../../_images/menu_get_data_info.png

Get information for selected datapoint: This button will allow the user to click on a point in the image and show a window with additional information about this point (specifically: all indices / data values).

../../../_images/menu_copy_to_clipboard.png

Copy the currently visible figure to the clipboard. This will only copy the main figure and not the colorbar.

../../../_images/menu_save_to_file.png

Save the currently loaded full data to file, ignoring any zooming. This function will open a dialogue to select the file type and filename. Depending on the selected file type, the colormap and scaling will be retained (e.g. for png export) or ignored (e.g. tiff export).

../../../_images/menu_print.png

Print the currently visible figure. This will print only the data visible on the canvas and it will retain colormap and scaling settings.

../../../_images/menu_profile.png

Create and delete line profiles. This function allows the selection and editing of line profiles. The line profiles are shown in the histograms plots for the vertical and horizontal, respectively.

Pydidas 1D plot#

The PydidasPlot1d is a subclassed silx Plot1d with additional features useful in pydidas.

../../../_images/standard_plot1d.png
  • The menu

    The menu bar allows access to all generic silx and additional pydidas functionality. The detailed menu icons and actions are described below in the menu entries description.

  • The plot display

    This plot shows the data. Depending on the zoom level, this is either the full image or a sub-region.

  • The position information

    This widget displays the coordinates and data values of the data under the mouse cursor.

menu entries description#

menu icon

description

../../../_images/menu_zoom.png

Zoom mode: clicking with the mouse and dragging spans a new selection of the data to be visualized.

../../../_images/menu_pan.png

Panning mode: clicking with the mouse and dragging moves the data on the canvas.

../../../_images/menu_unzoom.png

Unzoom: Reset the display region to the full data.

../../../_images/menu_x_autoscale.png

Activate autoscaling of the x-axis. If enabled, the x-axis will be matched to the data range upon activation or upon using the “Unzoom” button.

../../../_images/menu_y_autoscale.png

Activate autoscaling of the y-axis. If enabled, the y-axis will be matched to the data range upon activation or upon using the “Unzoom” button.

../../../_images/menu_x_log.png

Switch between a linear and a logarithmic x-axis.

../../../_images/menu_y_log.png

Switch between a linear and a logarithmic y-axis.

../../../_images/menu_grid.png

Toggle a grid in the main plotting canvas.

../../../_images/menu_style.png

Change the drawing style. Repeatedly using this button will cycle through lines, dots, and lines & dots styles for the curve.

../../../_images/menu_plot_type_generic.png

Change the plotted data to the generic y vs. x plot without any special operations.

../../../_images/menu_plot_type_kratky.png

Plot data in a Kratky-type plot using y * x^2 vs. x for the y and x-axis, respectively. This plot allows, for example, to correct for the q-dependence of the scattering intensity in small angle scattering.

../../../_images/menu_copy_to_clipboard.png

Copy the currently visible figure to the clipboard.

../../../_images/menu_save_to_file.png

Save the currently loaded full data to file, ignoring any zooming. This function will open a dialogue to select the file type and filename. Depending on the selected file type, the colormap and scaling will be retained (e.g. for png export) or ignored (e.g. tiff export).

../../../_images/menu_print.png

Print the currently visible figure. This will print the current canvas (and therefore only the data visible on the canvas).