8000 Fix links? · matplotlib/matplotlib@3fb9972 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3fb9972

Browse files
committed
Fix links?
1 parent 646e08c commit 3fb9972

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

tutorials/introductory/usage.py

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def my_plotter(ax, data1, data2, param_dict):
254254
#
255255
# Line widths are typically in typographic points (1 pt = 1/72 inch) and
256256
# available for artists that have stroked lines. Similarly, stroked lines
257-
# can have a linestyle. See the `linestyles example
257+
# can have a linestyle. See the :doc:`linestyles example
258258
# </gallery/lines_bars_and_markers/linestyles>`.
259259
#
260260
# Marker size depends on the method being used. `~.Axes.plot` specifies
@@ -266,10 +266,13 @@ def my_plotter(ax, data1, data2, param_dict):
266266
# Labelling plots
267267
# ===============
268268
#
269-
# `~.Axes.text` can be used to add text in an arbitrary location, and
269+
# Axes labels and text
270+
# --------------------
271+
#
270272
# `~.Axes.set_xlabel`, `~.Axes.set_ylabel` and `~.Axes.set_title` are used to
271273
# add text in the indicated locations (see :doc:`/tutorials/text/text_intro` for
272-
# more discussion)
274+
# more discussion). Text can also be directly added to plots using
275+
# `~.Axes.text`:
273276

274277
mu, sigma = 100, 15
275278
x = mu + sigma * np.random.randn(10000)
@@ -354,7 +357,7 @@ def my_plotter(ax, data1, data2, param_dict):
354357
# Axis scales and ticks
355358
# =====================
356359
#
357-
# Each Axes has two (or three) `~.Axis` objects represnting the x- and y-axis.
360+
# Each Axes has two (or three) `~.axis.Axis` objects represnting the x- and y-axis.
358361
# These control the *scale* of the axis, the tick *Locators* and the tick
359362
# *Formatters*.
360363
#
@@ -365,7 +368,7 @@ def my_plotter(ax, data1, data2, param_dict):
365368
# such as a log-scale. Since log-scales are used so much there are also
366369
# direct methods like `~.Axes.loglog`, `~.Axes.semilogx`, and
367370
# `~.Axes.semilogy`. There are a number of scales (see
368-
# :doc:`/gallery/scales/` for other examples). Here we set the scale
371+
# :doc:`/gallery/scales/scales` for other examples). Here we set the scale
369372
# manually:
370373

371374
fig, axs = plt.subplots(1, 2, figsize=(5, 2.7), constrained_layout=True)
@@ -379,7 +382,7 @@ def my_plotter(ax, data1, data2, param_dict):
379382
# The scale sets the mapping from data values to spacing along the Axis. This
380383
# happens in both directions, and gets combined into a *transform*, which
381384
# is the way that Matplotlib maps from data co-ordinates to Axes, Figure, or
382-
# screen co-ordinates. See doc:`/tutorials/advanced/transforms_tutorial`.
385+
# screen co-ordinates. See :doc:`/tutorials/advanced/transforms_tutorial`.
383386
#
384387
# Tick locators and formatters
385388
# ----------------------------
@@ -399,8 +402,8 @@ def my_plotter(ax, data1, data2, param_dict):
399402
##############################################################################
400403
# Different scales can have different locators and formatters; for instance
401404
# the log-scale above uses `~.LogLocator` and `~.LogFormatter`. See
402-
# :doc:`/gallery/ticks_and_spines/tick-locators` and
403-
# :doc:gallery/ticks_and_spines/tick-formatters` for other formatters and
405+
# :doc:`/gallery/ticks/tick-locators` and
406+
# :doc:gallery/ticks/tick-formatters` for other formatters and
404407
# locators and information for writing your own.
405408
#
406409
# Plotting dates and strings
@@ -409,20 +412,16 @@ def my_plotter(ax, data1, data2, param_dict):
409412
# Matplotlib can handle plotting arrays of dates and arrays of strings as
410413
# well as floating point numbers. These get special locators and formatters
411414
# as appropriate. For dates:
412-
#
413415

414416
fig, ax = plt.subplots(figsize=(5, 3.7), constrained_layout=True)
415-
dates = np.arange(np.datetime64('2021-11-15'), np.datetime64('2021-11-25'),
417+
dates = np.arange(np.datetime64('2021-11-15'), np.datetime64('2021-12-25'),
416418
np.timedelta64(1, 'h'))
417-
418-
ax.plot(dates, np.arange(len(dates)))
419-
# these tick labels will over-run each other so we turn them 45 degrees:
420-
for tick in ax.get_xticklabels():
421-
tick.set_rotation(45)
422-
tick.set_horizontalalignment('right')
419+
data = np.cumsum(np.random.randn(len(dates)))
420+
ax.plot(dates, data)
423421

424422
##############################################################################
425-
# For more information see the date examples in :doc:`/gallery/ticks/`
423+
# For more information see the date examples
424+
# (e.g. :doc:`/gallery/text_labels_and_annotations/date`)
426425
#
427426
# For strings, we get categorical plotting (see:
428427
# :doc:`/gallery/lines_bars_and_markers/categorical_variables`).

0 commit comments

Comments
 (0)
0