Contour ¶
(
- data:
array, - lattice:
Plane, - label:
str, - colorbar_label:
str= None, - isolevels:
bool= False, - show_contour_values:
bool= None, - color_scheme:
str= ‘auto’, - color_limits:
tuple= None, - traces_as_periodic:
bool= False, - supercell:
array= (1, 1), - show_cell:
bool= True, - max_number_arrows:
int= None, - scale_arrows:
float= None
)
Represents data on a 2d slice through the unit cell.
This class creates a visualization of the data within the unit cell based on its configuration. Currently it supports the creation of heatmaps and quiver plots. For heatmaps each data point corresponds to one point on the grid. For quiver plots each data point should be a 2d vector within the plane.
color_limits
tuple = None
Is a tuple that sets the minimum and maximum of the color scale. Can be:
- None | (None, None): No limits are imposed.
- (float, None): Sets the minimum of the color scale.
- (None, float): Sets the maximum of the color scale.
- (float, float): Sets minimum and maximum of the color scale.
color_scheme
str = ‘auto’
The color_scheme argument informs the chosen color map and parameters for the contours plot. It should be chosen according to the nature of the data to be plotted, as one of the following:
- “auto” (Default): py4vasp will try to infer the color scheme on its own.
- “monochrome” OR “stm”: Standard colorscheme for STM.
- “sequential”: Use a sequential color scheme.
- “positive”: Values are only positive. Use a Reds color scheme. Consider setting color_limits=(0, None).
- “diverging”: Use a diverging color scheme.
- “negative”: Values are only negative. Use a reverse Blues color scheme. Consider setting color_limits=(None, 0).
- “cyclical”: Use a cyclical color scheme.
colorbar_label
str = None
data
array
isolevels
bool = False
label
str
lattice
Plane
max_number_arrows
int = None
scale_arrows
float = None
show_cell
bool = True
show_contour_values
bool = None
supercell
array = (1, 1)
to_plotly
traces_as_periodic
bool = False
If True, traces (contour and quiver) are shifted so that quiver and heatmap ‘cell’ centers align with the positions they were computed at. Periodic images will be drawn so that the supercell still appears completely covered on all sides.
If False, traces (contour and quiver) are shifted so that the heatmap cells visually align with the supercell instead. No periodic images are required, but the visual presentation might be misleading.
Graph ¶
(
- series:
Trace, - xlabel:
str= None, - xrange:
tuple= None, - xticks:
dict= None, - xsize:
int= 720, - ylabel:
str= None, - yrange:
tuple= None, - y2label:
str= None, - ysize:
int= 540, - title:
str= None
)
Wraps the functionality to generate graphs of series.
From a single or multiple series a graph is generated based on the optional parameters set in this class.
count
integer -- return number of occurrences of value
index
integer -- return first index of value.
Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
label
str)
Apply a new label to all series within.
If there is only a single series, the label will replace the current one. If there are more than one, the new label will be prefixed to the existing ones.
Parameters
- new_label:
str - The new label added to the series.
series
Trace
show
title
str = None
to_csv
str | Path)
Export graph to a csv file.
Starting from the dataframe generated from to_frame, use the to_csv method implemented in pandas to write out a csv file with a given filename
Parameters
- filename:
str | Path - Name of the exported csv file
to_frame
Dataframe
Convert graph to a pandas dataframe.
Every series will have at least two columns, named after the series name with the suffix x and y. Additionally, if weights are provided, they will also be written out as another column. If a series does not have a name, a name will be generated based on a uuid.
Returns
Dataframe- A pandas dataframe with columns for each series in the graph
to_plotly
xlabel
str = None
xrange
tuple = None
xsize
int = 720
xticks
dict = None
y2label
str = None
ylabel
str = None
yrange
tuple = None
ysize
int = 540
Series ¶
(
- x:
ndarray, - y:
ndarray, - label:
str= None, - weight:
ndarray= None, - weight_mode:
str= ‘size’, - annotations:
dict= None, - y2:
bool= False, - subplot:
int= None, - color:
str= None, - marker:
str= None
)
Represents a single series in a graph.
Typically this corresponds to a single line of x-y data with an optional label used in the legend of the figure. The look of the series is modified by some of the other optional arguments.
annotations
dict = None
color
str = None
label
str = None
marker
str = None
subplot
int = None
to_plotly
weight
ndarray = None
weight_mode
str = ‘size’
x
ndarray
y
ndarray
y2
bool = False