Hi,

I have the same behaviour with LocatableAxes. HostAxes, ParasiteAxes and 
LocatableAxes depend on 'mpl_toolkits.axes_grid.axislines.Axes'. It must 
be the matter origin.
This another example should draw a grid but does not:

import wx
from wx import Frame
from matplotlib.backends.backend_wxagg import FigureFrameWxAgg, 
FigureCanvasWxAgg
from matplotlib.figure import Figure
from mpl_toolkits.axes_grid.axes_divider import LocatableAxes

fig = Figure((1, 1), 50)
axes = LocatableAxes(fig, [0, 0, 1, 1])
# axes.toggle_axisline(False)
axes.grid(True)
fig.add_axes(axes)

app = wx.PySimpleApp()
my_viewer = FigureFrameWxAgg(-1, fig)
my_viewer.Show()
app.MainLoop()

If you uncomment axes.toggle_axisline(False), it works cause it uses 
normal 'matplolib.axes.Axes' behaviour. It is not a matter for common 
use but if you need 'AxesZero', this trick does not work.

Yann


On 09/07/2009 10:37 PM, Andreas Fromm wrote:
> thanks Sebastian,
>
> you are right, your code works here too. But i don't get it work in my
> multi y-axes plot from the matplotlib examples
> (http://matplotlib.sourceforge.net/examples/axes_grid/demo_parasite_axes.html).
> Even with linear plots, i get no gridlines.
>
> Any idea, whats wrong here?
>
> minimal code example:
> #######################
> import matplotlib.pyplot as plt
> from mpl_toolkits.axes_grid.parasite_axes import HostAxes, ParasiteAxes
>
> fig = plt.figure(1)
> fig.clf()
> #plt.grid(True)
> host = HostAxes(fig, [0.15, 0.1, 0.65, 0.8])
> fig.add_axes(host)
>
> host.plot([0, 10, 100], [0, 10, 100], label='host')
>
> host.grid(True)  #?
> host.yaxis.grid(True) #?
>
> host.yaxis.set_scale('log') #?
>
> plt.draw()
> plt.show()
> #######################
>
> Greets,
> Andreas
>
>
> Sebastian Busch schrieb:
>    
>> from matplotlib.pyplot import *
>>
>> plot([1,10,100],[1,10,100])
>> grid()
>>
>> yscale('log')
>> xscale('log')
>>
>> works here.
>>
>> best,
>> sebastian.
>>
>>      
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>    




------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to