You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
|
1
(14) |
2
(11) |
3
(5) |
4
(17) |
5
(11) |
6
(37) |
7
(35) |
8
(9) |
9
(1) |
10
(9) |
11
(7) |
12
(22) |
13
(34) |
14
(24) |
15
(27) |
16
(13) |
17
(19) |
18
(43) |
19
(36) |
20
(12) |
21
(9) |
22
(21) |
23
(3) |
24
(5) |
25
(30) |
26
(14) |
27
(23) |
28
(19) |
29
(19) |
30
(10) |
31
(6) |
|
|
|
|
|
|
On Mon, May 25, 2009 at 12:32 PM, Esmail <eb...@ho...> wrote: > Hi all, > > I'm new to pylab/matplotlib, so perhaps I am making a mistake here, > but when I try to save a plot under Windows as a png file, the program > crashes (pdf works fine). > I don't have a windows box to test on today (I can try tomorrow from work). Most likely, you have a problem of an install over an old install. Try installing mpl and numpy cleanly by removing all the numpy* and matplotlib* files from your site-packages dir and reinstalling. See also http://matplotlib.sourceforge.net/faq/troubleshooting_faq.html#matplotlib-install-location http://matplotlib.sourceforge.net/faq/installing_faq.html#cleanly-rebuild-and-reinstall-everything JDH
On Mon, May 25, 2009 at 12:35 PM, Alan G Isaac <ala...@gm...> wrote: > What is the "right" way to produce date-range bars, > like the recession bars in > http://research.stlouisfed.org/fred2/series/TB3MS?cid=116 axvspan. See http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.Axes.axvspan http://matplotlib.sourceforge.net/examples/pylab_examples/axhspan_demo.html JDH
On Mon, May 25, 2009 at 7:16 AM, <jor...@ya...> wrote: > > > Hi, > I am trying to use matplotlib to visually explore some data. I started > from the "event_handling example code: data_browser.py" example, but > wanted to go a bit further. The idea is to have two plots and an image > linked together. The first plot represents a measure calculated from > an image region at different times of the day. Selecting one of this > measures shows the corresponding image, and some other measure calculated > from the individual pixels. Further on, selecting in the image or the > second plot should highlight the corresponding point in the plot or pixel > on the image, respectively (That is, the first plot is linked to the image, > and the image and the second plot are linked together). > My problem is that on the function being called upon and event, I always > get events generated by the image, even when the moused was clicked on one of > the other plots. The plots behave ok. > The coded below is a simplified functional version (the measures here are > trivial, and I haven't included the actions when the user selects the image or > the second plot), which exhibits this behavior. What I see when executing this > code is for example: > It looks like you found a pretty significant bug -- the Artist.pick method forwards the event to all of it's children, whether or not the pick event happened in the same Axes as the event being queried. Not only is this inefficient, it can create false positives when the two axes share a similar coord system. I just committed a fix to svn, to make sure the artist axes instance is the same as the pick event inaxes attribute before forwarding on the call. artist.Artist.pick now reads: # Pick children for a in self.get_children(): # make sure the event happened in the same axes ax = getattr(a, 'axes', None) if mouseevent.inaxes==ax: a.pick(mouseevent) This seems to fix the problem you identified -- give svn r7141 or later a test drive if you have access http://matplotlib.sourceforge.net/faq/installing_faq.html#install-from-svn JDH
What is the "right" way to produce date-range bars, like the recession bars in http://research.stlouisfed.org/fred2/series/TB3MS?cid=116 Thanks, Alan Isaac
Hi all, I'm new to pylab/matplotlib, so perhaps I am making a mistake here, but when I try to save a plot under Windows as a png file, the program crashes (pdf works fine). This is the short script I am running: ------------- import pylab as plt plt.grid(True) # plot a point x = 1.5 y = 0.7 plt.plot([x], [y], 'ro') plt.show() #plt.savefig('plot_point2.pdf') plt.savefig('plot_point2.png') -------------- Win XP Prof, SP 2. Downloaded maptplotlib 0.98.5.3 today along with numpy 1.3.0 (running Python 2.6.1). Can someone else reproduce this problem? Is this a known problem? Thanks, Esmail
Jean-Christophe Penalva wrote: > Hello, > > i draw some rectangle (with PolyCollection) on one figure. I'd like to put > around (on the right vertical, or at the bottom horizontal) a colormap > with the > min and max values (as in > http://matplotlib.sourceforge.net/examples/pylab_examples/colorbar_tick_labelling_demo.html) > > > Here is a part of my code > > ... > c = collections.PolyCollection(list_rect) > c.set_array(liste_colormap) > c.set_cmap(cm.hot) c is a PolyCollection instance > fig = plt.figure(figsize=(16, 12)) > ax = fig.add_subplot(111) > ax.add_collection(c) > ax.set_xlim(xorig, xmax) > ax.set_ylim(yorig, ymax) > ax.set_yticks((ymax/6, (ymax/6)*3, (ymax/6)*5)) > ax.set_yticklabels(('Rangee 1', 'Rangee 2','Rangee 3')) > plt.title(str(num_semaine)+"-"+str(annee)) > cmap=cmap,norm=norm,orientation='horizontal') > plt.colorbar(cax=c, ax=ax) but cax is looking for an axes instance in which to draw the colorbar. Try omitting that kwarg. The colorbar axes will be made automatically. Eric > plt.plot() > plt.savefig("s"+str(num_semaine)+"-"+str(annee)+".png") > > At the end, there's a message : > Traceback (most recent call last): > File "/.../graph4.1.2.py", line 260, in <module> > plt.colorbar(cax=c, ax=ax) > File "/usr/lib/python2.6/dist-packages/matplotlib/pyplot.py", line > 1326, in > colorbar > ret = gcf().colorbar(mappable, cax = cax, ax=ax, **kw) > File "/usr/lib/python2.6/dist-packages/matplotlib/figure.py", line > 1002, in > colorbar > cax.hold(True) > AttributeError: 'PolyCollection' object has no attribute 'hold' > > Any idea ?? > > Thank you. > > ###################################################################### > Jean-Christophe Penalva > Centre Informatique National de l'Enseignement Superieur (CINES) > Montpellier, FRANCE > Tel : 33 4 67 141 414 Fax : 33 4 67 523 763 > http://www.cines.fr/ > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT > is a gathering of tech-side developers & brand creativity professionals. Meet > the minds behind Google Creative Lab, Visual Complexity, Processing, & > iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian > Group, R/GA, & Big Spaceship. http://www.creativitycat.com > > > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
On Mon, May 25, 2009 at 9:02 AM, collern2 <noe...@gm...> wrote: > > I'm trying to have the points start from the x-axis (similar to a histogram) > and draw lines upwards. I've attached an image of the program output, as you > can see - there are no red lines from 0-200 on the y-axis. Any ideas how to > start them from zero? > > http://www.nabble.com/file/p23707480/image.png > > Sample value from list entry for time[] > 693596.000003 > Sample value from list entry for latency[] > 1043 > > ######### > Sample Code > ######### > > > def plot_graph(): > > # Plotting the graph > plt.plot(time[5300:],latency[5300:], 'r-', linewidth=0.15) It sounds like you want vlines http://matplotlib.sourceforge.net/search.html?q=codex+vlines http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.Axes.vlines Eg, plt.vlines(time[5300:], 0, latenc[5300:], color='red', lw=0.15) JDH
<HTML> <HEAD> <META content="text/html; charset=iso-8859-9" http-equiv=Content-Type> <META content="OPENWEBMAIL" name=GENERATOR> </HEAD> <BODY bgColor=#ffffff> <font size="2"> Hello, <br /> <br /> i draw some rectangle (with PolyCollection) on one figure. I'd like to put <br /> around (on the right vertical, or at the bottom horizontal) a colormap with the <br /> min and max values (as in <br /> <a target="_blank" href="http://matplotlib.sourceforge.net/examples/pylab_examples/colorbar_tick_labelling_demo.html">http://matplotlib.sourceforge.net/examples/pylab_examples/colorbar_tick_labelling_demo.html</a>) <br /> <br /> Here is a part of my code <br /> <br /> <span style="font-family: courier new,courier,monospace;">... </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> c = collections.PolyCollection(list_rect) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> c.set_array(liste_colormap) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> c.set_cmap(cm.hot) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> fig = plt.figure(figsize=(16, 12)) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> ax = fig.add_subplot(111) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> ax.add_collection(c) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> ax.set_xlim(xorig, xmax) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> ax.set_ylim(yorig, ymax) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> ax.set_yticks((ymax/6, (ymax/6)*3, (ymax/6)*5)) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> ax.set_yticklabels(('Rangee 1', 'Rangee 2','Rangee 3')) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> plt.title(str(num_semaine)+"-"+str(annee)) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> cmap=cmap,norm=norm,orientation='horizontal') </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> plt.colorbar(cax=c, ax=ax) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> plt.plot() </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> plt.savefig("s"+str(num_semaine)+"-"+str(annee)+".png") </span> <br /> <br /> At the end, there's a message : <br /> <span style="font-family: courier new,courier,monospace;">Traceback (most recent call last): </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> File "/.../graph4.1.2.py", line 260, in <module> </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> plt.colorbar(cax=c, ax=ax) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> File "/usr/lib/python2.6/dist-packages/matplotlib/pyplot.py", line 1326, in </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> colorbar </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> ret = gcf().colorbar(mappable, cax = cax, ax=ax, **kw) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> File "/usr/lib/python2.6/dist-packages/matplotlib/figure.py", line 1002, in </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> colorbar </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> cax.hold(True) </span> <br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;"> AttributeError: 'PolyCollection' object has no attribute 'hold' </span> <br /> <br /> Any idea ?? <br /> <br /> Thank you. <br /> <br /> ###################################################################### <br /> Jean-Christophe Penalva <br /> Centre Informatique National de l'Enseignement Superieur (CINES) <br /> Montpellier, FRANCE <br /> Tel : 33 4 67 141 414 Fax : 33 4 67 523 763 <br /> <a target="_blank" href="http://www.cines.fr/">http://www.cines.fr/</a> <br /> </font> </BODY> </HTML>
I'm trying to have the points start from the x-axis (similar to a histogram) and draw lines upwards. I've attached an image of the program output, as you can see - there are no red lines from 0-200 on the y-axis. Any ideas how to start them from zero? http://www.nabble.com/file/p23707480/image.png Sample value from list entry for time[] 693596.000003 Sample value from list entry for latency[] 1043 ######### Sample Code ######### def plot_graph(): # Plotting the graph plt.plot(time[5300:],latency[5300:], 'r-', linewidth=0.15) # Define the axes y_label = [0, 200, 400, 600, 800, 1000, 1200] plt.axes().set_xlim(xmin=datetime.datetime(1900,1,1,0,0,0,0), xmax=time[-1]) plt.axes().set_ylim(ymin=0, ymax=1400) plt.axes().set_xticklabels(time, fontdict=None, minor=False, size=10) plt.axes().set_yticklabels(y_label, fontdict=None, minor=False, size=10) # Labeling the graph ax = p.subplot(111) ax.xaxis.set_major_locator(MaxNLocator(7)) plt.gca().xaxis.set_major_formatter(DateFormatter('%M:%S')) plt.xlabel(x_axis) plt.ylabel(y_axis) plt.title(title) # Grid plt.grid(True) plt.grid(alpha=0.1, color='black', linestyle='-', linewidth=0.1) plt.savefig(figure) # plot the graph plot_graph() -- View this message in context: http://www.nabble.com/Ensure-vertical-lines-start-from-x-axis-tp23707480p23707480.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Hi, I am trying to use matplotlib to visually explore some data. I started from the "event_handling example code: data_browser.py" example, but wanted to go a bit further. The idea is to have two plots and an image linked together. The first plot represents a measure calculated from an image region at different times of the day. Selecting one of this measures shows the corresponding image, and some other measure calculated from the individual pixels. Further on, selecting in the image or the second plot should highlight the corresponding point in the plot or pixel on the image, respectively (That is, the first plot is linked to the image, and the image and the second plot are linked together). My problem is that on the function being called upon and event, I always get events generated by the image, even when the moused was clicked on one of the other plots. The plots behave ok. The coded below is a simplified functional version (the measures here are trivial, and I haven't included the actions when the user selects the image or the second plot), which exhibits this behavior. What I see when executing this code is for example: Actions (click on) Results (from the print statement on the onpick() function) plot1 plot1 image2 image2 image2 plot3 plot3 image2 Am I doing something wrong? I am new to both python and matplotlib, so if you see something that could be done in a better way, please tell me. Jorges ----- Test code ----- import os import sys import glob import re import fnmatch import Image as im import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import scipy as sp import scipy.stats class LCRBrowser(): """ Permits to visualize log chromaticity ratios and related things for analysing static images taken at throughout a period of time """ def __init__(self, data): # Initialize instance attributes self.lcr = np.asarray(map((lambda x: x['lcr']), data)) self.lcr_ind = np.asarray(map((lambda x: x['lcr_ind']), data)) self.img = np.asarray(map((lambda x: x['img']), data)) self.lastind = 0 # Initial drawing and picking init self.fig = plt.figure() self.ax1 = self.fig.add_subplot(311) self.ax2 = self.fig.add_subplot(312) self.ax3 = self.fig.add_subplot(313) self.plot1, = self.ax1.plot(self.lcr, 'o', picker=5) self.selected, = self.ax1.plot([self.lcr[0]], 'o', ms=12, alpha=0.4, color='yellow', visible=False) self.img2 = self.ax2.imshow(self.img[0], visible=True, picker=2,\ interpolation='nearest') self.plot3, = self.ax3.plot(self.lcr_ind[0][:], 'o', visible=True, picker=5) print type(self.plot3) self.fig.canvas.mpl_connect('pick_event', self.onpick) self.fig.canvas.draw() def onpick(self, event): x2 = event.mouseevent.ydata if event.artist == self.plot1: print 'plot1\n' N = len(event.ind) if not N: return True distances = x2-self.lcr[event.ind] indmin = distances.argmin() dataind = event.ind[indmin] self.lastind = dataind elif event.artist == self.img2: print 'img2\n' elif event.artist == self.plot3: print 'plot3\n' else: print 'didn\'t detect artist' print str(event.artist) return True self.update() def update(self): if self.lastind is None: return ind = self.lastind self.img2.set_data(self.img[ind]) a = self.lcr_ind[ind][:] self.plot3.set_data((range(len(a)), a)) self.fig.canvas.draw() def main(): results = [] for name in range(5): img = np.random.rand(5,4,3) lcr = sp.stats.gmean(np.mean(np.mean(img, 0), 0)) lcr_ind = sp.stats.gmean(img, 2).reshape(-1,1) result = {'lcr': lcr, 'lcr_ind':lcr_ind, 'img':img} results.append(result) LCRBrowser(results) if __name__ == '__main__': main() ----- code end -----
Forgot to cc the list.....JRC John R. Cary wrote: > John Hunter wrote: >> On Sun, May 24, 2009 at 11:18 AM, John R. Cary <ca...@tx...> wrote: >> >>> $ python setup.py install --prefix=/d/facets/contrib >>> ============================================================================ >>> >>> BUILDING MATPLOTLIB >>> matplotlib: 0.98.5 >>> python: 2.5.2 (r252:60911, Dec 15 2008, 17:11:36) [GCC >>> 3.4.6 20060404 (Red Hat 3.4.6-10)] >>> platform: linux2 >>> >>> REQUIRED DEPENDENCIES >>> numpy: 1.2.1.1 >>> freetype2: 9.7.3 >>> >>> OPTIONAL BACKEND DEPENDENCIES >>> libpng: 1.2.7 >>> connect 173.8.244.121 port 6000: Connection timed out >>> X connection to foo.bar.com:12.0 broken (explicit kill or server >>> shutdown). >>> >>> Is this expected? Any way around? >>> >>> Thanks......John Cary >>> >> >> It is not expected in that I do not know why the connection was broken >> (did it once exits, do you expect X connectivity in your build >> environment?). I am not sure why the X connection was broken, whether >> you wanted it, or whether you wanted it to persist. mpl can be built >> w/o an X connection, but not all of the mpl backends can. Details on >> all of the mpl backends can be found here: >> >> http://matplotlib.sourceforge.net/faq/installing_faq.html#backends >> >> A plain vanilla mpl install which can generate PS, PDF, SVG and PNG >> should be buildable w/o an X connection. You can copy the >> setup.cfg.template file which lives alongside setup.py to setup.cfg >> and edit it to turn off optional GUI backend building. >> >> But if you want an mpl install that works with one or more GUIs, you >> may need an X connnection. That is because mpl tries to import one or >> more GUI toolkits at build time to see if they are present as part of >> an auto-configure routine. If they are present, we try and build our >> extensions for them. So, for example, when we try and import pygtk to >> see if we should build our gtk extensions, an X connection is made. >> You might be able to work around this by explicitly stating in >> setup.cfg which backends you want to build, turning off all >> non-essential ones. >> >> > Thanks for your help. Uncommenting the GUI front end lines, > > #gtk = False > #gtkagg = False > #tkagg = False > #wxagg = False > #macosx = False > > allowed this to build. > > Then going back and ssh'ing to the machine with X-forwarding (-Y) worked > as well. I don't understand enough to know why the second worked, but > it did. > > Best regards....John Cary > > > >
On Mon, May 25, 2009 at 1:03 AM, Robert Cimrman <cim...@nt...> wrote: > Ondrej Certik wrote: >> >> On Fri, May 22, 2009 at 3:37 PM, Ondrej Certik <on...@ce...> wrote: >>> >>> Thanks a lot John. I tried that and it does what I want. I just need >>> to convert and probably average my 3 different values at the 3 >>> vertices of the triangle and color the triangle with that color. When >>> I get it working, I'll send you a picture. :) >> >> Ok, I made a progress, it seems it's working. Script and picture >> attached. You can compare to the mayavi plot above, it's almost >> identical now. It took my some time playing with different parameters >> of mpl to get here and I think it looks quite good. Still one can see >> the artefacts though as John predicted, due to mpl not interpolating >> the triangles. > > Nice! > > Just to prod you a bit: If you want to get rid of the hard mayavi dependence > of femhub for 3D plots too, you could hack a (perspective/whatever) > projection of 3D surface to 2D, remove invisible faces (normal points > backwards) and plot the rest by the painter's algorithm (far faces first). Well, I spent one afternoon playing with cairo, trying to implement the triangle interpolation and the result was slower than matplotlib. So gave up and I'll just use what can be done with mpl currently. As to mayavi, I'd rather make it easier to install. The only tough dependency is VTK, that takes lots of time to build, we already got rid of all the others, so that's good. Ondrej
Ondrej Certik wrote: > On Fri, May 22, 2009 at 3:37 PM, Ondrej Certik <on...@ce...> wrote: >> Thanks a lot John. I tried that and it does what I want. I just need >> to convert and probably average my 3 different values at the 3 >> vertices of the triangle and color the triangle with that color. When >> I get it working, I'll send you a picture. :) > > Ok, I made a progress, it seems it's working. Script and picture > attached. You can compare to the mayavi plot above, it's almost > identical now. It took my some time playing with different parameters > of mpl to get here and I think it looks quite good. Still one can see > the artefacts though as John predicted, due to mpl not interpolating > the triangles. Nice! Just to prod you a bit: If you want to get rid of the hard mayavi dependence of femhub for 3D plots too, you could hack a (perspective/whatever) projection of 3D surface to 2D, remove invisible faces (normal points backwards) and plot the rest by the painter's algorithm (far faces first). r.
On Tue, 2009年05月19日 at 10:50 +0200, Thomas Pfaff wrote: > Hello there, > > when I started with matplotlib I was really enthusiastic that I can throw > all those Excel, IDL, Matlab and whatever else I used until now overboard > and do everything from data processing to visualization in beloved Python. > > Now, here at work I have to use a Windows PC and PowerPoint and graphics > just look best in PowerPoint if they are in EMF format. > Funny enough there seems to be no converter on the market to properly > convert any other vector format matplotlib can produce to EMF. Even the way > via Inkscape fails even with simple plots. > > If I'm wrong about the converter, please tell me and bury EMF-support. > If not, what would you think would be the effort and the time needed to port > the emf-backend to the latest version of matplotlib? I might at least give > it a try. EMF support in OpenOffice is quite good (OOo uses emf internally, I believe). You can import either SVG or PDF into OOo-Draw using the respective OOo-extension and export as emf from there. bc
per freem wrote: > hi eric, > > i tried your suggestion but it still did not work. here's a code > snippet that demonstrates what i am trying to do: No, I'm still baffled. If you stack 3 subplots vertically in a figure 6 inches high, they are going to be small. You can fiddle with their sizes a bit by using subplots_adjust, but they are still going to be small--less than 2 inches high. What physical dimensions do you want, when you say you want the plot to be "scaled bigger"? Eric > > import matplotlib.pyplot as > plt > from scipy import > * > > > my_fig = plt.figure(figsize=(7,6), > dpi=100) > plot_ax1 = > plt.subplot(3,1,1) > a = > rand(100) > > b = rand(100) + > rand() > plt.scatter(a, > b) > plot_ax1.set(xticklabels=[]) > > plot_ax1.set_aspect('equal', > adjustable='box') > plt.savefig('myplot.pdf') > > > > when i run this, i get a small square scatter plot in the middle of the > page. i want this plot to be scaled to be bigger. if i remove the > set_aspect() call, the plot becomes bigger in the horizontal direction, > and is rectangular. > > any ideas how to fix this? thanks again. > > On Sun, May 24, 2009 at 9:24 PM, Eric Firing <ef...@ha... > <mailto:ef...@ha...>> wrote: > > per freem wrote: > > hi all, > > i have a series of subplots organized in a column (3x1). i > noticed that if i plot them then matplotlib tends to make the > x-axis long and the y-axis short, so the plot is really > rectangular. how can i make it more square? if i do: > > f = figure(figsize=(7,6), dpi=100) > p1 = subplot(3,1,1) > plot(....) > # make axes square > p1.set_aspect('equal') > > p2 = subplot(3,1,2) > plot(....) > p2.set_aspect('equal') > > # etc for third subplot... > > then the subplots i get are square, but very small and squished > compared to the space they have in the figure (ie what i set in > figsize.) how can i fix this? i just want to have square axes, > but have each subplot take up as much space as it would if i > didnt set square axes... it works fine for the rectangular axes > case. > > > Maybe what you are looking for is > p1.set_aspect('equal', adjustable='datalim') > > It is not clear from your message, but try the modification above > and see if it does what you want. > > Eric > >
"John R. Cary" <ca...@tx...> writes: > $ python setup.py install --prefix=/d/facets/contrib > connect 173.8.244.121 port 6000: Connection timed out > X connection to foo.bar.com:12.0 broken (explicit kill or server shutdown). Try unsetting your DISPLAY environment variable, e.g. env DISPLAY= python setup.py install --prefix=/d/facets/contrib -- Jouni K. Seppänen http://www.iki.fi/jks
hi eric, i tried your suggestion but it still did not work. here's a code snippet that demonstrates what i am trying to do: import matplotlib.pyplot as plt from scipy import * my_fig = plt.figure(figsize=(7,6), dpi=100) plot_ax1 = plt.subplot(3,1,1) a = rand(100) b = rand(100) + rand() plt.scatter(a, b) plot_ax1.set(xticklabels=[]) plot_ax1.set_aspect('equal', adjustable='box') plt.savefig('myplot.pdf') when i run this, i get a small square scatter plot in the middle of the page. i want this plot to be scaled to be bigger. if i remove the set_aspect() call, the plot becomes bigger in the horizontal direction, and is rectangular. any ideas how to fix this? thanks again. On Sun, May 24, 2009 at 9:24 PM, Eric Firing <ef...@ha...> wrote: > per freem wrote: > >> hi all, >> >> i have a series of subplots organized in a column (3x1). i noticed that if >> i plot them then matplotlib tends to make the x-axis long and the y-axis >> short, so the plot is really rectangular. how can i make it more square? if >> i do: >> >> f = figure(figsize=(7,6), dpi=100) >> p1 = subplot(3,1,1) >> plot(....) >> # make axes square >> p1.set_aspect('equal') >> >> p2 = subplot(3,1,2) >> plot(....) >> p2.set_aspect('equal') >> >> # etc for third subplot... >> >> then the subplots i get are square, but very small and squished compared >> to the space they have in the figure (ie what i set in figsize.) how can i >> fix this? i just want to have square axes, but have each subplot take up as >> much space as it would if i didnt set square axes... it works fine for the >> rectangular axes case. >> > > Maybe what you are looking for is > p1.set_aspect('equal', adjustable='datalim') > > It is not clear from your message, but try the modification above and see > if it does what you want. > > Eric >
On Sun, May 24, 2009 at 11:18 AM, John R. Cary <ca...@tx...> wrote: > $ python setup.py install --prefix=/d/facets/contrib > ============================================================================ > BUILDING MATPLOTLIB > matplotlib: 0.98.5 > python: 2.5.2 (r252:60911, Dec 15 2008, 17:11:36) [GCC > 3.4.6 20060404 (Red Hat 3.4.6-10)] > platform: linux2 > > REQUIRED DEPENDENCIES > numpy: 1.2.1.1 > freetype2: 9.7.3 > > OPTIONAL BACKEND DEPENDENCIES > libpng: 1.2.7 > connect 173.8.244.121 port 6000: Connection timed out > X connection to foo.bar.com:12.0 broken (explicit kill or server shutdown). > > Is this expected? Any way around? > > Thanks......John Cary It is not expected in that I do not know why the connection was broken (did it once exits, do you expect X connectivity in your build environment?). I am not sure why the X connection was broken, whether you wanted it, or whether you wanted it to persist. mpl can be built w/o an X connection, but not all of the mpl backends can. Details on all of the mpl backends can be found here: http://matplotlib.sourceforge.net/faq/installing_faq.html#backends A plain vanilla mpl install which can generate PS, PDF, SVG and PNG should be buildable w/o an X connection. You can copy the setup.cfg.template file which lives alongside setup.py to setup.cfg and edit it to turn off optional GUI backend building. But if you want an mpl install that works with one or more GUIs, you may need an X connnection. That is because mpl tries to import one or more GUI toolkits at build time to see if they are present as part of an auto-configure routine. If they are present, we try and build our extensions for them. So, for example, when we try and import pygtk to see if we should build our gtk extensions, an X connection is made. You might be able to work around this by explicitly stating in setup.cfg which backends you want to build, turning off all non-essential ones. JDH
per freem wrote: > hi all, > > i have a series of subplots organized in a column (3x1). i noticed that > if i plot them then matplotlib tends to make the x-axis long and the > y-axis short, so the plot is really rectangular. how can i make it more > square? if i do: > > f = figure(figsize=(7,6), dpi=100) > p1 = subplot(3,1,1) > plot(....) > # make axes square > p1.set_aspect('equal') > > p2 = subplot(3,1,2) > plot(....) > p2.set_aspect('equal') > > # etc for third subplot... > > then the subplots i get are square, but very small and squished compared > to the space they have in the figure (ie what i set in figsize.) how can > i fix this? i just want to have square axes, but have each subplot take > up as much space as it would if i didnt set square axes... it works fine > for the rectangular axes case. Maybe what you are looking for is p1.set_aspect('equal', adjustable='datalim') It is not clear from your message, but try the modification above and see if it does what you want. Eric
hi all, i have a series of subplots organized in a column (3x1). i noticed that if i plot them then matplotlib tends to make the x-axis long and the y-axis short, so the plot is really rectangular. how can i make it more square? if i do: f = figure(figsize=(7,6), dpi=100) p1 = subplot(3,1,1) plot(....) # make axes square p1.set_aspect('equal') p2 = subplot(3,1,2) plot(....) p2.set_aspect('equal') # etc for third subplot... then the subplots i get are square, but very small and squished compared to the space they have in the figure (ie what i set in figsize.) how can i fix this? i just want to have square axes, but have each subplot take up as much space as it would if i didnt set square axes... it works fine for the rectangular axes case.
Hello all, I routinely work with images sizes > [1000,1000]. There is a slight annoying problem whatever the backend I use: Pixels coordinates default format is wrong. It does not make sense to display "x=1.42e+03,y=1.92e+03". Pixels coordinates should be formated *by default* as integers. Would it be possible to fix that? Steps to reproduce: import numpy import pylab a=numpy.random.random((2000,2000)) pylab.imshow(a,interpolation='Nearest') Xavier
$ python setup.py install --prefix=/d/facets/contrib ============================================================================ BUILDING MATPLOTLIB matplotlib: 0.98.5 python: 2.5.2 (r252:60911, Dec 15 2008, 17:11:36) [GCC 3.4.6 20060404 (Red Hat 3.4.6-10)] platform: linux2 REQUIRED DEPENDENCIES numpy: 1.2.1.1 freetype2: 9.7.3 OPTIONAL BACKEND DEPENDENCIES libpng: 1.2.7 connect 173.8.244.121 port 6000: Connection timed out X connection to foo.bar.com:12.0 broken (explicit kill or server shutdown). Is this expected? Any way around? Thanks......John Cary
Hi guys, I' m playing around with line collections, and I was wondering if it was possible to use fill with line collections? or maybe I would have to use PolyCollection? would it represents a big challenge to include that in Linecollection? (just to know if I could do it myself eventually) on a not completely related note... is there a sweet spot when LineCollection is faster than multiple over plots?...I'm plotting 1300 lines of 3000 points each...and the overplot solution is still faster (though using 2 or 3 times memory) J. -- View this message in context: http://www.nabble.com/LineCollection-and-fill....-tp23693305p23693305.html Sent from the matplotlib - users mailing list archive at Nabble.com.
--- On Tue, 5/19/09, Thomas Pfaff <ya...@gm...> wrote: > Now, here at work I have to use a Windows PC and PowerPoint > and graphics just look best in PowerPoint if they are in > EMF format. Funny enough there seems to be no converter on > the market to properly convert any other vector format > matplotlib can produce to EMF. Have you tried pstoedit? On Windows, it can convert to EMF. > If not, what would you think would be the effort and the > time needed to port the emf-backend to the latest version > of matplotlib? As far as I can tell, pyemf currently does not contain all the features needed for a fully-functioning matplotlib backend. In particular, bitmap support (to include images in the EMF) and text metrics are missing. So you won't be able to calculate the correct position of text. You'll probably end up with a backend that is less than satisfactory. You may be better off using the postscript or SVG backend, apply a (PS,SVG)-to-EMF converter, and if that doesn't work perfectly, fix the converter rather than matplotlib's EMF backend. --Michiel.
Hello Robert, I studied delaunay and mlab.griddata a bit while converting tinterp and saw the """ tri = delaunay.Triangulation(x,y) # interpolate data interp = tri.nn_interpolator(z) zo = interp(xi,yi) """ stuff. In studying delaunay, however, it was/is not clear to me how to set up the "triangulation" for delaunay.LinearInterpolator(triangulation, z, default_value=-1.#IND) without going through delaunay. Any chance you could give an example of using delaunay to linearly interpolate on mesh x,y assuming data_pts, triangles, f_at_data_points are already given? Best Regards, Eric Robert Kern wrote: > > delaunay has a linear interpolator implemented in C++ that could be used for > this purpose, too. The natural neighbor interpolator is only for Delaunay > triangulations, but the linear interpolator should be usable for general > triangulations. >