Re: [Matplotlib-users] Matplotlib-users Digest, Vol 50, Issue 80
Hi Paul, Thank you very much.. You tip helped me a lot, problem solved. Thank you On Thu, Jul 29, 2010 at 9:47 PM, wrote: > Whoops. That didn’t stick like I thought it would. Try here: > http://pastebin.com/rJtUuWne > > -paul > > > > *From:* Paul Hobson > *Sent:* Thursday, July 29, 2010 5:46 PM > *To:* Waléria Antunes David; [email protected] > *Subject:* RE: [Matplotlib-users] Matplotlib-users Digest, Vol 50, Issue > 80 > > > > I submitted a correction to the code in your pastebin link below. Revisit > the link (http://pastebin.com/vSbkXDzE) and run that code. > > -paul > > > > - > > *From:* Waléria Antunes David [mailto:[email protected]] > *Sent:* Thursday, July 29, 2010 12:08 PM > *To:* [email protected] > *Subject:* Re: [Matplotlib-users] Matplotlib-users Digest, Vol 50, Issue > 80 > > > > Hi , > > I made the changes as bellow and it displays the x-axis values formatted as > expected, see my current image and my code. But, now i need to change the > scale and the numbers of decimal places in order to appear on the graph like > this: 3.0 3.1 3.2 .. 3.4 > > My code: http://pastebin.com/vSbkXDzE > > Can you help me? > > > > > -- The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Data margin/buffer in matplotlib (Date formatted axis)
I am trying to figure out how to set 'buffers' or something of the sort on my
matplotlib plots, so that my first and last data points are not centered
exactly on the left and right border of the axis.
my Y axis does this just fine (integer data), but my X axis has no
buffer/margin what soever.
my graphing routine is as such (most fields are variables) any help is
appreciated!:
PlotVar.set_xlabel(xlabel)
PlotVar.set_ylabel(ylabel)
PlotVar.set_title(title)
PlotVar.plot(data[xtarget][np.isfinite(data[ytarget1])],
data[ytarget1][np.isfinite(data[ytarget1])], '-o', ms=6, lw=2, alpha=0.5,
mfc='orange', label=label1)
PlotVar.plot(data[xtarget][np.isfinite(data[ytarget2])],
data[ytarget2][np.isfinite(data[ytarget2])], '-o', ms=6, lw=2, alpha=0.5,
mfc='red', label=label2)
PlotVar.xaxis.set_major_locator(xdays)
PlotVar.xaxis.set_major_formatter(DateFormatter('%m-%d'))
PlotVar.xaxis.set_minor_locator(xhours)
PlotVar.fmt_xdata = DateFormatter('%m-%d')
figVar.autofmt_xdate(rotation=-90, ha='left')
highY1 =
max(data[ytarget1][np.isfinite(data[ytarget1])])
lowY1=
min(data[ytarget1][np.isfinite(data[ytarget1])])
highY2 =
max(data[ytarget2][np.isfinite(data[ytarget2])])
lowY2=
min(data[ytarget2][np.isfinite(data[ytarget2])])
maxvalue= max(highY1, highY2)
minvalue= min(lowY1, lowY2)
PlotVar.yaxis.set_major_locator(mticker.MultipleLocator(base=round(((maxvalue
- minvalue)/10),3)))
PlotVar.yaxis.set_minor_locator(mticker.MultipleLocator(base=round(((maxvalue
- minvalue)/40),5)))
plt.legend(loc='best',
prop=matplotlib.font_manager.FontProperties(size=10))
PlotVar.grid()
figVar.savefig(saveto)
--
View this message in context:
http://old.nabble.com/Data-margin-buffer-in-matplotlib-%28Date-formatted-axis%29-tp29297756p29297756.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Data margin/buffer in matplotlib (Date formatted axis)
On 07/29/2010 05:52 AM, bobnojio wrote:
>
> I am trying to figure out how to set 'buffers' or something of the sort on my
> matplotlib plots, so that my first and last data points are not centered
> exactly on the left and right border of the axis.
> my Y axis does this just fine (integer data), but my X axis has no
> buffer/margin what soever.
If you are using, or can upgrade to, mpl 1.0, then you can use the
margins() Axes method or pyplot function.
Otherwise, you can use the Axes get_xlim and set_xlim methods, or the
pyplot xlim function, to manually add to the x-axis boundaries. For
example,
plot([1.1, 5.2], 'ro')
x0, x1 = xlim()
dx = 0.02 * (x1 - x0)
xlim(x0-dx, x1+dx)
Eric
>
>
> my graphing routine is as such (most fields are variables) any help is
> appreciated!:
> PlotVar.set_xlabel(xlabel)
> PlotVar.set_ylabel(ylabel)
> PlotVar.set_title(title)
> PlotVar.plot(data[xtarget][np.isfinite(data[ytarget1])],
> data[ytarget1][np.isfinite(data[ytarget1])], '-o', ms=6, lw=2, alpha=0.5,
> mfc='orange', label=label1)
> PlotVar.plot(data[xtarget][np.isfinite(data[ytarget2])],
> data[ytarget2][np.isfinite(data[ytarget2])], '-o', ms=6, lw=2, alpha=0.5,
> mfc='red', label=label2)
> PlotVar.xaxis.set_major_locator(xdays)
> PlotVar.xaxis.set_major_formatter(DateFormatter('%m-%d'))
> PlotVar.xaxis.set_minor_locator(xhours)
> PlotVar.fmt_xdata = DateFormatter('%m-%d')
> figVar.autofmt_xdate(rotation=-90, ha='left')
> highY1 =
> max(data[ytarget1][np.isfinite(data[ytarget1])])
> lowY1=
> min(data[ytarget1][np.isfinite(data[ytarget1])])
> highY2 =
> max(data[ytarget2][np.isfinite(data[ytarget2])])
> lowY2=
> min(data[ytarget2][np.isfinite(data[ytarget2])])
> maxvalue= max(highY1, highY2)
> minvalue= min(lowY1, lowY2)
>
> PlotVar.yaxis.set_major_locator(mticker.MultipleLocator(base=round(((maxvalue
> - minvalue)/10),3)))
>
> PlotVar.yaxis.set_minor_locator(mticker.MultipleLocator(base=round(((maxvalue
> - minvalue)/40),5)))
> plt.legend(loc='best',
> prop=matplotlib.font_manager.FontProperties(size=10))
> PlotVar.grid()
> figVar.savefig(saveto)
--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] natgrid?
Is it just me, or are some of the headers missing in the mpl-toolkit on source-forge required to build natgrid 0.2? -- The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] natgrid?
building 'mpl_toolkits.natgrid._natgrid' extension c:\Program Files\pythonxy\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -Isrc -Ic :\python25\include -Ic:\python25\PC -c src\natgridd.c -o build\temp.win32-2.5\Re lease\src\natgridd.o src\natgridd.c:17:26: ncarg/ngmath.h: No such file or directory src\natgridd.c: In function `c_natgridd': src\natgridd.c:25: warning: 'x_sav' might be used uninitialized in this function src\natgridd.c:25: warning: 'y_sav' might be used uninitialized in this function src\natgridd.c:25: warning: 'z_sav' might be used uninitialized in this function src\natgridd.c:26: warning: 'n_sav' might be used uninitialized in this function error: command 'gcc' failed with exit status 1 On Fri, Jul 30, 2010 at 2:27 PM, Jeff Whitaker wrote: > On 7/30/10 12:21 PM, william ratcliff wrote: > >> Is it just me, or are some of the headers missing in the mpl-toolkit on >> source-forge required to build natgrid 0.2? >> > Works for me. Can you be more specific (what's the compilation error?) > > -Jeff > > > -- > Jeffrey S. Whitaker Phone : (303)497-6313 > Meteorologist FAX: (303)497-6449 > NOAA/OAR/PSD R/PSD1Email : [email protected] > 325 BroadwayOffice : Skaggs Research Cntr 1D-113 > Boulder, CO, USA 80303-3328 Web: http://tinyurl.com/5telg > > -- The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] natgrid?
On 7/30/10 12:38 PM, william ratcliff wrote: > building 'mpl_toolkits.natgrid._natgrid' extension > c:\Program Files\pythonxy\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall > -Isrc -Ic > :\python25\include -Ic:\python25\PC -c src\natgridd.c -o > build\temp.win32-2.5\Re > lease\src\natgridd.o > src\natgridd.c:17:26: ncarg/ngmath.h: No such file or directory > src\natgridd.c: In function `c_natgridd': > src\natgridd.c:25: warning: 'x_sav' might be used uninitialized in > this function > > src\natgridd.c:25: warning: 'y_sav' might be used uninitialized in > this function > > src\natgridd.c:25: warning: 'z_sav' might be used uninitialized in > this function > > src\natgridd.c:26: warning: 'n_sav' might be used uninitialized in > this function > > error: command 'gcc' failed with exit status 1 > OK, there was a header missing from MANIFEST.in. Just uploaded a 0.2.1 tar file to sourceforege. -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX: (303)497-6449 NOAA/OAR/PSD R/PSD1Email : [email protected] 325 BroadwayOffice : Skaggs Research Cntr 1D-113 Boulder, CO, USA 80303-3328 Web: http://tinyurl.com/5telg -- The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] natgrid?
On 7/30/10 12:21 PM, william ratcliff wrote: > Is it just me, or are some of the headers missing in the mpl-toolkit > on source-forge required to build natgrid 0.2? Works for me. Can you be more specific (what's the compilation error?) -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX: (303)497-6449 NOAA/OAR/PSD R/PSD1Email : [email protected] 325 BroadwayOffice : Skaggs Research Cntr 1D-113 Boulder, CO, USA 80303-3328 Web: http://tinyurl.com/5telg -- The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Same X and Y scale
Hi, Consider this: X = np.linspace(0.70, 1.1, 100) Y = np.linspace(-1.19, 1.19, 70) (Xs, Ys) = np.meshgrid(X, Y) Z = np.sqrt((Xs-0.9)**2 + Ys**2) - 0.10 fig = plt.figure() ax = fig.add_subplot(111) ax.contour(X, Y, Z) fig.show() This works, but gives the y axis a different scale than the x axis so the ellipses look like circles. How can I get the same scale for the x- and y-axis? I tried to set ax.set_autoscale_on(False), but that resulted in a totally different part of the coordinate system being shown. Thanks, -Nikolaus -- »Time flies like an arrow, fruit flies like a Banana.« PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C -- The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Same X and Y scale
On Jul 30, 2010, at 14:34, Nikolaus Rath wrote:
> Hi,
>
> Consider this:
>
> X = np.linspace(0.70, 1.1, 100)
> Y = np.linspace(-1.19, 1.19, 70)
> (Xs, Ys) = np.meshgrid(X, Y)
> Z = np.sqrt((Xs-0.9)**2 + Ys**2) - 0.10
> fig = plt.figure()
> ax = fig.add_subplot(111)
> ax.contour(X, Y, Z)
> fig.show()
>
> This works, but gives the y axis a different scale than the x axis so
> the ellipses look like circles.
>
> How can I get the same scale for the x- and y-axis?
>
> I tried to set ax.set_autoscale_on(False), but that resulted in a
> totally different part of the coordinate system being
Try:
ax.set_aspect('equal')
Ryan
--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] natgrid?
Thanks! On Fri, Jul 30, 2010 at 2:49 PM, Jeff Whitaker wrote: > On 7/30/10 12:38 PM, william ratcliff wrote: > >> building 'mpl_toolkits.natgrid._natgrid' extension >> c:\Program Files\pythonxy\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall >> -Isrc -Ic >> :\python25\include -Ic:\python25\PC -c src\natgridd.c -o >> build\temp.win32-2.5\Re >> lease\src\natgridd.o >> src\natgridd.c:17:26: ncarg/ngmath.h: No such file or directory >> src\natgridd.c: In function `c_natgridd': >> src\natgridd.c:25: warning: 'x_sav' might be used uninitialized in this >> function >> >> src\natgridd.c:25: warning: 'y_sav' might be used uninitialized in this >> function >> >> src\natgridd.c:25: warning: 'z_sav' might be used uninitialized in this >> function >> >> src\natgridd.c:26: warning: 'n_sav' might be used uninitialized in this >> function >> >> error: command 'gcc' failed with exit status 1 >> >> OK, there was a header missing from MANIFEST.in. Just uploaded a 0.2.1 > tar file to sourceforege. > > > -Jeff > > -- > Jeffrey S. Whitaker Phone : (303)497-6313 > Meteorologist FAX: (303)497-6449 > NOAA/OAR/PSD R/PSD1Email : [email protected] > 325 BroadwayOffice : Skaggs Research Cntr 1D-113 > Boulder, CO, USA 80303-3328 Web: http://tinyurl.com/5telg > > -- The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Permission error after installing MPL 1.0 on Mac
I recently installed MPL on two Macs, one running 10.6 and another running 10.5. When I try to plot, I get the following error: TclError: couldn't open "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/mpl-data/images/home.ppm": permission denied After checking, it's true that only the owner has read permissions. This is easy enough on my end, but I wonder if there is a problem with the distributed installer that should have the correct permissions for these images. Has anyone else seen this problem or is it just me? Jeremy -- The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Same X and Y scale
Ryan May writes:
> On Jul 30, 2010, at 14:34, Nikolaus Rath
> wrote:
>
>> Hi,
>>
>> Consider this:
>>
>> X = np.linspace(0.70, 1.1, 100)
>> Y = np.linspace(-1.19, 1.19, 70)
>> (Xs, Ys) = np.meshgrid(X, Y)
>> Z = np.sqrt((Xs-0.9)**2 + Ys**2) - 0.10
>> fig = plt.figure()
>> ax = fig.add_subplot(111)
>> ax.contour(X, Y, Z)
>> fig.show()
>>
>> This works, but gives the y axis a different scale than the x axis so
>> the ellipses look like circles.
>>
>> How can I get the same scale for the x- and y-axis?
>>
>> I tried to set ax.set_autoscale_on(False), but that resulted in a
>> totally different part of the coordinate system being
>
> Try:
>
> ax.set_aspect('equal')
Works perfectly, thanks!
-Nikolaus
--
»Time flies like an arrow, fruit flies like a Banana.«
PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C
--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
