Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -213,16 +213,23 @@ def plotar_evolucao_bimestres(disciplinas_dados, temp_dir):
|
|
213 |
|
214 |
plt.grid(True, linestyle='--', alpha=0.3, zorder=0)
|
215 |
|
|
|
|
|
|
|
216 |
for idx, disc_data in enumerate(disciplinas_dados):
|
217 |
notas = pd.Series(disc_data['notas'])
|
218 |
bimestres_cursados = disc_data['bimestres_cursados']
|
|
|
219 |
|
220 |
if bimestres_cursados:
|
221 |
notas_validas = [nota for i, nota in enumerate(notas, 1) if i in bimestres_cursados and nota is not None]
|
222 |
bimestres = [bim for bim in bimestres_cursados if notas[bim-1] is not None]
|
223 |
|
224 |
if notas_validas:
|
225 |
-
|
|
|
|
|
|
|
226 |
color=cores[idx % len(cores)],
|
227 |
marker=marcadores[idx % len(marcadores)],
|
228 |
markersize=8,
|
@@ -231,7 +238,7 @@ def plotar_evolucao_bimestres(disciplinas_dados, temp_dir):
|
|
231 |
linestyle=estilos_linha[idx % len(estilos_linha)],
|
232 |
alpha=0.8)
|
233 |
|
234 |
-
for x, y in zip(
|
235 |
if y is not None:
|
236 |
plt.annotate(f"{y:.1f}", (x, y),
|
237 |
textcoords="offset points",
|
|
|
213 |
|
214 |
plt.grid(True, linestyle='--', alpha=0.3, zorder=0)
|
215 |
|
216 |
+
# Configurar deslocamentos para evitar sobreposição
|
217 |
+
deslocamentos = np.linspace(-0.1, 0.1, n_disciplinas)
|
218 |
+
|
219 |
for idx, disc_data in enumerate(disciplinas_dados):
|
220 |
notas = pd.Series(disc_data['notas'])
|
221 |
bimestres_cursados = disc_data['bimestres_cursados']
|
222 |
+
desloc = deslocamentos[idx] # Valor de deslocamento para esta disciplina
|
223 |
|
224 |
if bimestres_cursados:
|
225 |
notas_validas = [nota for i, nota in enumerate(notas, 1) if i in bimestres_cursados and nota is not None]
|
226 |
bimestres = [bim for bim in bimestres_cursados if notas[bim-1] is not None]
|
227 |
|
228 |
if notas_validas:
|
229 |
+
# Aplicar deslocamento aos bimestres para evitar sobreposição
|
230 |
+
bimestres_deslocados = [b + desloc for b in bimestres]
|
231 |
+
|
232 |
+
plt.plot(bimestres_deslocados, notas_validas,
|
233 |
color=cores[idx % len(cores)],
|
234 |
marker=marcadores[idx % len(marcadores)],
|
235 |
markersize=8,
|
|
|
238 |
linestyle=estilos_linha[idx % len(estilos_linha)],
|
239 |
alpha=0.8)
|
240 |
|
241 |
+
for x, y in zip(bimestres_deslocados, notas_validas):
|
242 |
if y is not None:
|
243 |
plt.annotate(f"{y:.1f}", (x, y),
|
244 |
textcoords="offset points",
|