Ma première question python, cependant.Comment afficher le graphique qui a été enregistré dans une variable?
Considérez-moi travailler dans le cahier jupyter avec seaborn. Supposons que j'ai créé un terrain et enregistré à une variable:
g = sns.jointplot(ap['ap_lo'], ap['ap_hi']);
Il sera affiché une fois, parce que j'addeed %matplotlib inline
au début.
Maintenant, après quelques changements, je veux afficher g
nouveau:
ax = g.ax_joint
ax.set_xscale('log')
ax.set_yscale('log')
g.ax_marg_x.set_xscale('log')
g.ax_marg_y.set_yscale('log')
sns.plt.show()
Comme vous pouvez le voir, je l'appelle sns.plt.show()
, mais il n'a pas d'effet. J'ai également essayé de mettre g;
ou g; sns.plt.show()
à la fin.
'g.show()' peut-être? –
AttributeError: objet 'JointGrid' n'a aucun attribut 'show' – kelin
La question similaire, qui ne fonctionne pas pour moi: https://stackoverflow.com/q/40965733/3050403 – kelin