tfl.test_utils.two_dim_mesh_grid
Stay organized with collections
Save and categorize content based on your preferences.
Generates uniform 2-d mesh grid for 3-d surfaces visualisation via pyplot.
tfl.test_utils.two_dim_mesh_grid(
num_points, x_min, y_min, x_max, y_max
)
Uniformly distributes 'num_points' within rectangle:
(x_min, y_min) - (x_max, y_max)
'num_points' should be such that uniform distribution is possible. In other
words there should exist such integers 'x_points' and 'y_points' that:
- x_points * y_points == num_points
- x_points / y_points == (x_max - x_min) / (y_max - y_min)
Args |
num_points
|
number of points in the grid.
|
x_min
|
bounds of the grid.
|
y_min
|
bounds of the grid.
|
x_max
|
bounds of the grid.
|
y_max
|
bounds of the grid.
|
Returns |
Tuple containing 2 numpy arrays which represent X and Y coordinates of mesh
grid
|
Raises |
ValueError
|
if it's impossible to uniformly distribute 'num_points' across
specified grid.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-02 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2024-08-02 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-02 UTC."],[],[]]