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'
|
Source code in src\himena\standards\plotting\layout.py
221 222 223 224 225 226 |
|
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[str, str]
|
Axis scale. |
'linear'
|
label
|
str | StyledText | None
|
Axis label. |
None
|
ticks
|
Any | None
|
Axis ticks. |
None
|
grid
|
bool
|
Show grid or not. |
False
|
Source code in src\himena\standards\plotting\components.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
|
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[str, str]
|
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
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
|
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[str, str]
|
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
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
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
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 |
|
show()
Show the layout in the current himena window.
Source code in src\himena\standards\plotting\layout.py
52 53 54 55 56 57 58 |
|
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
473 474 |
|
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
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
|
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
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 |
|
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[str, str]
|
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
145 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 |
|
to_band()
Convert the histogram to a band plot.
Source code in src\himena\standards\plotting\models.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
|
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
38 39 40 41 42 43 44 45 46 47 48 49 50 |
|
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
469 470 |
|
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
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
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
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 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 |
|
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
319 320 321 322 323 324 325 326 327 328 329 |
|
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
289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
|
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
304 305 306 307 308 309 310 311 312 313 314 315 316 317 |
|
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
331 332 333 334 335 336 337 338 339 340 341 342 343 344 |
|
merge_with(other)
Merge with another SingleAxes layout.
Source code in src\himena\standards\plotting\layout.py
260 261 262 263 264 265 |
|
plot(x, y=None, **kwargs)
Add a line plot model to the axes.
Source code in src\himena\standards\plotting\layout.py
280 281 282 283 284 285 286 287 |
|
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
268 269 270 271 272 273 274 275 276 277 278 |
|
text(x, y, text, *, size=12, color='black', family='Arial', rotation=0, anchor='center')
Add a text plot model to the axes.
Source code in src\himena\standards\plotting\layout.py
346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 |
|
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
390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 |
|
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[str, str]
|
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
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
|
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[str, str, str, str, str, str, str, str, str]
|
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
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
|
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 |
|