From: Stephan M. <zw...@we...> - 2011-02-17 09:20:00
|
Ben, I should have mentioned that I already tried that. When I set the rscale to 'log' the plot crashes when zooming or mpl cannot even create it. Maybe some example code will help: ---------------- from numpy import arange, sin, pi, cos, ones from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg from matplotlib.figure import Figure import Tkinter as Tk root = Tk.Tk() f = Figure(figsize=(5,4), dpi=100) ax = f.add_subplot(111, projection='polar') t = arange(0.0,2*pi,0.01) s1 = ones(len(t))*10 ax.set_rscale('log') ax.plot(t,s1) canvas = FigureCanvasTkAgg(f, master=root) canvas.show() canvas.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1) toolbar = NavigationToolbar2TkAgg(canvas, root) toolbar.update() canvas._tkcanvas.pack(side=Tk.TOP, fill=Tk.BOTH, expand=1) Tk.mainloop() ---------------- Using this code the plot will show up but you can see the 10^-1 and 10^-2 tick labels overlapping in the center. Ok, it shouldn't be a big deal to get rid of them. The major problem is if you try to zoom out, the tick labels move away from the center and if you try to zoom into the plot it eventually throws an exception "ValueError: cannot convert float NaN to integer". If you try to plot smaller values (e.g. replacing the line 's1 = ones(len(t))*10' with 's1 = ones(len(t))') mpl also throws an ValueError exception and does not even create the plot. Let me know if you need full tracebacks. Btw: I am using Matplotlib 1.0.1 and Python 2.6.0 on Windows 64. -- View this message in context: http://old.nabble.com/Polar-plot---problem-with-negative-values-for-radius-tp30936638p30947935.html Sent from the matplotlib - users mailing list archive at Nabble.com. |