forked from 3b1b/manim
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
graph_scene: correct placement of labels (3b1b#661)
* graph_scene: correct placement of labels * Update test reference data * Add test for axes and their labels * black * removing commented lines for generation of reference data Co-authored-by: Leo Torres <dleonardotn@gmail.com> * black * do not shift labels onto screen if user wants the label above the y axis, it should go there, even if there is not enough space. they can still choose another placement * updated test and reference data for test_axes Co-authored-by: Leo Torres <dleonardotn@gmail.com>
- Loading branch information
1 parent
d668fc1
commit e2759ad
Showing
4 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file modified
BIN
+7 Bytes
(100%)
tests/control_data/graphical_units_data/graph/PlotFunctions.npz
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import pytest | ||
|
||
from manim import * | ||
from ..utils.testing_utils import get_scenes_to_test | ||
from ..utils.GraphicalUnitTester import GraphicalUnitTester | ||
|
||
|
||
class AxesTest(GraphScene): | ||
CONFIG = { | ||
"x_min": -5, | ||
"x_max": 5, | ||
"y_min": -3, | ||
"y_max": 3, | ||
"x_axis_config": { | ||
"add_start": 0.5, | ||
"add_end": 0.5, | ||
"include_tip": True, | ||
}, | ||
"y_axis_config": { | ||
"add_start": 0.25, | ||
"add_end": 0.5, | ||
"include_tip": True, | ||
}, | ||
"x_axis_visibility": True, | ||
"y_axis_visibility": True, | ||
"y_label_position": UP, | ||
"x_label_position": RIGHT, | ||
"graph_origin": ORIGIN, | ||
"axes_color": WHITE, | ||
} | ||
|
||
def construct(self): | ||
self.setup_axes(animate=True) | ||
|
||
|
||
MODULE_NAME = "graph" | ||
|
||
|
||
@pytest.mark.slow | ||
@pytest.mark.parametrize("scene_to_test", get_scenes_to_test(__name__), indirect=False) | ||
def test_scene(scene_to_test, tmpdir, show_diff): | ||
GraphicalUnitTester(scene_to_test[1], MODULE_NAME, tmpdir).test(show_diff=show_diff) |