Re: [Matplotlib-users] newline characters in tick labels
On Tue, Nov 15, 2011 at 11:55 PM, magurling magurl...@gmail.com wrote: Benjamin Root-2 wrote: Actually, that's how I do it, if I remember correctly. What is your platform and mpl version? I have Ubuntu 11.04, Python 2.7.1+, mpl 1.1.0. I've seen examples in the mpl gallery of two-liner labels, but none that are rotated. Perhaps I didn't look closely enough. Seems to work fine for me using GTKAgg. Which backend are you using? Ben Root -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Web matplotlib
Hello, For what it is worth, I do the folllowing on my matplotlib scripts run from apache on RHEL6. import os os.environ[ 'HOME' ] = '/tmp/' os.environ[ 'USER' ] = 'nobody' import matplotlib matplotlib.use( 'Agg' ) This seems to keep matplotlib from bombing out when it attempts to read dot files, etc. daryl On Mon, Nov 14, 2011 at 4:13 AM, Paul de Beurs paul.debe...@gmail.com wrote: Hey, I work with Mac OSX 10.7.2 I have a probleem. From the IDLE this little program works fine: #!/usr/bin/python import numpy import matplotlib print Content-Type: text/plain\n print matplotlib.__version__ The output is: Content-Type: text/plain 1.1.0 Starting this program from MAMP gives me: Internal Server Error First I change the program into: #!/usr/bin/python import numpy import matplotlib print Content-Type: text/plain\n print 'No error' But starting this program from MAMP also gives me: Internal Server Error Now I change my program into: #!/usr/bin/python import numpy ##import matplotlib print Content-Type: text/plain\n print 'No error' Now starting this program from MAMP gives me: No error So the import of mapplotlib causes this troubles. I don't have these problems with the import of numpy. Can someone help me with this problem? -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] axes_grid1 and colorbar ticks
does someone knows how to specify ticks for a colorbar inside axesgrid? the following does not work as expected: from mpl_toolkits.axes_grid1 import AxesGrid ticks = [.01, .25, .5, .75, .99] grid = AxesGrid() [...] grid.cbar_axes[i].colorbar(im, ticks=ticks) i'm thankfull for any pointers, yoshi -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] MODIS data and true-color plotting
On Sun, Nov 13, 2011 at 12:40 PM, Gökhan Sever gokhanse...@gmail.comwrote: Hello groups, I have two questions about working with MODIS data. 1-) Is there any light Pythonic HDF-EOS wrapper to handle HDF-EOS data other than PyNIO [http://www.pyngl.ucar.edu/Nio.shtml] Although, I have managed to install that package from its source, it took me many hours to figure out all the installation quirks. Something simpler to build and mainly for HDFEOS data?? 2-) Another similar question: Has anybody attempted to create true-color MODIS images (like the ones shown at [ http://rapidfire.sci.gsfc.nasa.gov/realtime/]) in Python? So far, I have seen one clear tutorial [ ftp://ftp.ssec.wisc.edu/pub/IMAPP/MODIS/TrueColor/] to create natural color images, but uses ms2gt [http://nsidc.org/data/modis/ms2gt/], NDVI and IDL. Except the reflectance correction via NDVI, ms2gt and IDL parts seem to be implemented in Python. Till now, I have some progress combining GOES imagery with aircraft data. My next task is to combine MODIS data with aircraft and radar data. I would be happy to get some guidance and code support if there is any previous work been done using Python. Thanks. Hello all, Here is my answer to my 2nd question: http://imageshack.us/photo/my-images/713/modistrue1km.png/ Python script is at http://code.google.com/p/ccnworks/source/browse/trunk/modis/true.py This code is based on TrueColor tutorial of Liam Gumley [ ftp://ftp.ssec.wisc.edu/pub/IMAPP/MODIS/TrueColor/] and Peter Kuma's ccplot tool [http://ccplot.org/] Currently it only plots true color images from Aqua or Terra using Level 1B data. For the example image I use the data provided via TrueColor link. Notes: 1-) Using PyNIO to open hdf-eos files, from ccplot using cctk for 2D data interpolation, basemap for map plotting and numpy/scipy for other essentials. 2-) crefl.1km.hdf is reflectance corrected data using NVDI's crefl program. Set-up TrueColor tutorial and you should be able to get these correction applied data by calling its main script or set-up another. 3-) MOD03.hdf is the geolocation data. 4-) No need to run ms2gt or any other swath to grid conversion tools, since the interpolation routine handles this step. 5-) Code is in 100 lines. Unlike TrueColor tutorial it only works for 1KM resolution. HKM and QKM resolution plotting requires additional steps. It takes about 2.5 seconds to get the plot on my screen. Let me know if you have any comments or other suggestions. Thanks. -- Gökhan -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Meridians not show using Mercator projection
Hi, Using the example code shown below I can't get meridians plotted on the screen: from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt import numpy as np m = Basemap(projection='merc',lon_0=-79, lat_0=25.5, llcrnrlon=-93, urcrnrlon=-63, llcrnrlat=14, urcrnrlat=36.2) m.drawcoastlines(linewidth=0.3) parallels = np.arange(0.,90,2.) m.drawparallels(parallels, labels=[1,0,0,0]) meridians = np.arange(180.,360.,5.) m.drawmeridians(meridians, labels=[0,0,0,1]) plt.show() Two other projections laea and tmerc work fine for this case. Any ideas? Thanks. -- Gökhan -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Build on VS2008 - warnings
On 15/11/2011 14:45, Michael Droettboom wrote: I'd love to see the compiler logs and try to fix what I can. I don't have a Windows install to test, but maybe I can resolve the more obvious ones. Mike On 11/08/2011 05:49 AM, Mads Ipsen wrote: Hi, Thanks to the help from Christoph, I have been able to build matplotlib-1.1.0 on both Win XP-32 and 64. I have noticed though, that quite a few warnings are produced when the source is compiled. Is this something that the core developers would like to fix, or is it a 'don't care' thing? If the info is useful, I'd be happy to post it somewhere. Best regards, Mads -- +-+ | Mads Ipsen | +--+--+ | Gåsebæksvej 7, 4. tv | | | DK-2500 Valby| phone: +45-29716388 | | Denmark | email:mads.ip...@gmail.com | +--+--+ -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Michael Droettboom Science Software Branch Space Telescope Science Institute Baltimore, Maryland, USA -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users Attached, you'll find the build log from a gcc based build on Ubuntu 11.04 (64): Using built-in specs. Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.4.5-15ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4 --enable-shared --enable-multiarch --with-multiarch-defaults=x86_64-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib/x86_64-linux-gnu --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib/x86_64-linux-gnu --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.4.5 (Ubuntu/Linaro 4.4.5-15ubuntu1) Best regards, Mads -- +-+ | Mads Ipsen | +--+--+ | Gåsebæksvej 7, 4. tv | | | DK-2500 Valby| phone: +45-29716388 | | Denmark | email: mads.ip...@gmail.com | +--+--+ running build_ext building 'matplotlib.ft2font' extension creating build/temp.linux-x86_64-2.7 creating build/temp.linux-x86_64-2.7/src creating build/temp.linux-x86_64-2.7/CXX gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/home/mpi/git/quantumsource/external-libs/build/lib/python2.7/site-packages/numpy/core/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -I/home/mpi/git/quantumsource/external-libs/build/include/python2.7 -c src/ft2font.cpp -o build/temp.linux-x86_64-2.7/src/ft2font.o gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/home/mpi/git/quantumsource/external-libs/build/lib/python2.7/site-packages/numpy/core/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -I/home/mpi/git/quantumsource/external-libs/build/include/python2.7 -c src/mplutils.cpp -o build/temp.linux-x86_64-2.7/src/mplutils.o gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/home/mpi/git/quantumsource/external-libs/build/lib/python2.7/site-packages/numpy/core/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -I/home/mpi/git/quantumsource/external-libs/build/include/python2.7 -c CXX/IndirectPythonInterface.cxx -o build/temp.linux-x86_64-2.7/CXX/IndirectPythonInterface.o gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/home/mpi/git/quantumsource/external-libs/build/lib/python2.7/site-packages/numpy/core/include -I/usr/include/freetype2
Re: [Matplotlib-users] Separate formatting for tick labels
Try something like this. ax = subplot(111) LabelsList = ['Prospero', 'Miranda', 'Caliban', 'Ariel'] ax.set_xticks(range(len(LabelsList)))xlabels = ax.set_xticklabels( LabelsList, rotation=35, horizontalalignment='right', fontstyle='italic', fontsize='10') ticklabels = ax.get_xticklabels()ticklabels[0].set_fontstyle(normal) Regards, -JJ On Wed, Nov 16, 2011 at 11:25 AM, magurling magurl...@gmail.com wrote: LabelsList = ['Prospero', 'Miranda', 'Caliban', 'Ariel'] xlabels = ax.set_xticklabels( LabelsList, rotation=35, horizontalalignment='right', fontstyle='italic', fontsize='10') -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] newline characters in tick labels
Benjamin Root-2 wrote: Seems to work fine for me using GTKAgg. I added these lines: import matplotlib matplotlib.use('GTKAgg') I still get the \n printed literally in the label (an actual carriage return shows up as an empty rectangle). -- View this message in context: http://old.nabble.com/newline-characters-in-tick-labels-tp32852034p32858119.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Matplotlib colors
I want to: 1. Have matplotlib assign the linecolor for a plot 2. Read the linecolor with .get_color() 3. Create another plot with the linecolor set to a lighter version of the previous linecolor. Ie: a, = plot(x,y) a.get_color() = 'b' b, = plot(x,y, color = #xx) Since I'm only using the standard matplotlib assigned colors which cycle through b,g,r,c,m,y,k I thought I would just create a mapping between each color and a lighter version. How do I get the hex or RGB string for the base matplotlib colors? Also, if there's a different property I can use to lighten the line color without changing the color that would be cool too. Cheers, Jonno. -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Meridians not show using Mercator projection
On 11/16/2011 03:16 PM, Gökhan Sever wrote: Hi, Using the example code shown below I can't get meridians plotted on the screen: from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt import numpy as np m = Basemap(projection='merc',lon_0=-79, lat_0=25.5, llcrnrlon=-93, urcrnrlon=-63, llcrnrlat=14, urcrnrlat=36.2) m.drawcoastlines(linewidth=0.3) parallels = np.arange(0.,90,2.) m.drawparallels(parallels, labels=[1,0,0,0]) meridians = np.arange(180.,360.,5.) It can't handle the wrap; subtract 360 from your meridians, and they will show up. Eric m.drawmeridians(meridians, labels=[0,0,0,1]) plt.show() Two other projections laea and tmerc work fine for this case. Any ideas? Thanks. -- Gökhan -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] axes_grid1 and colorbar ticks
This seems to be a bug that need to be fixed. Meanwhile, use locator parameter as below. cbar = grid.cbar_axes[0].colorbar(im, locator=ticks) Regards, -JJ On Thu, Nov 17, 2011 at 5:35 AM, Yoshi Rokuko yo...@rokuko.net wrote: does someone knows how to specify ticks for a colorbar inside axesgrid? the following does not work as expected: from mpl_toolkits.axes_grid1 import AxesGrid ticks = [.01, .25, .5, .75, .99] grid = AxesGrid() [...] grid.cbar_axes[i].colorbar(im, ticks=ticks) i'm thankfull for any pointers, yoshi -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Matplotlib colors
On Wed, Nov 16, 2011 at 5:35 PM, Jonno jonnojohn...@gmail.com wrote: I want to: 1. Have matplotlib assign the linecolor for a plot 2. Read the linecolor with .get_color() 3. Create another plot with the linecolor set to a lighter version of the previous linecolor. Ie: a, = plot(x,y) a.get_color() = 'b' b, = plot(x,y, color = #xx) Since I'm only using the standard matplotlib assigned colors which cycle through b,g,r,c,m,y,k I thought I would just create a mapping between each color and a lighter version. How do I get the hex or RGB string for the base matplotlib colors? There may be an easier way, but in the past I've used a color converter object (which seems unnecessarily verbose): import matplotlib.colors as mcolors cc = mcolors.ColorConverter() cc.to_rgb('b') (0, 0, 1) Also, if there's a different property I can use to lighten the line color without changing the color that would be cool too. If you have a white background (and no overlapping markers/lines), you could just set the alpha argument in the plot command. Best, -Tony -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Meridians not show using Mercator projection
On 11/16/11 6:16 PM, Gökhan Sever wrote: from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt import numpy as np m = Basemap(projection='merc',lon_0=-79, lat_0=25.5, llcrnrlon=-93, urcrnrlon=-63, llcrnrlat=14, urcrnrlat=36.2) m.drawcoastlines(linewidth=0.3) parallels = np.arange(0.,90,2.) m.drawparallels(parallels, labels=[1,0,0,0]) meridians = np.arange(180.,360.,5.) m.drawmeridians(meridians, labels=[0,0,0,1]) plt.show() Two other projections laea and tmerc work fine for this case. Any ideas? Thanks. -- Gökhan Gökhan: The longitudes in your projection definition are negative (-93 to -63), so you need to change meridians = np.arange(180.,360.,5.) to meridians = np.arange(-180.,0.,5.) It works for the other projections, since the values get transformed to projection coordinates anyway. With merc and cyl, there is no transformation for longitudes. -Jeff -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] axes_grid1 and colorbar ticks
+--- Jae-Joon Lee ---+ This seems to be a bug that need to be fixed. Meanwhile, use locator parameter as below. cbar = grid.cbar_axes[0].colorbar(im, locator=ticks) that works, thank you! best regards, yoshi -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users