Repository navigation
FIX label vertical alignment can now be specified #8081
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -465,6 +465,11 @@ def validate_font_properties(s): | |
| 'verbose', | ||
| ['silent', 'helpful', 'debug', 'debug-annoying']) | ||
|
|
||
| _validate_alignment = ValidateInStrings( | ||
| 'alignment', | ||
| ['center', 'top', 'bottom', 'baseline', | ||
| 'center_baseline']) | ||
|
|
||
| def validate_whiskers(s): | ||
| if s=='range': | ||
| return 'range' | ||
|
|
@@ -1214,6 +1219,9 @@ def validate_animation_writer_path(p): | |
| # fontsize of the ytick labels | ||
| 'ytick.labelsize': ['medium', validate_fontsize], | ||
| 'ytick.direction': ['out', six.text_type], # direction of yticks | ||
| 'ytick.alignment': ["center_baseline", _validate_alignment], | ||
| 'xtick.alignment': ["center", _validate_alignment], | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should go in the |
||
|
|
||
|
|
||
| 'grid.color': ['#b0b0b0', validate_color], # grid color | ||
| 'grid.linestyle': ['-', six.text_type], # solid | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1143,6 +1143,15 @@ def test_bar_tick_label_multiple(): | |
| ax.bar([1, 2.5], [1, 2], width=[0.2, 0.5], tick_label=['a', 'b'], | ||
| align='center') | ||
|
|
||
| @image_comparison(baseline_images=['bar_tick_label_multiple_old_label_alignment'], | ||
| extensions=['png']) | ||
| def test_bar_tick_label_multiple_old_alignment(): | ||
| # From 2516: plot bar with array of string labels for x axis | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test doesn't really have anything to do with #2516. |
||
| matplotlib.rcParams["ytick.alignment"] = "center" | ||
| ax = plt.gca() | ||
| ax.bar([1, 2.5], [1, 2], width=[0.2, 0.5], tick_label=['a', 'b'], | ||
| align='center') | ||
|
|
||
|
|
||
| @image_comparison(baseline_images=['barh_tick_label'], | ||
| extensions=['png']) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,7 +78,7 @@ def create_figure(): | |
|
|
||
|
|
||
| # test compiling a figure to pdf with xelatex | ||
| @cleanup(style='classic') | ||
| @cleanup(style='_classic_test') | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The tests in this file don't actually use |
||
| @switch_backend('pgf') | ||
| def test_xelatex(): | ||
| if not check_for('xelatex'): | ||
|
|
@@ -92,7 +92,7 @@ def test_xelatex(): | |
|
|
||
|
|
||
| # test compiling a figure to pdf with pdflatex | ||
| @cleanup(style='classic') | ||
| @cleanup(style='_classic_test') | ||
| @switch_backend('pgf') | ||
| def test_pdflatex(): | ||
| if not check_for('pdflatex'): | ||
|
|
@@ -109,7 +109,7 @@ def test_pdflatex(): | |
|
|
||
|
|
||
| # test updating the rc parameters for each figure | ||
| @cleanup(style='classic') | ||
| @cleanup(style='_classic_test') | ||
| @switch_backend('pgf') | ||
| def test_rcupdate(): | ||
| if not check_for('xelatex') or not check_for('pdflatex'): | ||
|
|
@@ -142,7 +142,7 @@ def test_rcupdate(): | |
|
|
||
|
|
||
| # test backend-side clipping, since large numbers are not supported by TeX | ||
| @cleanup(style='classic') | ||
| @cleanup(style='_classic_test') | ||
| @switch_backend('pgf') | ||
| def test_pathclip(): | ||
| if not check_for('xelatex'): | ||
|
|
@@ -161,7 +161,7 @@ def test_pathclip(): | |
|
|
||
|
|
||
| # test mixed mode rendering | ||
| @cleanup(style='classic') | ||
| @cleanup(style='_classic_test') | ||
| @switch_backend('pgf') | ||
| def test_mixedmode(): | ||
| if not check_for('xelatex'): | ||
|
|
@@ -178,7 +178,7 @@ def test_mixedmode(): | |
|
|
||
|
|
||
| # test bbox_inches clipping | ||
| @cleanup(style='classic') | ||
| @cleanup(style='_classic_test') | ||
| @switch_backend('pgf') | ||
| def test_bbox_inches(): | ||
| if not check_for('xelatex'): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't there be
xtick.alignmentadded as well?