# Chargement des libraries
import plotly.express as px
import numpy as np
z0=8495.
# Création d'un tableau avec les altitudes, comprises entre 0 et 7000m par pas de 10m
z=np.arange(0,7000,10)
# calcul de V(z)
V0=10.
V=V0/(1.-z/z0)
# Figure
fig=px.line(x=z, y=V,labels=dict(x="Altitude (m)", y="Volume (m³)"),title="Variation du volume avec l'altitude entre 0 et 7000m pour V₀=10m³")
fig.update_traces(mode="lines", hovertemplate ='<b>Altitude </b>: %{x} m <br><b>V</b>: %{y: .1f} m³')
fig.update_layout(showlegend=False, template="plotly_dark")
# Lignes horizontales et verticales indiquant (z_max,Vmax)
fig.add_scatter(x=[5667,5667],y=[0,30], mode="lines+markers", marker=dict(size=5, color="MediumPurple"), text='zmax',hoverinfo="text",line=dict(color='MediumPurple', dash='dash'))
fig.add_annotation(x=5667, y=0, text='z_max', showarrow=False,yshift=-25)
fig.add_scatter(x=[0,5667],y=[30,30], mode="lines+markers", marker=dict(size=5, color="MediumPurple"), text='Vmax',hoverinfo="text",line=dict(color='MediumPurple', dash='dash'))
fig.add_annotation(x=0, y=30, text='Vmax', showarrow=False,xshift=-25)

fig.show()