| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -78,8 +78,8 @@ number of other projects: | |||
| 78 | 78 | - `Microsoft DirectWrite`_ | |
| 79 | 79 | - `Apple Core Text`_ | |
| 80 | 80 | ||
| 81 | - .. _pango: https://www.pango.org/ | ||
| 82 | - .. _harfbuzz: https://www.freedesktop.org/wiki/Software/HarfBuzz/ | ||
| 81 | + .. _pango: https://pango.gnome.org | ||
| 82 | + .. _harfbuzz: https://github.com/harfbuzz/harfbuzz | ||
| 83 | 83 | .. _QtTextLayout: https://doc.qt.io/archives/qt-4.8/qtextlayout.html | |
| 84 | 84 | .. _Microsoft DirectWrite: https://docs.microsoft.com/en-ca/windows/win32/directwrite/introducing-directwrite | |
| 85 | 85 | .. _Apple Core Text: https://developer.apple.com/library/archive/documentation/StringsTextFonts/Conceptual/CoreText_Programming/Overview/Overview.html | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,7 +34,7 @@ one has to look at the gallery where one such example is provided: | |||
| 34 | 34 | This example takes a list of strings as well as a list of colors which makes it | |
| 35 | 35 | cumbersome to use. An alternative would be to use a restricted set of pango_-like markup and to interpret this markup. | |
| 36 | 36 | ||
| 37 | - .. _pango: https://developer.gnome.org/pygtk/stable/pango-markup-language.html | ||
| 37 | + .. _pango: https://docs.gtk.org/Pango/pango_markup.html#pango-markup | ||
| 38 | 38 | ||
| 39 | 39 | Some markup examples:: | |
| 40 | 40 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -78,7 +78,7 @@ Font handling and rendering | |||
| 78 | 78 | ||
| 79 | 79 | * `LaTeX <https://www.latex-project.org/>`_ (with `cm-super | |
| 80 | 80 | <https://ctan.org/pkg/cm-super>`__ ) and `GhostScript (>=9.0) | |
| 81 | - <https://ghostscript.com/download/>`_ : for rendering text with LaTeX. | ||
| 81 | + <https://ghostscript.com/releases/>`_ : for rendering text with LaTeX. | ||
| 82 | 82 | * `fontconfig <https://www.fontconfig.org>`_ (>= 2.7): for detection of system | |
| 83 | 83 | fonts on Linux. | |
| 84 | 84 | ||
@@ -191,7 +191,7 @@ Optional: | |||
| 191 | 191 | - pytest-xdist_ to run tests in parallel | |
| 192 | 192 | ||
| 193 | 193 | .. _pytest: http://doc.pytest.org/en/latest/ | |
| 194 | - .. _Ghostscript: https://www.ghostscript.com/ | ||
| 194 | + .. _Ghostscript: https://ghostscript.com/ | ||
| 195 | 195 | .. _Inkscape: https://inkscape.org | |
| 196 | 196 | .. _pytest-cov: https://pytest-cov.readthedocs.io/en/latest/ | |
| 197 | 197 | .. _pytest-flake8: https://pypi.org/project/pytest-flake8/ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,7 +29,7 @@ reliability and consistency in documentation. They are not interchangeable. | |||
| 29 | 29 | +------------------+--------------------------+--------------+--------------+ | |
| 30 | 30 | | Term | Description | Correct | Incorrect | | |
| 31 | 31 | +==================+==========================+==============+==============+ | |
| 32 | - | Figure_ | Matplotlib working space | - *For | - "The figure| | ||
| 32 | + | |Figure| | Matplotlib working space | - *For | - "The figure| | ||
| 33 | 33 | | | for programming. | Matplotlib | is the | | |
| 34 | 34 | | | | objects*: | working | | |
| 35 | 35 | | | | Figure, | space for | | |
@@ -39,11 +39,11 @@ reliability and consistency in documentation. They are not interchangeable. | |||
| 39 | 39 | | | | space for | provide the| | |
| 40 | 40 | | | | the visual.| visuals." | | |
| 41 | 41 | | | | - *Referring | - "The | | |
| 42 | - | | | to class*: | Figure_ | | ||
| 43 | - | | | Figure_ , | Four | | ||
| 42 | + | | | to class*: | |Figure| | | ||
| 43 | + | | | |Figure|, | Four | | ||
| 44 | 44 | | | | "Methods | leglock is | | |
| 45 | 45 | | | | within the | a wrestling| | |
| 46 | - | | | Figure_ | move." | | ||
| 46 | + | | | |Figure| | move." | | ||
| 47 | 47 | | | | provide the| | | |
| 48 | 48 | | | | visuals." | | | |
| 49 | 49 | | | | - *General | | | |
@@ -55,28 +55,29 @@ reliability and consistency in documentation. They are not interchangeable. | |||
| 55 | 55 | | | | figure | | | |
| 56 | 56 | | | | skater." | | | |
| 57 | 57 | +------------------+--------------------------+--------------+--------------+ | |
| 58 | - | Axes_ | Subplots within Figure. | - *For | - "The axes | | ||
| 58 | + | |Axes| | Subplots within Figure. | - *For | - "The axes | | ||
| 59 | 59 | | | Contains plot elements | Matplotlib | methods | | |
| 60 | 60 | | | and is responsible for | objects*: | transform | | |
| 61 | 61 | | | plotting and configuring | Axes, "An | the data." | | |
| 62 | - | | additional details. | Axes is a | - "Each Axes_| | ||
| 63 | - | | | subplot | is specific| | ||
| 64 | - | | | within the | to a | | ||
| 65 | - | | | Figure." | Figure." | | ||
| 62 | + | | additional details. | Axes is a | - "Each | | ||
| 63 | + | | | subplot | |Axes| is | | ||
| 64 | + | | | within the | specific to| | ||
| 65 | + | | | Figure." | a Figure." | | ||
| 66 | 66 | | | | - *Referring | - "The | | |
| 67 | 67 | | | | to class*: | musicians | | |
| 68 | - | | | Axes_ , | on stage | | ||
| 69 | - | | | "Each Axes_| call their | | ||
| 70 | - | | | is specific| guitars | | ||
| 71 | - | | | to one | Axes." | | ||
| 72 | - | | | Figure." | - "The point | | ||
| 73 | - | | | - *General | where the | | ||
| 74 | - | | | language*: | Axes meet | | ||
| 75 | - | | | axes, "Both| is the | | ||
| 76 | - | | | loggers and| origin of | | ||
| 77 | - | | | lumberjacks| the | | ||
| 78 | - | | | use axes to| coordinate | | ||
| 79 | - | | | chop wood."| system." | | ||
| 68 | + | | | |Axes|, | on stage | | ||
| 69 | + | | | "Each | call their | | ||
| 70 | + | | | |Axes| is | guitars | | ||
| 71 | + | | | specific to| Axes." | | ||
| 72 | + | | | one | - "The point | | ||
| 73 | + | | | Figure." | where the | | ||
| 74 | + | | | - *General | Axes meet | | ||
| 75 | + | | | language*: | is the | | ||
| 76 | + | | | axes, "Both| origin of | | ||
| 77 | + | | | loggers and| the | | ||
| 78 | + | | | lumberjacks| coordinate | | ||
| 79 | + | | | use axes to| system." | | ||
| 80 | + | | | chop wood."| | | ||
| 80 | 81 | | | | OR "There | | | |
| 81 | 82 | | | | are no | | | |
| 82 | 83 | | | | standard | | | |
@@ -89,24 +90,25 @@ reliability and consistency in documentation. They are not interchangeable. | |||
| 89 | 90 | | | | (Plural of | | | |
| 90 | 91 | | | | axis) | | | |
| 91 | 92 | +------------------+--------------------------+--------------+--------------+ | |
| 92 | - | Artist_ | Broad variety of | - *For | - "Configure | | ||
| 93 | + | |Artist| | Broad variety of | - *For | - "Configure | | ||
| 93 | 94 | | | Matplotlib objects that | Matplotlib | the legend | | |
| 94 | 95 | | | display visuals. | objects*: | artist with| | |
| 95 | 96 | | | | Artist, | its | | |
| 96 | 97 | | | | "Artists | respective | | |
| 97 | 98 | | | | display | method." | | |
| 98 | 99 | | | | visuals and| - "There is | | |
| 99 | - | | | are the | an Artist_ | | ||
| 100 | - | | | visible | for that | | ||
| 101 | - | | | elements | visual in | | ||
| 102 | - | | | when the | the graph."| | ||
| 103 | - | | | rendering | - "Some | | ||
| 104 | - | | | a Figure." | Artists | | ||
| 105 | - | | | - *Referring | became | | ||
| 106 | - | | | to class*: | famous only| | ||
| 107 | - | | | Artist_ , | by | | ||
| 108 | - | | | "Each | accident." | | ||
| 109 | - | | | Artist_ has| | | ||
| 100 | + | | | are the | an | | ||
| 101 | + | | | visible | |Artist| | | ||
| 102 | + | | | elements | for that | | ||
| 103 | + | | | when | visual in | | ||
| 104 | + | | | rendering a| the graph."| | ||
| 105 | + | | | Figure." | - "Some | | ||
| 106 | + | | | - *Referring | Artists | | ||
| 107 | + | | | to class*: | became | | ||
| 108 | + | | | |Artist| , | famous only| | ||
| 109 | + | | | "Each | by | | ||
| 110 | + | | | |Artist| | accident." | | ||
| 111 | + | | | has | | | ||
| 110 | 112 | | | | respective | | | |
| 111 | 113 | | | | methods and| | | |
| 112 | 114 | | | | functions."| | | |
@@ -119,7 +121,7 @@ reliability and consistency in documentation. They are not interchangeable. | |||
| 119 | 121 | | | | is from | | | |
| 120 | 122 | | | | France." | | | |
| 121 | 123 | +------------------+--------------------------+--------------+--------------+ | |
| 122 | - | Axis_ | Human-readable single | - *For | - "Plot the | | ||
| 124 | + | |Axis| | Human-readable single | - *For | - "Plot the | | ||
| 123 | 125 | | | dimensional object | Matplotlib | graph onto | | |
| 124 | 126 | | | of reference marks | objects*: | the axis." | | |
| 125 | 127 | | | containing ticks, tick | Axis, "The | - "Each Axis | | |
@@ -133,12 +135,13 @@ reliability and consistency in documentation. They are not interchangeable. | |||
| 133 | 135 | | | | objects) | - "In some | | |
| 134 | 136 | | | | - *Referring | computer | | |
| 135 | 137 | | | | to class*: | graphics | | |
| 136 | - | | | Axis_ , | contexts, | | ||
| 137 | - | | | "The Axis_ | the | | ||
| 138 | - | | | contains | ordinate | | ||
| 139 | - | | | respective | Axis_ may | | ||
| 140 | - | | | XAxis and | be oriented| | ||
| 141 | - | | | YAxis | downwards."| | ||
| 138 | + | | | |Axis|, | contexts, | | ||
| 139 | + | | | "The | the | | ||
| 140 | + | | | |Axis| | ordinate | | ||
| 141 | + | | | contains | |Axis| may | | ||
| 142 | + | | | respective | be oriented| | ||
| 143 | + | | | XAxis and | downwards."| | ||
| 144 | + | | | YAxis | | | ||
| 142 | 145 | | | | objects." | | | |
| 143 | 146 | | | | - *General | | | |
| 144 | 147 | | | | language*: | | | |
@@ -162,10 +165,10 @@ reliability and consistency in documentation. They are not interchangeable. | |||
| 162 | 165 | | | | | interface | | |
| 163 | 166 | +------------------+--------------------------+--------------+--------------+ | |
| 164 | 167 | ||
| 165 | - .. _Figure: :class:`~matplotlib.figure.Figure` | ||
| 166 | - .. _Axes: :class:`~matplotlib.axes.Axes` | ||
| 167 | - .. _Artist: :class:`~matplotlib.artist.Artist` | ||
| 168 | - .. _Axis: :class:`matplotlib.axis.Axis` | ||
| 168 | + .. |Figure| replace:: :class:`~matplotlib.figure.Figure` | ||
| 169 | + .. |Axes| replace:: :class:`~matplotlib.axes.Axes` | ||
| 170 | + .. |Artist| replace:: :class:`~matplotlib.artist.Artist` | ||
| 171 | + .. |Axis| replace:: :class:`~matplotlib.axis.Axis` | ||
| 169 | 172 | ||
| 170 | 173 | ||
| 171 | 174 | Grammar | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -208,7 +208,7 @@ The following workflow [1]_ is a good way to approach issue triaging: | |||
| 208 | 208 | ||
| 209 | 209 | ||
| 210 | 210 | .. [1] Adapted from the pandas project `maintainers guide | |
| 211 | - <https://dev.pandas.io/docs/development/maintaining.html>`_ and | ||
| 211 | + <https://pandas.pydata.org/docs/development/maintaining.html>`_ and | ||
| 212 | 212 | `the scikit-learn project | |
| 213 | 213 | <https://scikit-learn.org/dev/developers/bug_triaging.html>`_ . | |
| 214 | 214 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,21 +1,57 @@ | |||
| 1 | + from urllib.parse import urlsplit, urlunsplit | ||
| 2 | + | ||
| 1 | 3 | from docutils import nodes | |
| 2 | - from os.path import sep | ||
| 4 | + | ||
| 3 | 5 | from matplotlib import rcParamsDefault | |
| 4 | 6 | ||
| 5 | 7 | ||
| 6 | - def rcparam_role(name, rawtext, text, lineno, inliner, options={}, content=[]): | ||
| 7 | - rendered = nodes.Text(f'rcParams["{text}"]') | ||
| 8 | + class QueryReference(nodes.Inline, nodes.TextElement): | ||
| 9 | + """ | ||
| 10 | + Wraps a reference or pending reference to add a query string. | ||
| 11 | + | ||
| 12 | + The query string is generated from the attributes added to this node. | ||
| 13 | + | ||
| 14 | + Also equivalent to a `~docutils.nodes.literal` node. | ||
| 15 | + """ | ||
| 16 | + | ||
| 17 | + def to_query_string(self): | ||
| 18 | + """Generate query string from node attributes.""" | ||
| 19 | + return '&'.join(f'{name}={value}' for name, value in self.attlist()) | ||
| 20 | + | ||
| 21 | + | ||
| 22 | + def visit_query_reference_node(self, node): | ||
| 23 | + """ | ||
| 24 | + Resolve *node* into query strings on its ``reference`` children. | ||
| 8 | 25 | ||
| 9 | - source = inliner.document.attributes['source'].replace(sep, '/') | ||
| 10 | - rel_source = source.split('/doc/', 1)[1] | ||
| 26 | + Then act as if this is a `~docutils.nodes.literal`. | ||
| 27 | + """ | ||
| 28 | + query = node.to_query_string() | ||
| 29 | + for refnode in node.findall(nodes.reference): | ||
| 30 | + uri = urlsplit(refnode['refuri'])._replace(query=query) | ||
| 31 | + refnode['refuri'] = urlunsplit(uri) | ||
| 11 | 32 | ||
| 12 | - levels = rel_source.count('/') | ||
| 13 | - refuri = ('../' * levels + | ||
| 14 | - 'tutorials/introductory/customizing.html' + | ||
| 15 | - f"?highlight={text}#a-sample-matplotlibrc-file") | ||
| 33 | + self.visit_literal(node) | ||
| 34 | + | ||
| 35 | + | ||
| 36 | + def depart_query_reference_node(self, node): | ||
| 37 | + """ | ||
| 38 | + Act as if this is a `~docutils.nodes.literal`. | ||
| 39 | + """ | ||
| 40 | + self.depart_literal(node) | ||
| 41 | + | ||
| 42 | + | ||
| 43 | + def rcparam_role(name, rawtext, text, lineno, inliner, options={}, content=[]): | ||
| 44 | + # Generate a pending cross-reference so that Sphinx will ensure this link | ||
| 45 | + # isn't broken at some point in the future. | ||
| 46 | + title = f'rcParam["{text}"]' | ||
| 47 | + target = 'matplotlibrc-sample' | ||
| 48 | + ref_nodes, messages = inliner.interpreted(title, f'{title} <{target}>', | ||
| 49 | + 'ref', lineno) | ||
| 50 | + | ||
| 51 | + qr = QueryReference(rawtext, highlight=text) | ||
| 52 | + qr += ref_nodes | ||
| 53 | + node_list = [qr] | ||
| 16 | 54 | ||
| 17 | - ref = nodes.reference(rawtext, rendered, refuri=refuri) | ||
| 18 | - node_list = [nodes.literal('', '', ref)] | ||
| 19 | 55 | # The default backend would be printed as "agg", but that's not correct (as | |
| 20 | 56 | # the default is actually determined by fallback). | |
| 21 | 57 | if text in rcParamsDefault and text != "backend": | |
@@ -24,9 +60,16 @@ def rcparam_role(name, rawtext, text, lineno, inliner, options={}, content=[]): | |||
| 24 | 60 | nodes.literal('', repr(rcParamsDefault[text])), | |
| 25 | 61 | nodes.Text(')'), | |
| 26 | 62 | ]) | |
| 27 | - return node_list, [] | ||
| 63 | + | ||
| 64 | + return node_list, messages | ||
| 28 | 65 | ||
| 29 | 66 | ||
| 30 | 67 | def setup(app): | |
| 31 | 68 | app.add_role("rc", rcparam_role) | |
| 69 | + app.add_node( | ||
| 70 | + QueryReference, | ||
| 71 | + html=(visit_query_reference_node, depart_query_reference_node), | ||
| 72 | + latex=(visit_query_reference_node, depart_query_reference_node), | ||
| 73 | + text=(visit_query_reference_node, depart_query_reference_node), | ||
| 74 | + ) | ||
| 32 | 75 | return {"parallel_read_safe": True, "parallel_write_safe": True} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,6 +15,7 @@ | |||
| 15 | 15 | This creates in the build directory a file ``build/html/topic/old-page.html`` | |
| 16 | 16 | that contains a relative refresh:: | |
| 17 | 17 | ||
| 18 | + <!DOCTYPE html> | ||
| 18 | 19 | <html> | |
| 19 | 20 | <head> | |
| 20 | 21 | <meta http-equiv="refresh" content="0; url=new-page.html"> | |
@@ -38,7 +39,8 @@ | |||
| 38 | 39 | logger = logging.getLogger(__name__) | |
| 39 | 40 | ||
| 40 | 41 | ||
| 41 | - HTML_TEMPLATE = """<html> | ||
| 42 | + HTML_TEMPLATE = """<!DOCTYPE html> | ||
| 43 | + <html> | ||
| 42 | 44 | <head> | |
| 43 | 45 | <meta http-equiv="refresh" content="0; url={v}"> | |
| 44 | 46 | </head> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -84,7 +84,8 @@ Getting help | |||
| 84 | 84 | There are a number of good resources for getting help with Matplotlib. | |
| 85 | 85 | There is a good chance your question has already been asked: | |
| 86 | 86 | ||
| 87 | - - The `mailing list archive <http://matplotlib.1069221.n5.nabble.com/>`_. | ||
| 87 | + - The `mailing list archive | ||
| 88 | + <https://discourse.matplotlib.org/c/community/matplotlib-users/6>`_. | ||
| 88 | 89 | ||
| 89 | 90 | - `GitHub issues <https://github.com/matplotlib/matplotlib/issues>`_. | |
| 90 | 91 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,8 +4,7 @@ List of changes to Matplotlib prior to 2015 | |||
| 4 | 4 | =========================================== | |
| 5 | 5 | ||
| 6 | 6 | This is a list of the changes made to Matplotlib from 2003 to 2015. For more | |
| 7 | - recent changes, please refer to the `what's new <../whats_new.html>`_ or | ||
| 8 | - the `API changes <../../api/api_changes.html>`_. | ||
| 7 | + recent changes, please refer to the :doc:`/users/release_notes`. | ||
| 9 | 8 | ||
| 10 | 9 | 2015-11-16 | |
| 11 | 10 | Levels passed to contour(f) and tricontour(f) must be in increasing order. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,7 @@ | |||
| 7 | 7 | `Generic Mapping Tools`_. | |
| 8 | 8 | ||
| 9 | 9 | .. _Mathematica: http://reference.wolfram.com/mathematica/ref/ReliefPlot.html | |
| 10 | - .. _Generic Mapping Tools: https://gmt.soest.hawaii.edu/ | ||
| 10 | + .. _Generic Mapping Tools: https://www.generic-mapping-tools.org/ | ||
| 11 | 11 | """ | |
| 12 | 12 | ||
| 13 | 13 | import numpy as np | |
| Back | FazBrowse Home | New Git URL |
0 commit comments