himena.standards.plotting
Standard plotting models.
Axes
Layout model for 2D axes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
models
|
list[BasePlotModel]
|
Child plot models. |
<dynamic>
|
title
|
str | StyledText | None
|
Title of the axes. |
None
|
x
|
Axis
|
X-axis settings. |
<dynamic>
|
y
|
Axis
|
Y-axis settings. |
<dynamic>
|
axis_color
|
str
|
Axis color. |
'#000000'
|
legend
|
Legend | None
|
Legend settings for the axes. |
None
|
Source code in src\himena\standards\plotting\layout.py
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 | |
set_legend(location='right_side_top', title=None, font_size=10.0)
Set legend settings for the axes.
Source code in src\himena\standards\plotting\layout.py
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 | |
Axes3D
Layout model for 3D axes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
models
|
list[BasePlotModel]
|
Child plot models. |
<dynamic>
|
title
|
str | StyledText | None
|
Title of the axes. |
None
|
x
|
Axis
|
X-axis settings. |
<dynamic>
|
y
|
Axis
|
Y-axis settings. |
<dynamic>
|
z
|
Axis
|
Z-axis settings. |
<dynamic>
|
Source code in src\himena\standards\plotting\layout3d.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | |
mesh(vertices, face_indices, **kwargs)
Create a 3D mesh plot.
Source code in src\himena\standards\plotting\layout3d.py
66 67 68 69 70 71 72 73 74 75 76 77 | |
plot(x, y, z, **kwargs)
Create a 3D line plot.
Source code in src\himena\standards\plotting\layout3d.py
42 43 44 45 46 47 48 49 50 51 52 | |
scatter(x, y, z, *, symbol='o', size=None, **kwargs)
Create a 3D scatter plot.
Source code in src\himena\standards\plotting\layout3d.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
surface(x, y, z, **kwargs)
Create a 3D surface plot.
Source code in src\himena\standards\plotting\layout3d.py
54 55 56 57 58 59 60 61 62 63 64 | |
Axis
Model that represents a plot axis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lim
|
tuple[float, float] | None
|
Axis limits. |
None
|
scale
|
Literal['linear', 'log']
|
Axis scale. |
'linear'
|
label
|
str | StyledText | None
|
Axis label. |
None
|
ticks
|
AxisTicks | None
|
Axis ticks. |
None
|
grid
|
bool
|
Show grid or not. |
False
|
Source code in src\himena\standards\plotting\components.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | |
set_ticks(positions, labels=None)
Set the ticks of the axis.
Source code in src\himena\standards\plotting\components.py
79 80 81 82 83 84 85 86 87 | |
Band
Plot model for band plot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the plot. |
''
|
x
|
Any
|
X-axis values. |
required |
y0
|
Any
|
Y-axis values of the lower bound. |
required |
y1
|
Any
|
Y-axis values of the upper bound. |
required |
orient
|
Literal['vertical', 'horizontal']
|
Orientation of the band fill. |
'vertical'
|
face
|
Face
|
Properties of the band fill. |
<dynamic>
|
edge
|
Edge
|
Properties of the band edge. |
<dynamic>
|
Source code in src\himena\standards\plotting\models.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
Bar
Plot model for bar plot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the plot. |
''
|
x
|
Any
|
X-axis values. |
required |
y
|
Any
|
Y-axis values. |
required |
bottom
|
float | Any
|
Bottom values of the bars. |
0
|
bar_width
|
float | None
|
Width of the bars. |
None
|
orient
|
Literal['vertical', 'horizontal']
|
Orientation of the bar plots. |
'vertical'
|
face
|
Face
|
Properties of the bars. |
<dynamic>
|
edge
|
Edge
|
Properties of the bars. |
<dynamic>
|
Source code in src\himena\standards\plotting\models.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |
BaseLayoutModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hpad
|
float | None
|
Horizontal padding. |
None
|
vpad
|
float | None
|
Vertical padding. |
None
|
hspace
|
float | None
|
Horizontal space. |
None
|
vspace
|
float | None
|
Vertical space. |
None
|
background_color
|
str
|
Background color. |
'#FFFFFF'
|
Source code in src\himena\standards\plotting\layout.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
show()
Show the layout in the current himena window.
Source code in src\himena\standards\plotting\layout.py
55 56 57 58 59 60 61 | |
BasePlotModel
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the plot. |
''
|
Source code in src\himena\standards\plotting\components.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | |
plot_option_dict()
Return the GUI option dict for this plot for editing.
Source code in src\himena\standards\plotting\components.py
44 45 46 | |
Column
Layout model for column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hpad
|
float | None
|
Horizontal padding. |
None
|
vpad
|
float | None
|
Vertical padding. |
None
|
hspace
|
float | None
|
Horizontal space. |
None
|
vspace
|
float | None
|
Vertical space. |
None
|
background_color
|
str
|
Background color. |
'#FFFFFF'
|
axes
|
list[Axes]
|
Child layouts. |
<dynamic>
|
share_x
|
bool
|
Share x-axis or not. |
False
|
share_y
|
bool
|
Share y-axis or not. |
False
|
Source code in src\himena\standards\plotting\layout.py
516 517 | |
ErrorBar
Plot model for error bar plot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the plot. |
''
|
x
|
Any
|
X-axis values. |
required |
y
|
Any
|
Y-axis values. |
required |
x_error
|
Any | None
|
X-axis error values. |
None
|
y_error
|
Any | None
|
Y-axis error values. |
None
|
capsize
|
float | None
|
Cap size of the error bars. |
None
|
edge
|
Edge
|
Properties of the error bars. |
<dynamic>
|
Source code in src\himena\standards\plotting\models.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | |
Grid
Layout model for grid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hpad
|
float | None
|
Horizontal padding. |
None
|
vpad
|
float | None
|
Vertical padding. |
None
|
hspace
|
float | None
|
Horizontal space. |
None
|
vspace
|
float | None
|
Vertical space. |
None
|
background_color
|
str
|
Background color. |
'#FFFFFF'
|
axes
|
list[list[Axes]]
|
Child layouts. |
<dynamic>
|
Source code in src\himena\standards\plotting\layout.py
520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 | |
Histogram
Plot model for a histogram.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the plot. |
''
|
height
|
Any
|
Count or frequency values. |
required |
bins
|
Any
|
Bin edges. |
required |
orient
|
Literal['vertical', 'horizontal']
|
Orientation of the histogram. |
'vertical'
|
face
|
Face
|
Properties of the histogram face. |
<dynamic>
|
edge
|
Edge
|
Properties of the histogram edge. |
<dynamic>
|
Source code in src\himena\standards\plotting\models.py
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | |
to_band()
Convert the histogram to a band plot.
Source code in src\himena\standards\plotting\models.py
171 172 173 174 175 176 177 178 179 180 181 182 183 184 | |
Legend
Model for plot legend.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
location
|
LegendLocation
|
|
<LegendLocation.RIGHT_SIDE_TOP: 'right_side_top'>
|
font_size
|
float
|
Font size of the legend. |
10.0
|
title
|
str | StyledText | None
|
|
None
|
Source code in src\himena\standards\plotting\components.py
256 257 258 259 260 261 | |
Line
Plot model for line plot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the plot. |
''
|
x
|
Any
|
X-axis values. |
required |
y
|
Any
|
Y-axis values. |
required |
edge
|
Edge
|
Properties of the line. |
<dynamic>
|
marker
|
Scatter | None
|
Marker of the line. |
None
|
Source code in src\himena\standards\plotting\models.py
39 40 41 42 43 44 45 46 47 48 49 50 51 | |
Line3D
Plot model for a 3D line plot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the plot. |
''
|
x
|
Any
|
X-axis values. |
required |
y
|
Any
|
Y-axis values. |
required |
edge
|
Edge
|
Properties of the line. |
<dynamic>
|
marker
|
Scatter | None
|
Marker of the line. |
None
|
z
|
Any
|
Z-axis values. |
required |
Source code in src\himena\standards\plotting\models3d.py
15 16 17 18 | |
Mesh3D
Plot model for a 3D mesh plot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the plot. |
''
|
vertices
|
Any
|
Vertices of the mesh. |
required |
face_indices
|
Any
|
Face indices of the mesh. |
required |
face
|
Face
|
Properties of the faces. |
<dynamic>
|
edge
|
Edge
|
Properties of the edges. |
<dynamic>
|
Source code in src\himena\standards\plotting\models3d.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
Row
Layout model for row.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hpad
|
float | None
|
Horizontal padding. |
None
|
vpad
|
float | None
|
Vertical padding. |
None
|
hspace
|
float | None
|
Horizontal space. |
None
|
vspace
|
float | None
|
Vertical space. |
None
|
background_color
|
str
|
Background color. |
'#FFFFFF'
|
axes
|
list[Axes]
|
Child layouts. |
<dynamic>
|
share_x
|
bool
|
Share x-axis or not. |
False
|
share_y
|
bool
|
Share y-axis or not. |
False
|
Source code in src\himena\standards\plotting\layout.py
512 513 | |
Scatter
Plot model for scatter plot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the plot. |
''
|
x
|
Any
|
X-axis values. |
required |
y
|
Any
|
Y-axis values. |
required |
symbol
|
Any | None
|
Symbol of the markers. |
None
|
size
|
Any | None
|
Size of the markers. |
None
|
face
|
Face
|
Properties of the marker faces. |
<dynamic>
|
edge
|
Edge
|
Properties of the marker edges. |
<dynamic>
|
Source code in src\himena\standards\plotting\models.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |
Scatter3D
Plot model for a 3D scatter plot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the plot. |
''
|
x
|
Any
|
X-axis values. |
required |
y
|
Any
|
Y-axis values. |
required |
symbol
|
Any | None
|
Symbol of the markers. |
None
|
size
|
Any | None
|
Size of the markers. |
None
|
face
|
Face
|
Properties of the marker faces. |
<dynamic>
|
edge
|
Edge
|
Properties of the marker edges. |
<dynamic>
|
z
|
Any
|
Z-axis values. |
required |
Source code in src\himena\standards\plotting\models3d.py
9 10 11 12 | |
SingleAxes
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hpad
|
float | None
|
Horizontal padding. |
None
|
vpad
|
float | None
|
Vertical padding. |
None
|
hspace
|
float | None
|
Horizontal space. |
None
|
vspace
|
float | None
|
Vertical space. |
None
|
background_color
|
str
|
Background color. |
'#FFFFFF'
|
axes
|
Axes
|
Child axes. |
<dynamic>
|
Source code in src\himena\standards\plotting\layout.py
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 | |
axis_color
property
writable
Axis color.
title
property
writable
Title of the central axes.
x
property
X-axis settings.
y
property
Y-axis settings.
band(x, y0, y1=None, *, orient='vertical', **kwargs)
Add a band plot model to the axes.
Source code in src\himena\standards\plotting\layout.py
351 352 353 354 355 356 357 358 359 360 361 | |
bar(x, y=None, *, bottom=None, bar_width=None, orient='vertical', **kwargs)
Add a bar plot model to the axes.
Source code in src\himena\standards\plotting\layout.py
321 322 323 324 325 326 327 328 329 330 331 332 333 334 | |
errorbar(x, y=None, *, x_error=None, y_error=None, capsize=None, **kwargs)
Add an error bar plot model to the axes.
Source code in src\himena\standards\plotting\layout.py
336 337 338 339 340 341 342 343 344 345 346 347 348 349 | |
hist(data, *, bins=10, range=None, orient='vertical', stat='count', **kwargs)
Add a histogram plot model to the axes.
Source code in src\himena\standards\plotting\layout.py
374 375 376 377 378 379 380 381 382 383 384 385 386 387 | |
merge_with(other)
Merge with another SingleAxes layout.
Source code in src\himena\standards\plotting\layout.py
292 293 294 295 296 297 | |
plot(x, y=None, **kwargs)
Add a line plot model to the axes.
Source code in src\himena\standards\plotting\layout.py
312 313 314 315 316 317 318 319 | |
scatter(x, y=None, *, symbol='o', size=None, **kwargs)
Add a scatter plot model to the axes.
Source code in src\himena\standards\plotting\layout.py
300 301 302 303 304 305 306 307 308 309 310 | |
set_legend(location='right_side_top', title=None, font_size=10.0)
Set legend settings for the axes.
Source code in src\himena\standards\plotting\layout.py
281 282 283 284 285 286 287 288 289 290 | |
span(start, end, *, orient='horizontal', **kwargs)
Add a span plot model to the axes.
Source code in src\himena\standards\plotting\layout.py
363 364 365 366 367 368 369 370 371 372 | |
text(x, y, text, *, size=12, color='black', family=None, rotation=0, anchor='center')
Add a text plot model to the axes.
Source code in src\himena\standards\plotting\layout.py
389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 | |
SingleAxes3D
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hpad
|
float | None
|
Horizontal padding. |
None
|
vpad
|
float | None
|
Vertical padding. |
None
|
hspace
|
float | None
|
Horizontal space. |
None
|
vspace
|
float | None
|
Vertical space. |
None
|
background_color
|
str
|
Background color. |
'#FFFFFF'
|
axes
|
Axes3D
|
Child 3D axes. |
<dynamic>
|
Source code in src\himena\standards\plotting\layout3d.py
80 81 | |
SingleStackedAxes
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hpad
|
float | None
|
Horizontal padding. |
None
|
vpad
|
float | None
|
Vertical padding. |
None
|
hspace
|
float | None
|
Horizontal space. |
None
|
vspace
|
float | None
|
Vertical space. |
None
|
background_color
|
str
|
Background color. |
'#FFFFFF'
|
axes
|
StackedAxes
|
Child axes. |
required |
Source code in src\himena\standards\plotting\layout.py
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 | |
axis_color
property
writable
Axis color.
shape
property
Shape of the stack dimensions.
title
property
writable
Title of the central axes.
x
property
X-axis settings.
y
property
Y-axis settings.
Span
Plot model for span plot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the plot. |
''
|
start
|
float
|
Starting value of the lower bound. |
required |
end
|
float
|
Ending value of the upper bound. |
required |
orient
|
Literal['vertical', 'horizontal']
|
Orientation of the span. 'vertical' means the spanis vertically unlimited. |
'vertical'
|
face
|
Face
|
Properties of the span fill. |
<dynamic>
|
edge
|
Edge
|
Properties of the span edge. |
<dynamic>
|
Source code in src\himena\standards\plotting\models.py
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | |
StyledText
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Text content. |
required |
size
|
float | None
|
Font size. |
None
|
color
|
Any | None
|
Font color. |
None
|
family
|
str | None
|
Font family. |
None
|
bold
|
bool
|
Bold style or not. |
False
|
italic
|
bool
|
Italic style or not. |
False
|
underline
|
bool
|
Underline style or not. |
False
|
alignment
|
str | None
|
Text alignment. |
None
|
Source code in src\himena\standards\plotting\components.py
11 12 13 14 15 16 17 18 19 20 21 | |
Surface3D
Plot model for a 3D surface plot.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the plot. |
''
|
x
|
Any
|
X-axis values. |
required |
y
|
Any
|
Y-axis values. |
required |
z
|
Any
|
Z-axis values. |
required |
face
|
Face
|
Properties of the faces. |
<dynamic>
|
edge
|
Edge
|
Properties of the edges. |
<dynamic>
|
Source code in src\himena\standards\plotting\models3d.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | |
Texts
Plot model for texts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of the plot. |
''
|
x
|
Any
|
X-axis values. |
required |
y
|
Any
|
Y-axis values. |
required |
texts
|
Any
|
Texts to be displayed. |
required |
size
|
int
|
Font size of the texts. |
12
|
color
|
str
|
Font color of the texts. |
'black'
|
family
|
str
|
Font family of the texts. |
'Arial'
|
anchor
|
Literal['center', 'left', 'right', 'top', 'bottom', 'top_left', 'top_right', 'bottom_left', 'bottom_right']
|
Anchor position of the texts. 'center' means the center of the text. |
'center'
|
rotation
|
float
|
Rotation angle of the texts. |
0
|
Source code in src\himena\standards\plotting\models.py
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | |
column(num=1, *, background_color='white')
Make a column layout model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num
|
int
|
Number of columns, by default 1 |
1
|
Examples:
from himena.standards import plotting as hplt
col = hplt.column(3)
col[0].plot([0, 1, 2], [4, 2, 3], color="blue")
col.show() # show as a sub-window in the current widget
Source code in src\himena\standards\plotting\_api.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |
figure(background_color='white')
Make a single axes layout model.
Examples:
from himena.standards import plotting as hplt
fig = hplt.figure()
fig.plot([0, 1, 2], [4, 2, 3], color="red")
fig.show() # show as a sub-window in the current widget
Source code in src\himena\standards\plotting\_api.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 | |
figure_3d(background_color='white')
Make a single 3D axes layout model.
Examples:
from himena.standards import plotting as hplt
fig = hplt.figure_3d()
fig.plot([0, 1, 2], [4, 2, 3], [6, 8, 7], color="red")
fig.show() # show as a sub-window in the current widget
Source code in src\himena\standards\plotting\_api.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |
grid(rows=1, cols=1, *, background_color='white')
Make a grid layout model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rows
|
int
|
Number of rows, by default 1 |
1
|
cols
|
int
|
Number of columns, by default 1 |
1
|
Examples:
from himena.standards import plotting as hplt
grd = hplt.grid(2, 3)
grd[0, 0].plot([0, 1, 2], [4, 2, 3], color="green")
grd.show() # show as a sub-window in the current widget
Source code in src\himena\standards\plotting\_api.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | |
row(num=1, *, background_color='white')
Make a row layout model.
Examples:
from himena.standards import plotting as hplt
row = hplt.row(2)
row[0].plot([0, 1, 2], [4, 2, 3], color="red")
row.show() # show as a sub-window in the current widget
Source code in src\himena\standards\plotting\_api.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |