1
我想設置軸和y軸蜱,左側方向並在右側的方向。matplotlib組Y軸蜱
這裏有一段代碼,可以幫助你瞭解什麼,我試圖做
import wx
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg
from matplotlib.figure import Figure
from matplotlib.axes import Axes
class Frame(wx.Frame):
def __init__(self):
# initialize
wx.Frame.__init__(self, None)
# create main sizer
mainSizer = wx.BoxSizer(wx.VERTICAL)
# create figure, canvas and matplotlib toolbar
self.figure = Figure(figsize=(4.5,4), dpi=None)
self.canvas = FigureCanvasWxAgg(self, -1, self.figure)
# add canvas to sizer
mainSizer.Add(self.canvas, proportion=1, flag=wx.ALL|wx.EXPAND)
self.SetSizer(mainSizer)
mainSizer.Fit(self)
self.Show(True)
app = wx.App(0)
frame = Frame()
axes = frame.figure.add_axes((0.1,0.1,0.8,0.8))
axes.tick_params(reset=True)
axes.tick_params(axis='y',which="major", direction="in",
left=True,reset=False, labelleft=True)
axes.tick_params(axis='y',which="major", direction="out",
right=True,reset=False, labelright=True)
frame.canvas.draw()
app.MainLoop()
通常我想左蜱是軸內和正確的蜱被外界
謝謝,我已經想到了雙軸,但不幸的是它不適合我的情況。我寫的代碼是一個簡單的例子來說明我想要做什麼。 – Cobry 2014-09-05 02:50:56
@Cobry是的,完全有道理。只是想我會提供它以防萬一。 – Ajean 2014-09-05 04:47:36