Skip to content

Commit d985cd3

Browse files
committed
fontsize optie (dank Ruben) en fix in verkeerde module README.md
1 parent d1f7d86 commit d985cd3

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

TN_code/plotten/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ ax.xaxis.set_major_formatter(formatterX) # gedefinieerde formatter
1919

2020
plt.plot(range(10), range(10)) # plot 10 getallen (0-9 uitgezet tegen 0-9)
2121

22-
plt.tight_layout() # plaats (net) voldoende witruimte rond het figuur
23-
24-
plt.set_ticks(ax) # corrigeer de ticks met de aangemaakte labels
22+
TN.set_ticks(ax) # corrigeer de ticks met de aangemaakte labels
2523

24+
plt.tight_layout() # plaats (net) voldoende witruimte rond het figuur
2625
plt.savefig('fig.pdf', bbox_inches='tight') # maak figuur niet groter dan
2726
# nodig is
2827
plt.show()

TN_code/plotten/TISTNplot.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def legenda(self, x, pos=None):
110110
return self.__call__(x, pos)
111111

112112

113-
def label_x(grootheid, eenheid, ax, haak='[]', text=''):
113+
def label_x(grootheid, eenheid, ax, haak='[]', text='', fontsize=10):
114114
"""
115115
Zet label van de as op een (relatief) makkelijke manier.
116116
@@ -120,14 +120,16 @@ def label_x(grootheid, eenheid, ax, haak='[]', text=''):
120120
ax: matplotlib ax object waarin de x-as zicht bevindt.
121121
haak: standaard [], anders string met linker haak, rechter haak.
122122
text: eventuele tekst die voor de grootheid weergegeven moet worden.
123+
fontsize: eventuele fontsize voor de label-tekst, default 10pt.
123124
return:
124125
none
125126
"""
126127
ax.xaxis.set_label_text(r'%s $\,%s \, %s\mathrm{%s}%s$' % (text,
127-
grootheid, haak[0], eenheid, haak[1]))
128+
grootheid, haak[0], eenheid, haak[1]),
129+
fontsize=fontsize)
128130

129131

130-
def label_y(grootheid, eenheid, ax, haak='[]', text=''):
132+
def label_y(grootheid, eenheid, ax, haak='[]', text='', fontsize=10):
131133
"""
132134
Zet label van de as op een (relatief) makkelijke manier.
133135
@@ -137,11 +139,13 @@ def label_y(grootheid, eenheid, ax, haak='[]', text=''):
137139
ax: matplotlib ax object waarin de x-as zicht bevindt.
138140
haak: standaard [], anders string met linker haak, rechter haak.
139141
text: eventuele tekst die voor de grootheid weergegeven moet worden.
142+
fontsize: eventuele fontsize voor de label-tekst, default 10pt.
140143
return:
141144
none
142145
"""
143146
ax.yaxis.set_label_text(r'%s $\,%s \, %s\mathrm{%s}%s$' % (text,
144-
grootheid, haak[0], eenheid, haak[1]))
147+
grootheid, haak[0], eenheid, haak[1]),
148+
fontsize=fontsize)
145149

146150

147151
# Backwards compatiblity (fix_axis functie aanroep)

0 commit comments

Comments
 (0)