מתוך ויקיפדיה, האנציקלופדיה החופשית
לקובץ המקורי (קובץ SVG, הגודל המקורי: 720 × 540 פיקסלים, גודל הקובץ: 61 ק"ב)
#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
import re
from pprint import pprint as pp
# The following numbers were copied from http://www.cbi.ir/page/10809.aspx
# which is a PDF file from the official website of Central Bank of Iran.
# Available to download from: http://www.cbi.ir/simplelist/10807.aspx
text = """۲۸/۹ ۱/۹۱ ۱۳۶۷ ۰/۹ ۰/۱۲ ۱۳۴۱ --- ۰/۰۱ ۱۳۱۵
۱۷/۴ ۲/۲۴ ۱۳۶۸ ۱/۰ ۰/۱۲ ۱۳۴۲ ۲۱/۲ ۰/۰۱ ۱۳۱۶
۹/۰ ۲/۴۴ ۱۳۶۹ ۴/۵ ۰/۱۳ ۱۳۴۳ ۸/۸ ۰/۰۱ ۱۳۱۷
۲۰/۷ ۲/۹۵ ۱۳۷۰ ۰/۳ ۰/۱۳ ۱۳۴۴ ۸/۰ ۰/۰۱ ۱۳۱۸
۲۴/۴ ۳/۶۷ ۱۳۷۱ ۰/۸ ۰/۱۳ ۱۳۴۵ ۱۳/۸ ۰/۰۱ ۱۳۱۹
۲۲/۹ ۴/۵۰ ۱۳۷۲ ۰/۸ ۰/۱۳ ۱۳۴۶ ۴۹/۵ ۰/۰۲ ۱۳۲۰
۳۵/۲ ۶/۰۹ ۱۳۷۳ ۱/۵ ۰/۱۳ ۱۳۴۷ ۹۶/۲ ۰/۰۳ ۱۳۲۱
۴۹/۴ ۹/۰۹ ۱۳۷۴ ۳/۶ ۰/۱۳ ۱۳۴۸ ۱۱۰/۵ ۰/۰۷ ۱۳۲۲
۲۳/۲ ۱۱/۲۱ ۱۳۷۵ ۱/۵ ۰/۱۴ ۱۳۴۹ ۲/۷ ۰/۰۷ ۱۳۲۳
۱۷/۳ ۱۳/۱۴ ۱۳۷۶ ۵/۵ ۰/۱۴ ۱۳۵۰ -۱۴/۴ ۰/۰۶ ۱۳۲۴
۱۸/۱ ۱۵/۵۲ ۱۳۷۷ ۶/۳ ۰/۱۵ ۱۳۵۱ -۱۱/۵ ۰/۰۵ ۱۳۲۵
۲۰/۱ ۱۸/۶۴ ۱۳۷۸ ۱۱/۲ ۰/۱۷ ۱۳۵۲ ۶/۶ ۰/۰۶ ۱۳۲۶
۱۲/۶ ۲۰/۹۹ ۱۳۷۹ ۱۵/۵ ۰/۱۹ ۱۳۵۳ ۱۱/۱ ۰/۰۶ ۱۳۲۷
۱۱/۴ ۲۳/۳۸ ۱۳۸۰ ۹/۹ ۰/۲۱ ۱۳۵۴ ۲/۳ ۰/۰۷ ۱۳۲۸
۱۵/۸ ۲۷/۰۷ ۱۳۸۱ ۱۶/۶ ۰/۲۵ ۱۳۵۵ -۱۷/۲ ۰/۰۵ ۱۳۲۹
۱۵/۶ ۳۱/۳۱ ۱۳۸۲ ۲۵/۱ ۰/۳۱ ۱۳۵۶ ۸/۳ ۰/۰۶ ۱۳۳۰
۱۵/۲ ۳۶/۰۷ ۱۳۸۳ ۱۰/۰ ۰/۳۴ ۱۳۵۷ ۷/۲ ۰/۰۶ ۱۳۳۱
۱۰/۴ ۳۹/۸۰ ۱۳۸۴ ۱۱/۴ ۰/۳۸ ۱۳۵۸ ۹/۲ ۰/۰۷ ۱۳۳۲
۱۱/۹ ۴۴/۵۳ ۱۳۸۵ ۲۳/۵ ۰/۴۷ ۱۳۵۹ ۱۵/۹ ۰/۰۸ ۱۳۳۳
۱۸/۴ ۵۲/۷۴ ۱۳۸۶ ۲۲/۸ ۰/۵۸ ۱۳۶۰ ۱/۷ ۰/۰۸ ۱۳۳۴
۲۵/۴ ۶۶/۱۲ ۱۳۸۷ ۱۹/۲ ۰/۶۹ ۱۳۶۱ ۸/۸ ۰/۰۹ ۱۳۳۵
۱۰/۸ ۷۳/۲۳ ۱۳۸۸ ۱۴/۸ ۰/۷۹ ۱۳۶۲ ۴/۴ ۰/۰۹ ۱۳۳۶
۱۲/۴ ۸۲/۳۱ ۱۳۸۹ ۱۰/۴ ۰/۸۸ ۱۳۶۳ ۱/۰ ۰/۰۹ ۱۳۳۷
۲۱/۵ ۱۰۰/۰۰ ۱۳۹۰ ۶/۹ ۰/۹۴ ۱۳۶۴ ۱۳/۰ ۰/۱۱ ۱۳۳۸
۳۰/۵ ۱۳۰/۵۴ ۱۳۹۱ ۲۳/۷ ۱/۱۶ ۱۳۶۵ ۷/۹ ۰/۱۲ ۱۳۳۹
۳۴/۷ ۱۷۵/۸۸ ۱۳۹۲ ۲۷/۷ ۱/۴۸ ۱۳۶۶ ۱/۶ ۰/۱۲ ۱۳۴۰"""
text = text . replace ( '/' , '.' )
data = re . findall ( r '(\S+)\s+(\S+)\s+(\S+)\s*' , text )
years_inflations = sorted (
[( int ( d [ 2 ]), float ( d [ 0 ])) for d in data if d [ 0 ] != '---' ]
)
years = [ yi [ 0 ] for yi in years_inflations ]
inflations = [ yi [ 1 ] for yi in years_inflations ]
n = len ( years )
xs = np . array ( years )
ys = np . array ( inflations )
fig = plt . figure ()
ax = fig . add_subplot ( 111 )
plt . title ( 'Inflation rate in Iran: 1315 - 1392' )
axistexts = ax . set_xticklabels ([ str ( x ) for x in xs ])
plt . setp ( axistexts , rotation =- 45 , fontsize = 10 , clip_on = False )
plt . xlim ( xs [ 0 ] - 1 , xs [ - 1 ] + 1 )
plt . xticks ( xs [:: 5 ] + 4 , xs [ 4 :: 5 ])
plt . ylim ( min ( ys ) - 5 , max ( ys ) + 5 )
plt . yticks ( range ( - 20 , 120 , 10 ))
plt . ylabel ( '% Annual inflation rate' )
plt . plot ( xs , ys , "#802F15" , marker = '.' , lw = 1 )
ax . fill_between ( xs , ys , interpolate = True , color = '#FFBEAA' )
plt . grid ( which = 'both' )
plt . savefig ( 'Inflation_rate_in_Iran.svg' )
plt . show ()
אני, בעל זכויות היוצרים על עבודה זו, מפרסם בזאת את העבודה תחת הרישיון הבא:
הנכם רשאים:
לשתף – להעתיק, להפיץ ולהעביר את העבודה
לערבב בין עבודות – להתאים את העבודה
תחת התנאים הבאים:
ייחוס – יש לתת ייחוס הולם, לתת קישור לרישיון, ולציין אם נעשו שינויים. אפשר לעשות את זה בכל צורה סבירה, אבל לא בשום צורה שמשתמע ממנה שמעניק הרישיון תומך בך או בשימוש שלך.
שיתוף זהה – אם תיצרו רמיקס, תשנו, או תבנו על החומר, חובה עליכם להפיץ את התרומות שלך לפי תנאי רישיון זהה או תואם למקור. https://creativecommons.org/licenses/by-sa/4.0 CC BY-SA 4.0 Creative Commons Attribution-Share Alike 4.0 true true עברית נא להוסיף משפט שמסביר מה הקובץ מייצג
היסטוריית הקובץ
שימוש בקובץ
אין בוויקיפדיה דפים המשתמשים בקובץ זה.
קובץ זה מכיל מידע נוסף, שכנראה הגיע ממצלמה דיגיטלית או מסורק שבהם הקובץ נוצר או עבר דיגיטציה.
אם הקובץ שונה ממצבו הראשוני, כמה מהנתונים להלן עלולים שלא לשקף באופן מלא את הקובץ הנוכחי.