Skip to content

Commit c05e8ca

Browse files
authored
Merge pull request #1445 from mathics/polar-doc
Tweak wording and examples on PolarPlot
2 parents 3fb1302 + e886351 commit c05e8ca

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

mathics/builtin/drawing/plot.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -863,8 +863,8 @@ class PieChart(_Chart):
863863
<li>SectorSpacing" (default Automatic)
864864
</ul>
865865
866-
A pie chart for a list of values:
867-
>> PieChart[Range[4]]
866+
A hypothetical comparsion between types of pets owned:
867+
>> PieChart[{30, 20, 10}, ChartLabels -> {Dogs, Cats, Fish}]
868868
= -Graphics-
869869
870870
A doughnut chart for a list of values:
@@ -2196,18 +2196,20 @@ def eval_f(self, f, x_value):
21962196

21972197

21982198
class PolarPlot(_Plot):
2199-
"""
2199+
u"""
22002200
<dl>
2201-
<dt>'PolarPlot[$r$, {$t$, $tmin$, $tmax$}]'
2202-
<dd>creates a polar plot of $r$ with angle $t$ ranging from
2203-
$tmin$ to $tmax$.
2201+
<dt>'PolarPlot[$r$, {$t$, $t_min$, $t_max$}]'
2202+
<dd>creates a polar plot of curve with radius $r$ as a function of angle $t$ ranging from $t_min$ to $t_max$.
22042203
</dl>
22052204
2206-
>> PolarPlot[Cos[5t], {t, 0, Pi}]
2205+
>> PolarPlot[Cos[5\\[Theta]], {\\[Theta], 0, Pi}]
22072206
= -Graphics-
22082207
22092208
>> PolarPlot[{1, 1 + Sin[20 t] / 5}, {t, 0, 2 Pi}]
22102209
= -Graphics-
2210+
2211+
>> PolarPlot[Sqrt[t], {t, 0, 16 Pi}]
2212+
= -Graphics-
22112213
"""
22122214

22132215
options = _Plot.options.copy()

mathics/doc/common_doc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ def repl_list(match):
262262
("\u00e9", r"\'e"),
263263
("\u00ea", r"\^e"),
264264
("\u03b3", r"$\gamma$"),
265+
("\u03b8", r"$\theta$"),
265266
("\u03bc", r"$\mu$"),
266267
("\u03c0", r"$\pi$"),
267268
("\u2107", r"$\mathrm{e}$"),

mathics/docpipeline.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,16 @@ def test_case(test, tests, index=0, subindex=0, quiet=False, section=None):
8585
def fail(why):
8686
part, chapter, section = tests.part, tests.chapter, tests.section
8787
print_and_log(
88-
"%sTest failed: %s in %s / %s\n%s\n%s\n"
89-
% (sep, section, part, chapter, test, why)
90-
)
88+
f"""{sep}Test failed: {section} in {part} / {chapter}
89+
{part}
90+
n{why}
91+
""".encode("utf-8"))
9192
return False
9293

9394
if not quiet:
9495
if section:
95-
print("%s %s / %s %s" % (stars, tests.chapter, section, stars))
96-
print("%4d (%2d): TEST %s" % (index, subindex, test))
96+
print(f"{stars} {tests.chapter} / {section} {stars}".encode("utf-8"))
97+
print(f"{index:4d} ({subindex:2d}): TEST {test}".encode("utf-8"))
9798

9899
feeder = MathicsSingleLineFeeder(test, "<test>")
99100
evaluation = Evaluation(definitions, catch_interrupt=False, output=TestOutput())

0 commit comments

Comments
 (0)