Fitxer original(fitxer SVG, nominalment 1.080 × 540 píxels, mida del fitxer: 34 Ko)

Descripció a Commons

Resum

Descripció
Afrikaans: Aantal Afrikaanse Wikipedia Artikels met verloop van tyd
English: Number of Afrikaans Wikipedia articles over time
Data
Font Treball propi
Autor Rooiratel
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from datetime import datetime
from matplotlib.ticker import MultipleLocator

# vars
dt_format = '%Y-%m-%d'

# Initialize lists to store the dates and values
dates = []
values = []

# format of mylpale_data.txt is as follows
# 2001-11-01 1
# 2002-08-01 50
# 2003-04-01 100
# etc.

# Open the text file and read the data
with open('mylpale_data.txt', 'r') as file:
    for line in file:
        # Split the line into date and value
        date_str, value_str = line.strip().split()
        # Convert the date string to a datetime object
        date = datetime.strptime(date_str, dt_format)
        # Convert the value string to an integer
        value = int(value_str)
        # Append the date and value to their respective lists
        dates.append(date)
        values.append(value)

# Create a figure and set the size
fig, ax = plt.subplots(figsize=(12, 6))  # Adjust the width and height as needed

# Plot the data
ax.plot_date(dates, values, 'o-', markersize=5, linewidth=2, color='#0060ad')

# Set the title and labels
ax.set_title("Aantal Afrikaanse Wikipedia Artikels", fontsize=14)
ax.set_xlabel("Datum")
ax.set_ylabel("Aantal Artikels")

# Set the x-axis major ticks to years
ax.xaxis.set_major_locator(mdates.YearLocator())
ax.xaxis.set_major_formatter(mdates.DateFormatter('%Y'))

# Set the x-axis range
start_date = datetime.strptime('2001-06-01', dt_format)
end_date = datetime.strptime(f"{datetime.now().year + 2}-01-01", '%Y-%m-%d')  # Use current year + 2 as the end date
ax.set_xlim(start_date, end_date)

# Set y-axis range
ax.set_ylim(0, (values[-1] + 5000))

# Set the y-axis gridlines to every 5000
ax.yaxis.set_major_locator(MultipleLocator(5000))

# Remove the x-axis and y-axis ticks
ax.xaxis.set_tick_params(which='both', bottom=False, top=False, labelbottom=True)
ax.yaxis.set_tick_params(which='both', left=False, right=False, labelleft=True)

# Add a grid
ax.grid(True)

# Add padding to the plot
ax.margins(x=0.1, y=0.1)  # Adjust x and y padding as needed

# Save the plot as an SVG file
plt.savefig("mylpale_fat.svg", format='svg', dpi=1200)

print('Klaar')

To run the above script which generates a fat .svg and to trim out all the crap for the final version of the .svg I use the following Makefile:

pysvg:
	python mylpale.py

shrink: pysvg
	scour -i mylpale_fat.svg -o mylpale.svg --enable-viewboxing --enable-id-stripping \
  --enable-comment-stripping --shorten-ids --indent=none

Llicència

Jo, el titular dels drets d'autor d'aquest treball, el public sota la següent llicència:
w:ca:Creative Commons
reconeixement compartir igual
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
Sou lliure de:
  • compartir – copiar, distribuir i comunicar públicament l'obra
  • adaptar – fer-ne obres derivades
Amb les condicions següents:
  • reconeixement – Heu de donar la informació adequada sobre l'autor, proporcionar un enllaç a la llicència i indicar si s'han realitzat canvis. Podeu fer-ho amb qualsevol mitjà raonable, però de cap manera no suggereixi que l'autor us dóna suport o aprova l'ús que en feu.
  • compartir igual – Si modifiqueu, transformeu, o generareu amb el material, haureu de distribuir les vostres contribucions sota una llicència similar o una de compatible com l'original

Llegendes

Afegeix una explicació d'una línia del que representa aquest fitxer

Elements representats en aquest fitxer

representa l'entitat

Historial del fitxer

Cliqueu una data/hora per veure el fitxer tal com era aleshores.

(les més noves | les més antigues) Mostra (10 posteriors | ) (10 | 20 | 50 | 100 | 250 | 500)
Data/horaMiniaturaDimensionsUsuari/aComentari
actual22:44, 1 març 2024Miniatura per a la versió del 22:44, 1 març 20241.080 × 540 (34 Ko)RooiratelTot 2024-02-29
13:17, 29 oct 2021Miniatura per a la versió del 13:17, 29 oct 2021512 × 219 (19 Ko)Rooiratelfix axis
13:14, 29 oct 2021Miniatura per a la versió del 13:14, 29 oct 2021512 × 219 (22 Ko)Rooiratel100000
08:12, 29 gen 2021Miniatura per a la versió del 08:12, 29 gen 20211.400 × 600 (22 Ko)Rooiratel96000
08:51, 30 jul 2020Miniatura per a la versió del 08:51, 30 jul 20201.400 × 600 (22 Ko)RooiratelFixed x-axis scaling and values.
13:44, 27 jul 2020Miniatura per a la versió del 13:44, 27 jul 20201.400 × 600 (24 Ko)Rooiratel92000 (also fixed xtic intervals)
20:34, 22 gen 2020Miniatura per a la versió del 20:34, 22 gen 20201.400 × 600 (33 Ko)PynappelVergroot x- en y-asse
20:12, 22 gen 2020Miniatura per a la versió del 20:12, 22 gen 20201.400 × 600 (36 Ko)Pynappel88 0000
06:52, 19 des 2019Miniatura per a la versió del 06:52, 19 des 20191.400 × 600 (22 Ko)RooiratelMaak x-as langer.
01:14, 18 des 2019Miniatura per a la versió del 01:14, 18 des 20191.400 × 600 (35 Ko)Pynappel87000
(les més noves | les més antigues) Mostra (10 posteriors | ) (10 | 20 | 50 | 100 | 250 | 500)

La pàgina següent utilitza aquest fitxer:

Ús global del fitxer

Utilització d'aquest fitxer en altres wikis:

Metadades