2017-06-15 3 views
0

Ich versuche eine Achse innerhalb eines Plot einzufügen, aber ohne den Rahmen. Irgendwie sind die Optionen nicht funktionieren bei allenadd_axes ohne Rahmen

Ich habe folgendes MWe

import matplotlib.pyplot as plt 
import mpl_toolkits.axisartist as AA 

f = plt.figure() 
ax = f.add_subplot(111) 

iax = AA.Axes(f, [0.125, 0.125, 0.775, 0.2], frameon=False) 
f.add_axes(iax, frameon=False) 
iax.set_yticks([]), iax.set_xticks([]) 

plt.show() 

Antwort

1

Der Zweck matplotlib.axisartist der Verwendung nicht klar von der Frage ist. Um rahmenlose Achsen zu erhalten, können Sie figure.add_axes([..], frameon=False):

import matplotlib.pyplot as plt 

f = plt.figure() 
ax = f.add_subplot(111) 

iax = f.add_axes([0.125, 0.125, 0.775, 0.2], frameon=False) 
iax.set_yticks([]), iax.set_xticks([]) 
iax.plot(range(10),[i%4 for i in range(10)]) 

plt.show() 
verwenden
Verwandte Themen