Created
April 15, 2013 22:27
-
-
Save mdboom/5391801 to your computer and use it in GitHub Desktop.
Test script for vertical text alignment
This file contains hidden or 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
from matplotlib.pyplot import * | |
import matplotlib | |
matplotlib.use("agg") | |
text(0.1, 0.5, "Top Tj", verticalalignment="top") | |
text(0.2, 0.5, "Bottom Tj", verticalalignment="bottom") | |
text(0.3, 0.5, "Base Tj", verticalalignment="baseline") | |
text(0.4, 0.5, "Center Tj", verticalalignment="center") | |
text(0.5, 0.5, "Top Tj", rotation=30, verticalalignment="top") | |
text(0.6, 0.5, "Bottom Tj", rotation=30, verticalalignment="bottom") | |
text(0.7, 0.5, "Base Tj", rotation=30, verticalalignment="baseline") | |
text(0.8, 0.5, "Center Tj", rotation=30, verticalalignment="center") | |
text(0.1, 1.0, r"$\sum_{i=j}$", verticalalignment="top") | |
text(0.2, 1.0, r"$\sum_{i=j}$", verticalalignment="bottom") | |
text(0.3, 1.0, r"$\sum_{i=j}$", verticalalignment="baseline") | |
text(0.4, 1.0, r"$\sum_{i=j}$", verticalalignment="center") | |
text(0.5, 1.0, r"$\sum_{i=j}$", rotation=30, verticalalignment="top") | |
text(0.6, 1.0, r"$\sum_{i=j}$", rotation=30, verticalalignment="bottom") | |
text(0.7, 1.0, r"$\sum_{i=j}$", rotation=30, verticalalignment="baseline") | |
text(0.8, 1.0, r"$\sum_{i=j}$", rotation=30, verticalalignment="center") | |
plot([0, 1], [0.5, 0.5]) | |
plot([0, 1], [1.0, 1.0]) | |
ylim([0, 1.5]) | |
savefig("alignment.png") | |
savefig("alignment.pdf") | |
savefig("alignment.svg") | |
savefig("alignment.ps") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment