pyomeca / bioptim

An optimization framework that links CasADi, Ipopt, ACADOS and biorbd for Optimal Control Problem
MIT License
91 stars 46 forks source link

Add a twinx axis to show scaling on optimization variables #576

Open EveCharbie opened 1 year ago

Ipuch commented 1 year ago

Add this axis for scaled variables on plots.

Example:



def celsius_to_fahrenheit(x):
    return x * 1.8 + 32

def fahrenheit_to_celsius(x):
    return (x - 32) / 1.8

secax_y = ax.secondary_yaxis(
    'right', functions=(celsius_to_fahrenheit, fahrenheit_to_celsius))
secax_y.set_ylabel(r'$T\ [^oF]$')
Ipuch commented 1 year ago

following #572

EveCharbie commented 7 months ago

The bounds on the plots are not scaled either. So there is a mismatch between the variables (scaled) and bounds (unscaled).