[Matplotlib-users] Many basic questions i cant find solution
Hello, i am not a user of matplotlib, i just have to do something in it. I managed to get the plot i wanted, but i have been going around for hours trying to do some fine tuning and cant get around it. The matplotlib seems way too extense for me to find the solutions without studying it avidly, and i just dont have the time... But trust me, i've looked everywhere and tried everything... What i need to do is: - Change the axes labeling (if its like 1 2 3 4 5 6 change it to A B C D for example) - Resize the window, not the plot (I have the figsize=(6,10) and thats fine for the plot, but the colorbar just gets cut in half, cant fit in the window) Thankyou in advance -- View this message in context: http://old.nabble.com/Many-basic-questions-i-cant-find-solution-tp31088840p31088840.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- What You Don't Know About Data Connectivity CAN Hurt You This paper provides an overview of data connectivity, details its effect on application quality, and explores various alternative solutions. http://p.sf.net/sfu/progress-d2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Many basic questions i cant find solution
Thankyou for the reply, ill test that in a minute, and let you know the result. Benjamin Root-2 wrote: > > On Mon, Mar 7, 2011 at 10:01 AM, Muffles wrote: > > Can you include a screenshot of what you see? > > Here it is: http://old.nabble.com/file/p31089197/hov.png Thank you -- View this message in context: http://old.nabble.com/Many-basic-questions-i-cant-find-solution-tp31088840p31089197.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- What You Don't Know About Data Connectivity CAN Hurt You This paper provides an overview of data connectivity, details its effect on application quality, and explores various alternative solutions. http://p.sf.net/sfu/progress-d2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Many basic questions i cant find solution
Benjamin Root-2 wrote: > > > Note that will not change the number of ticks already established for the > axis. For that, you can use set_xticks(), which accepts a list of values > where to set the tick marks (you should probably use set_xticklabels() > after > set_xticks()). Note that you will need to have access to the axes object. > For example: > > > import matplotlib.pyplot as plt > > fig = plt.figure() > ax = fig.gca() # <--- the axes object I was talking about... > ax.scatter([], []) > ax.set_xticks([0.2, 0.4, 0.6, 0.8]) > ax.set_xticklabels(['A', 'B', 'C', 'D']) > plt.show() > > > > Well this just plots 2 different imagens now, one with only the axis, and the other with the data and a default axis -- View this message in context: http://old.nabble.com/Many-basic-questions-i-cant-find-solution-tp31088840p31104901.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Many basic questions i cant find solution
Benjamin Root-2 wrote: > > > Could you please include your code? My code was merely a > demonstration and not meant to be copy and pasted in it's entirety. > > Ben Root > > Thx, but I fixed that already, it was my error. Still dont cant fix the width of the window though... -- View this message in context: http://old.nabble.com/Many-basic-questions-i-cant-find-solution-tp31088840p31107217.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Many basic questions i cant find solution
Benjamin Root-2 wrote: > > > And, without the code, I can't help you. Please include a small script > that > I can run that demonstrates the problem. I can't reproduce your bug based > on your description. > > Ben Root > > Here it is, i think this works fig=figure(figsize=(5,9)) pcolor(rand(1000,60)) ax = fig.gca() ax.set_yticks(np.arange(0, 1000, 100)) #define a legenda dos eixos ax.set_yticklabels([0,1,2,3,4,5,6,7,8,9,10]) plt.axis((0,60,0,1000)) #corta os eixos cax = axes([0.93, 0.1, 0.15, 0.8]) # setup colorbar axes colorbar(cax=cax) # draw colorbar plt.show() -- View this message in context: http://old.nabble.com/Many-basic-questions-i-cant-find-solution-tp31088840p31107693.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Changing labels to time
Hello all, i have certain dates that i want to use as the xlabels, i have looked around but found nothing i can use. I get the date from the netcdf file in a format something like a timestamp, like: 16216 that i turn into 04:30:16 I want to know how can i use this as a label. Thx in advance -- View this message in context: http://old.nabble.com/Changing-labels-to-time-tp31260038p31260038.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Computer freezes plotting
Hello all, i have made a python script to plot some netcdf files that go from 4mb to 80mb, and the main purpose is to plot one after another. This seems to work fine, no problems there, but sometimes the computer crashes and i belive its beacause the files are too big. Is there any way to accelerate the plot time or reduce memory consumption? If your asking whats the error, well, actually i get no error, it just never finishes plotting. I tried to wait for like 10 hours, and nothing happened so i assume it crashed. Thx in advance -- View this message in context: http://old.nabble.com/Computer-freezes-plotting-tp31331581p31331581.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Xperia(TM) PLAY It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games. http://p.sf.net/sfu/verizon-sfdev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] "minvalue must be less than or equal to maxvalue" error
Hello all, i created some program to read from netcdf files and plot the data, and it seems to work ok. But when i try to run an older file, it just shows this: Traceback (most recent call last): File "netcdf2png.py", line 199, in savefig("range.png") File "/usr/lib/pymodules/python2.6/matplotlib/pyplot.py", line 356, in savefig return fig.savefig(*args, **kwargs) File "/usr/lib/pymodules/python2.6/matplotlib/figure.py", line 1032, in savefig self.canvas.print_figure(*args, **kwargs) File "/usr/lib/pymodules/python2.6/matplotlib/backend_bases.py", line 1476, in print_figure **kwargs) File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py", line 358, in print_png FigureCanvasAgg.draw(self) File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py", line 314, in draw self.figure.draw(self.renderer) File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "/usr/lib/pymodules/python2.6/matplotlib/figure.py", line 773, in draw for a in self.axes: a.draw(renderer) File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 1735, in draw a.draw(renderer) File "/usr/lib/pymodules/python2.6/matplotlib/collections.py", line 704, in draw return Collection.draw(self, renderer) File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "/usr/lib/pymodules/python2.6/matplotlib/collections.py", line 201, in draw self.update_scalarmappable() File "/usr/lib/pymodules/python2.6/matplotlib/collections.py", line 477, in update_scalarmappable self._facecolors = self.to_rgba(self._A, self._alpha) File "/usr/lib/pymodules/python2.6/matplotlib/cm.py", line 166, in to_rgba x = self.norm(x) File "/usr/lib/pymodules/python2.6/matplotlib/colors.py", line 825, in __call__ raise ValueError("minvalue must be less than or equal to maxvalue") ValueError: minvalue must be less than or equal to maxvalue Any ideas? Thx in advance -- View this message in context: http://old.nabble.com/%22minvalue-must-be-less-than-or-equal-to-maxvalue%22-error-tp31422145p31422145.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] OverflowError: math range error
Hello all, I am getting this error, and im not very experienced with matplotlib, but in most files this code worked, but in some i just get this error: Traceback (most recent call last): File "/home/paoli/public_html/netcdf2png.py", line 128, in colorbar = fig.colorbar(pc) File "/usr/lib/python2.5/site-packages/matplotlib/figure.py", line 1022, in colorbar cb = cbar.Colorbar(cax, mappable, **kw) File "/usr/lib/python2.5/site-packages/matplotlib/colorbar.py", line 616, in __init__ ColorbarBase.__init__(self, ax, **kw) File "/usr/lib/python2.5/site-packages/matplotlib/colorbar.py", line 214, in __init__ self.draw_all() File "/usr/lib/python2.5/site-packages/matplotlib/colorbar.py", line 225, in draw_all self._config_axes(X, Y) File "/usr/lib/python2.5/site-packages/matplotlib/colorbar.py", line 252, in _config_axes ticks, ticklabels, offset_string = self._ticker() File "/usr/lib/python2.5/site-packages/matplotlib/colorbar.py", line 388, in _ticker b = np.array(locator()) File "/usr/lib/python2.5/site-packages/matplotlib/ticker.py", line 1006, in __call__ vmax = math.log(vmax)/math.log(b) OverflowError: math range error Traceback (most recent call last): File "/home/paoli/public_html/netcdf2png.py", line 128, in colorbar = fig.colorbar(pc) File "/usr/lib/python2.5/site-packages/matplotlib/figure.py", line 1022, in colorbar cb = cbar.Colorbar(cax, mappable, **kw) File "/usr/lib/python2.5/site-packages/matplotlib/colorbar.py", line 616, in __init__ ColorbarBase.__init__(self, ax, **kw) File "/usr/lib/python2.5/site-packages/matplotlib/colorbar.py", line 214, in __init__ self.draw_all() File "/usr/lib/python2.5/site-packages/matplotlib/colorbar.py", line 225, in draw_all self._config_axes(X, Y) File "/usr/lib/python2.5/site-packages/matplotlib/colorbar.py", line 252, in _config_axes ticks, ticklabels, offset_string = self._ticker() File "/usr/lib/python2.5/site-packages/matplotlib/colorbar.py", line 388, in _ticker b = np.array(locator()) File "/usr/lib/python2.5/site-packages/matplotlib/ticker.py", line 1006, in __call__ vmax = math.log(vmax)/math.log(b) OverflowError: math range error Is there any workaround? Thx in advance! -- View this message in context: http://old.nabble.com/OverflowError%3A-math-range-error-tp31423048p31423048.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Re size the colorbar
Ive seen lots of examples around, but i cant seem to adapt any to my implementation. The only thing i want is to change what values the colorbar shows. In the colorbar there are values from 1 to 1e+9, and im only interested in the values from 1e+4 to 1e+9... pc = ax.pcolor(pr[2].transpose(),norm=LogNorm(vmin=1),cmap=cm.jet) ax.set_yticks(np.arange(0-(arr_agl[0]*escala)/1000, (arr_agl[600]*escala)/1000, escala)) ax.set_yticklabels(range(20)) ax.set_ylim(0, 600) ax.set_xlim(0,len(valores2)) ax.xaxis.LABELPAD = 18 for label in ax.get_xticklabels() + ax.get_yticklabels(): label.set_fontsize(16) plt.xlabel('Time of Measurement',fontsize=16) plt.ylabel('HEIGHT above ground level, km',fontsize=16) colorbar = fig.colorbar(pc) Thx... -- View this message in context: http://old.nabble.com/Resize-the-colorbar-tp31425316p31425316.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Re size the colorbar
efiring wrote: > > > Have you tried using vmin=1e4 above? > > Well that did the trick...how did i miss that...thankyou! -- View this message in context: http://old.nabble.com/Resize-the-colorbar-tp31425316p31432430.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users