"plot not defined" and / or "twinx not defined"

Please make an MWE that reproduces your error:

In particular for this example it would be important to understand which packages are using and how you are loading them.