File:Animation Kalte Progression ohne und mit Kompensation.gif

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(1,200 × 900 pixels, file size: 2.33 MB, MIME type: image/gif, looped, 42 frames, 28 s)

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

Description
Deutsch: Allgemeines Beispiel zur "kalten Progression" im Zeitablauf bei 2 % Preissteigerung und 2 % Einkommenserhöhung pro Jahr. Zuerst wird die Situation ohne Kompensation gezeigt, danach mit Kompensation.
Date
Source Own work
Author Udo.Brechtel
#----------------
#   python3
#----------------
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib.ticker import FormatStrFormatter
from tarife import ESt32a

#Konstanten
Fliesskommaformat = FormatStrFormatter('%1.3f')
Prozentformat = FormatStrFormatter('%g %%')
Euroformat = FormatStrFormatter('%g €')
xmax, ymax = 90000, 47
p  = 0.02  #Inflationsrate = zvE-Steigerungsrate
q  = 1 + p
nFrames = 42 #gerade Zahl; Animation Anzahl frames
x0 = 30000
y0 = 100*ESt32a(x0, False, 0, True, 2, 1) #qi = 1

fig = plt.figure(figsize=(8,6), dpi=150)
ax = fig.subplots()

fig.suptitle('Kalte Progression (allgemeines Beispiel)', fontsize=18, fontweight='bold')

ax.set_xlim(0, xmax)
ax.set_ylim(0, ymax)

X = np.linspace(0, xmax, 500)
Y1o, Y2o = [], []

for x1 in X:
    y1 = 100*ESt32a(x1, False, 0, True, 1, 1.0)
    Y1o.append(y1)
    y2 = 100*ESt32a(x1, False, 0, True, 2, 1.0)
    Y2o.append(y2)

Linie1, = ax.plot(X, Y1o, 'r:', label='Grenzsteuersatz')
Linie2, = ax.plot(X, Y2o, 'r-', label='∅-Steuersatz')

Punkt, = ax.plot([x0], [y0], 'bo', markersize=8, label=None)
Pfeil,  = ax.plot([],[], 'b<', markersize=8)
Pfeil1, = ax.plot([],[], 'b-', lw=0.8)
Pfeil2, = ax.plot([],[], 'b-', lw=0.5)
           
Titel1 = ax.text(xmax/2, ymax+1, '??? Kompensation', fontsize=24, fontweight='bold', ha='center')

Text1 = ax.text(5000,42, '', color='b', fontsize=18, fontweight='bold', backgroundcolor='white')

Text2 = ax.text(46000,8, '...index', color='blue', fontsize=13, fontweight='bold', backgroundcolor='white',
                bbox=dict(facecolor='white', edgecolor='black', pad=0.4, boxstyle='round'))
Text0 = ax.text(xmax/2,ymax/2,'Kalte Progression\nohne Kompensation', color='black', fontsize=24, fontweight='bold', backgroundcolor='white', ha='center',
                bbox=dict(facecolor=(0.98,0.98,0.82), edgecolor='r',  boxstyle='round'))

textCC = ax.text(-11000, -7, 'CC BY-SA 4.0, Udo Brechtel', fontsize=8, fontweight='normal', ha='left')

ax.legend(loc='lower right')
ax.grid()
ax.yaxis.set_major_formatter(Prozentformat)
ax.set_xlabel('Jährlich zu versteuerndes Einkommen in Euro', fontsize=12, fontweight='bold', labelpad=10)
ax.set_ylabel('Grenz-/∅-Steuersatz', fontsize=12, fontweight='bold', labelpad=15)
fig.tight_layout()
fig.subplots_adjust(top=0.86)

def set_Punkt(xP, yP):
    Punkt.set_data(xP, yP)
    Pfeil.set_data(1000, yP)
    Pfeil1.set_data([xP,xP],[0,ymax])
    Pfeil2.set_data([xP,0], [yP,yP])

def set_Text1(i):
    if i == 0:
        Text1.set_text('Jahr x          ')
    else:
        Text1.set_text('Jahr x + ' + str(i))
    
def set_Text2(xP,yP, qi):
    indexPreis          = round(100*qi, 1) #Lohnindex = Preisindex !!!!!!!!!!!!
    indexLohn           = round(100*qi, 1) #Lohnindex = Preisindex !!!!!!!!!!!!
    indexLohnNachSteuer = round(100*xP*(1-yP/100)/(x0*(1 - y0/100)), 1)
    verlustReal = 100 * (indexLohnNachSteuer / indexLohn -1)
                                         
    text1a = '{:.1f}'.format(indexPreis).replace('.', ',') + ' = Preisindex (Jahr x ≙ 100)'
    text1b = '{:.1f}'.format(indexLohn).replace('.', ',') + ' = Einkommensindex vor Steuer'
    text1c = '{:.1f}'.format(indexLohnNachSteuer).replace('.', ',') + ' = Lohnindex nach Steuer'
    text1d = '{:.1f}'.format(verlustReal).replace('.', ',') + ' % = Reallohnverlust'
    Text2.set_text(text1a+'\n'+text1c+'\n'+text1d)

def animate(i):
    #print(i)
    iwechsel = int(nFrames / 2)
    if i < iwechsel:
        return animation1(i)
    else:
        ##Titel1.set_text('mit Kompensation')
        return animation2(i - iwechsel)

def animation1(i):
    #ohne Kompensation
    Titel1.set_text('ohne Kompensation')
    
    if i==0:
        Text0.set_text('Kalte Progression\nohne Kompensation')
        Text0.set_visible(True)
    elif i==1:
        Text0.set_visible(False)
        
    Linie1.set_data(X, Y1o)
    Linie2.set_data(X, Y2o)

    qi = q**i
    xP = round(x0 * qi, 0)
    yP = round(100*ESt32a(xP, False, 0, True, 2, 1), 2)
    set_Punkt(xP, yP)
    set_Text1(i)
    set_Text2(xP,yP, qi)
    
    return (Linie1, Linie2, Punkt, Titel1, Text1, Text2, Pfeil, Pfeil1, Pfeil2, Text0)
    
def animation2(i):
    #mit Kompensation
    Titel1.set_text('mit Kompensation')

    if i==0:
        Text0.set_text('Kalte Progression\nmit Kompensation')
        Text0.set_visible(True)
    elif i==1:
        Text0.set_visible(False)

    qi = q**i
    Y1m, Y2m = [], []
    for x in X:
        y = 100*ESt32a(x, False, 0, True, 1, qi)
        Y1m.append(y)
        y = 100*ESt32a(x, False, 0, True, 2, qi)
        Y2m.append(y)
    Linie1.set_data(X, Y1m)
    Linie2.set_data(X, Y2m)
    
    xP = round(x0 * qi, 0)
    yP = round(100*ESt32a(xP, False, 0, True, 2, qi), 2)

    set_Punkt(xP, yP)
    set_Text1(i)
    set_Text2(xP,yP, qi)

myAnimation = animation.FuncAnimation(fig, animate, frames=nFrames, \
                                      interval=500, repeat=True, repeat_delay=2000) #blit=True nicht benutzen

myAnimation.save('kalte_progression_ohne_mit_kompensation.gif', writer='imagemagick')

plt.show()

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current18:52, 11 October 2019Thumbnail for version as of 18:52, 11 October 20191,200 × 900 (2.33 MB)Udo.Brechtel (talk | contribs)Dauer einiger Frames geändert
18:55, 10 October 2019Thumbnail for version as of 18:55, 10 October 20191,200 × 900 (2.33 MB)Udo.Brechtel (talk | contribs){{Information |description ={{de|1=Allgemeines Beispiel zur "kalten Progression" als GIF-Animation. Die Inflation beträgt 2 % und ist mit der Einkommenserhöhung vor Steuer identisch. Zuerst wird die Situation ohne Kompensation gezeigt, danach mit Kompensation.}} |date =2019-10-10 |source ={{own}} |author =User:Udo.Brechtel }} <source language="python3"> #---------------- # python3 #---------------- import numpy as np import matplotlib.pyplot as plt import matpl...

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file:

Metadata