SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

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
(16)
2
(16)
3
(5)
4
(4)
5
(4)
6
(10)
7
(33)
8
(11)
9
(20)
10
(7)
11
(8)
12
(18)
13
(27)
14
(21)
15
(15)
16
(10)
17
(12)
18
(3)
19
(12)
20
(12)
21
(14)
22
(32)
23
(15)
24
(20)
25
(12)
26
(32)
27
(29)
28
(17)
29
(25)
30
(12)
31
(5)

Showing results of 458

<< < 1 2 3 4 .. 19 > >> (Page 2 of 19)
From: Benjamin R. <ben...@ou...> - 2010年07月29日 16:24:40
On Wed, Jul 28, 2010 at 1:54 PM, Eric Firing <ef...@ha...> wrote:
> On 07/28/2010 05:48 AM, Benjamin Root wrote:
>
>> On Tue, Jul 27, 2010 at 1:31 PM, Friedrich Romstedt
>> <fri...@gm... <mailto:fri...@gm...>> wrote:
>>
>> 2010年7月26日 Benjamin Root <ben...@ou... <mailto:ben...@ou...>>:
>>
>> > After some reading of sphinx documentation, it appears to be a
>> bug with
>> > sphinx (or actually, "smartypants") because it should not be
>> doing this sort
>> > of interpretation within a docstring. Anyway, supposedly the
>> workaround is
>> > to put double backticks around the part that needs to be treated
>> literally:
>> > ``'--'``. I tried this out and built the docs locally and it
>> works... sort
>> > of. The text that is surrounded by double backticks are getting
>> a different
>> > background color. This doesn't look great to me. Maybe someone
>> else has a
>> > thought?
>>
>> How looks a backticked empty string like? If it is just nothing, it
>> could be used in between of the two hyphens, to separate them by
>> "nothing". Still very hackish ... But it's just like LaTeX -{}-.
>>
>> Friedrich
>>
>>
>> Actually, I just took another look at the documentation and realized
>> that the docstring for set_linestyle() was inconsistent with the docs
>> for plot(). plot() have been using the backticks for a while now, so if
>> we just use the double-backticks for all the values in set_linestyle()
>> it would be consistent and look much better than it is now.
>>
>> I can make these changes and commit them to the trunk and the release
>> branch, if that is ok.
>>
>
> Ben,
>
> Sounds reasonable--go ahead.
>
> Thanks.
>
> Eric
>
Done in r8593 and r8594
Ben Root
From: Benjamin R. <ben...@ou...> - 2010年07月29日 15:59:03
On Thu, Jul 29, 2010 at 10:07 AM, Matthias Michler
<Mat...@gm...>wrote:
> On Thursday July 29 2010 12:05:24 Bala subramanian wrote:
> > Friends,
> > I wrote a small script to plot a data and its pdf in single figure but as
> > two subplots.
> >
> > 1) However i want to share xaxis of ax2 (subplot 122) with the y axis of
> > ax1 (subplot 121). What function should i use do that. I tried sharex and
> > sharey but i am not gettting what i want.
> >
> > 2) Is there any possiblity to one of the subplot for instance i want to
> > rotate ax2 by 90.
> >
> > #!/usr/bin/env python
> > import matplotlib.pyplot as plt
> > import numpy as np
> > import matplotlib.mlab as mlb
> > data1=np.loadtxt('test.rms',usecols=(1,))
> > fig=plt.figure()
> > ax1=fig.add_subplot(121)
> > ax2=fig.add_subplot(122)
> > ax1.plot(data1)
> > mu,sigma=np.mean(data1),np.std(data1)
> > n, bins, patches = ax2.hist(data1, bins=25, normed=1, facecolor='green',
> > alpha=0.75,visible=False)
> > y = mlb.normpdf( bins, mu, sigma)
> > l = ax2.plot(bins,y,'-',linewidth=1.2)
> > plt.show()
>
> Hi Bala,
>
> I attached a small stand-alone example, which illustrates two ways of
> showing
> data and its pdf sharing one axis. Maybe this can serve as a starting point
> for you to solve the problem or you can describe in more detail what is
> missing.
>
> Kind regards,
> Matthias
>
>
Actually, I think Bala is asking for something different, and I while I
think matplotlib is *capable* of doing it, I am not aware of any easy-to-use
function to do it. Currently, you can share a pair of x axes, or a pair of
y axes. This is fairly straight-forward because the axes object returned
from a .add_subplot() command contains both axis objects, and you can easily
pass in another axes object to the sharex or sharey keyword arguments.
Those sharex and sharey arguments assume that you mean to pair-up the x axis
of the two axes objects, or the y axis of the two axes objects. However,
what we want here is the ability to have the x axis in one axes object to be
paired with the y axis of another axes object. This is a completely
different, but valid, use-case and would be a useful feature to make
available (or at least, better documented).
Ben Root
From: bobnojio <ste...@li...> - 2010年07月29日 15:52:47
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.
From: Nikolaus R. <Nik...@ra...> - 2010年07月29日 13:28:31
Jeff Whitaker <jsw...@pu...> writes:
> On 7/28/10 8:32 PM, Nikolaus Rath wrote:
>> Hello,
>>
>> What is the best way to generate a contour plot from a set of
>> non-uniformly sampled data (i.e., the datapoints do not lie on the
>> points of a rectangular grid but are randomly distributed)?
>>
>>
>> Thanks,
>>
>> -Nikolaus
>>
>> 
> Nikolaus: You can either use mlab.griddata to interpolate the data to a 
> regular grid, or use pyplot.tricontour to perform a delaunay 
> triangulation and contour the resulting triangle values.
Fantastic, thanks!
Best,
 -Nikolaus
-- 
 »Time flies like an arrow, fruit flies like a Banana.«
 PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C
From: John H. <jd...@gm...> - 2010年07月29日 12:26:22
On Jul 28, 2010, at 6:55 PM, "Jenna L." <je...@as...> wrote:
> 
> Hmm that is not what my output looks like. Attached is a capture of my
> output. I am using matplotlib version 0.98.5.3 
> http://old.nabble.com/file/p29291928/shift_subplot_test.png
> shift_subplot_test.png 
> 
You version of mpl is pretty old. You'll need to upgrade. 
From: ms <dev...@gm...> - 2010年07月29日 11:57:51
On 29/07/10 12:45, Waléria Antunes David wrote:
> Hi Benjamim,
>
> 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?
>
> Waleria
What do you mean by "change the scale"?
From: Simon F. <sim...@a-...> - 2010年07月29日 08:46:49
For some magical reason when I set the ticks_position to none, setting
the label_position to 'top' is ignored.
Did you try this? Is it another command arrangement thing?
On 09:26 Thu 29.07.10, Friedrich Romstedt wrote:
> axis.set_label_position('top')
> axis.set_ticks_position('none')
From: Friedrich R. <fri...@gm...> - 2010年07月29日 07:26:40
2010年7月29日 Simon Friedberger <sim...@a-...>:
> Also I have now finished my confusion matrix program:
> http://paste.pocoo.org/show/242834/
> Comments on the code would be very welcome.
I think you can make use of
axis.set_label_position('top')
axis.set_ticks_position('none')
Friedrich
From: Matthieu B. <mat...@gm...> - 2010年07月29日 06:45:06
Hi,
In scikits.learn, there is a confusion matrix and in the samples,
there are several plots (scikit-learn.sf.net).
Matthieu
2010年7月16日 Simon Friedberger <sim...@a-...>:
> Hello List.
>
> I'm trying to plot a confusion matrix and I got this far:
> http://paste.pocoo.org/show/238332/
>
> Basically what I still want to do is get the ticklabels from the bottom
> to the top, have every ticklabel shown and start showing them from the
> first not from the second.
>
> I have experimented with this for a while now and don't have all the
> code states at hand anymore but basically at several points some of the
> above worked but the others didn't or something else (like the axis
> length) broke.
>
> Best
> Simon
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
-- 
Information System Engineer, Ph.D.
Blog: http://matt.eifelle.com
LinkedIn: http://www.linkedin.com/in/matthieubrucher
From: Jeff W. <js...@fa...> - 2010年07月29日 03:16:29
On 7/28/10 8:32 PM, Nikolaus Rath wrote:
> Hello,
>
> What is the best way to generate a contour plot from a set of
> non-uniformly sampled data (i.e., the datapoints do not lie on the
> points of a rectangular grid but are randomly distributed)?
>
>
> Thanks,
>
> -Nikolaus
>
> 
Nikolaus: You can either use mlab.griddata to interpolate the data to a 
regular grid, or use pyplot.tricontour to perform a delaunay 
triangulation and contour the resulting triangle values.
-Jeff
From: Nikolaus R. <Nik...@ra...> - 2010年07月29日 02:32:58
Hello,
What is the best way to generate a contour plot from a set of
non-uniformly sampled data (i.e., the datapoints do not lie on the
points of a rectangular grid but are randomly distributed)?
Thanks,
 -Nikolaus
-- 
 »Time flies like an arrow, fruit flies like a Banana.«
 PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C
From: Samuel T. S. <arc...@gm...> - 2010年07月29日 01:36:37
I think her problem is something like that
His values on X Axis is a range between 3000 to 3400
without this division by 1000.0 his graphic processing normally
but instead on X axis to show the range between 3000 to 3400
she needs to show this values transform in Hz (I think) that's why the
division by 1000.0
only problem when this division occur
the values o X axis became 3.0 to 3.4
and that's what she's send to plot
she should send the original values (3000 to 3400) and some how change the X
values that appear on X axis by another way
because the way it's goes, plot function receive a little range on X axis to
plot a graphic
incompatible to Y axis values, that are passing on Sseries variable
that's why she's graphics not show after that division
and appear when the division is remove from the code.
so... she question should be something like
I send to plot on X axis values between 3000 to 3400
but on X axis they must appear as 3.0 to 3.4
how can I change the values on X axis
without change the real X axis values I send...
... did I help...? I hope so...
see ya all
2010年7月28日 Benjamin Root <ben...@ou...>
> On Wed, Jul 28, 2010 at 2:39 PM, Angus McMorland <am...@gm...>wrote:
>
>> On 28 July 2010 15:25, Waléria Antunes David <wal...@gm...>
>> wrote:
>> > Hello all,
>> >
>> > Well, my problem is ... My current code is as follow bellow:
>> > http://pastebin.com/7p2N5d64
>>
>> Hi Waléria,
>>
>> We can't easily fix your problem without knowing what data f and
>> Sserie contain. It would help us to help you if you could post a
>> standalone example that shows your problem without relying on external
>> data.
>>
>> Angus.
>> --
>> AJC McMorland
>> Post-doctoral research fellow
>> Neurobiology, University of Pittsburgh
>>
>>
> Angus is correct that providing a stand-alone version of the script that
> replicates your problem would be most useful. I would like to mention a
> couple of possible improvements to your code. These improvements may or may
> not fix your issue, but they will improve your current code.
>
> 1) Use list comprehensions
>
> Change
>
> y=[]
> for n in f:
> y.append(n/Decimal(1000))
> y = numpy.array(y)
>
> into:
>
> y = numpy.array(f) / 1000.0
>
> Also,
>
> ax.grid('TRUE')
>
> should be:
>
> ax.grid(True)
>
> I hope this helps. If not, then please send a stand-alone example that
> duplicates the problem you are having.
> Ben Root
>
>
>
> ------------------------------------------------------------------------------
> 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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Jenna L. <je...@as...> - 2010年07月28日 23:55:53
Hmm that is not what my output looks like. Attached is a capture of my
output. I am using matplotlib version 0.98.5.3 
http://old.nabble.com/file/p29291928/shift_subplot_test.png
shift_subplot_test.png 
Jae-Joon Lee wrote:
> 
> On Thu, Jul 29, 2010 at 1:17 AM, Jenna L. <je...@as...>
> wrote:
>> That looks fine to me too, but if you plot that as one subplot in a 5x5
>> array
>> of subplots or more, then you can see the shift I am talking about in the
>> eps file. Example:
> 
> I still don't see it (a capture of my eps output is attached).
> Can you post your output (original eps file that shows the shift)?
> 
> Again, what is your matplotlib version?
> 
> Regards,
> 
> -JJ
> 
> 
> ------------------------------------------------------------------------------
> 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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://old.nabble.com/Saving-as-eps-file-shifts-image--tp29232680p29291928.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Jae-Joon L. <lee...@gm...> - 2010年07月28日 23:41:15
Attachments: image_shift_test.png
On Thu, Jul 29, 2010 at 1:17 AM, Jenna L. <je...@as...> wrote:
> That looks fine to me too, but if you plot that as one subplot in a 5x5 array
> of subplots or more, then you can see the shift I am talking about in the
> eps file. Example:
I still don't see it (a capture of my eps output is attached).
Can you post your output (original eps file that shows the shift)?
Again, what is your matplotlib version?
Regards,
-JJ
From: Simon F. <sim...@a-...> - 2010年07月28日 22:30:20
On 18:32 Sun 18.07.10, Friedrich Romstedt wrote:
> Try to add:
> ax.set_xticks(range(0, 10))
> ax.set_yticks(range(0, 10))
> 
> before the imshow call.
> 
> For some reason it must happen before the imshow call and not after,
> else the yscaling will change (I don't understand this).
Thanks for this tip. Apparently there is a necessary order for some calls.
Is this documented anywhere? It seems quite problematic.
Also I have now finished my confusion matrix program:
http://paste.pocoo.org/show/242834/
Comments on the code would be very welcome.
If people like it maybe it could be included in the examples. I think it's a
relatively common usecase.
Regards
Simon
From: Benjamin R. <ben...@ou...> - 2010年07月28日 21:53:43
On Wed, Jul 28, 2010 at 3:56 PM, Thomas Robitaille <
tho...@gm...> wrote:
> Hi,
>
> How does one plot an arrow in a log log plot? In the following example, I
> can't get the arrow head, regardless of what value I use for the head width:
>
> import matplotlib as mpl
> mpl.use('Agg')
> import matplotlib.pyplot as plt
>
> fig = plt.figure()
> ax = fig.add_subplot(1,1,1)
> ax.arrow(0.2,0.2,0.5,0.5,head_width=1.)
> ax.set_xscale('log')
> ax.set_yscale('log')
> ax.set_xlim(0.1,1.)
> ax.set_ylim(0.1,1.)
> fig.savefig('test.png')
>
> In addition, the documentation for arrow does not even mention any arrow
> specific options such as the head width/length, and the example plot is
> missing (there is a 'Exception occurred rendering plot.' message instead)
>
>
> http://matplotlib.sourceforge.net/api/axes_api.html?highlight=arrow#matplotlib.axes.Axes.arrow
>
> Thanks for any help,
>
> Thomas
>
I can't say anything with regards to why your figure is not working, or why
the plot fails to render online (it renders just fine for myself when built
locally). However, I have noticed that the lack of information regarding
the options for arrow seems to be related to the docstring for arrow()
referring to the kwargs for FancyArrow, but none of those are defined. And
the docstring for FancyArrow appears to be incomplete.
Ben Root
From: Thomas R. <tho...@gm...> - 2010年07月28日 20:56:47
Hi,
How does one plot an arrow in a log log plot? In the following example, I can't get the arrow head, regardless of what value I use for the head width:
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
ax.arrow(0.2,0.2,0.5,0.5,head_width=1.)
ax.set_xscale('log')
ax.set_yscale('log')
ax.set_xlim(0.1,1.)
ax.set_ylim(0.1,1.)
fig.savefig('test.png')
In addition, the documentation for arrow does not even mention any arrow specific options such as the head width/length, and the example plot is missing (there is a 'Exception occurred rendering plot.' message instead)
http://matplotlib.sourceforge.net/api/axes_api.html?highlight=arrow#matplotlib.axes.Axes.arrow
Thanks for any help,
Thomas
From: Benjamin R. <ben...@ou...> - 2010年07月28日 20:00:02
On Wed, Jul 28, 2010 at 2:39 PM, Angus McMorland <am...@gm...> wrote:
> On 28 July 2010 15:25, Waléria Antunes David <wal...@gm...>
> wrote:
> > Hello all,
> >
> > Well, my problem is ... My current code is as follow bellow:
> > http://pastebin.com/7p2N5d64
>
> Hi Waléria,
>
> We can't easily fix your problem without knowing what data f and
> Sserie contain. It would help us to help you if you could post a
> standalone example that shows your problem without relying on external
> data.
>
> Angus.
> --
> AJC McMorland
> Post-doctoral research fellow
> Neurobiology, University of Pittsburgh
>
>
Angus is correct that providing a stand-alone version of the script that
replicates your problem would be most useful. I would like to mention a
couple of possible improvements to your code. These improvements may or may
not fix your issue, but they will improve your current code.
1) Use list comprehensions
Change
y=[]
for n in f:
 y.append(n/Decimal(1000))
y = numpy.array(y)
into:
y = numpy.array(f) / 1000.0
Also,
ax.grid('TRUE')
should be:
 ax.grid(True)
I hope this helps. If not, then please send a stand-alone example that
duplicates the problem you are having.
Ben Root
From: Angus M. <am...@gm...> - 2010年07月28日 19:39:56
On 28 July 2010 15:25, Waléria Antunes David <wal...@gm...> wrote:
> Hello all,
>
> Well, my problem is ... My current code is as follow bellow:
> http://pastebin.com/7p2N5d64
Hi Waléria,
We can't easily fix your problem without knowing what data f and
Sserie contain. It would help us to help you if you could post a
standalone example that shows your problem without relying on external
data.
Angus.
-- 
AJC McMorland
Post-doctoral research fellow
Neurobiology, University of Pittsburgh
From: Eric F. <ef...@ha...> - 2010年07月28日 18:54:59
On 07/28/2010 05:48 AM, Benjamin Root wrote:
> On Tue, Jul 27, 2010 at 1:31 PM, Friedrich Romstedt
> <fri...@gm... <mailto:fri...@gm...>> wrote:
>
> 2010年7月26日 Benjamin Root <ben...@ou... <mailto:ben...@ou...>>:
> > After some reading of sphinx documentation, it appears to be a
> bug with
> > sphinx (or actually, "smartypants") because it should not be
> doing this sort
> > of interpretation within a docstring. Anyway, supposedly the
> workaround is
> > to put double backticks around the part that needs to be treated
> literally:
> > ``'--'``. I tried this out and built the docs locally and it
> works... sort
> > of. The text that is surrounded by double backticks are getting
> a different
> > background color. This doesn't look great to me. Maybe someone
> else has a
> > thought?
>
> How looks a backticked empty string like? If it is just nothing, it
> could be used in between of the two hyphens, to separate them by
> "nothing". Still very hackish ... But it's just like LaTeX -{}-.
>
> Friedrich
>
>
> Actually, I just took another look at the documentation and realized
> that the docstring for set_linestyle() was inconsistent with the docs
> for plot(). plot() have been using the backticks for a while now, so if
> we just use the double-backticks for all the values in set_linestyle()
> it would be consistent and look much better than it is now.
>
> I can make these changes and commit them to the trunk and the release
> branch, if that is ok.
Ben,
Sounds reasonable--go ahead.
Thanks.
Eric
>
> Ben Root
>
>
>
> ------------------------------------------------------------------------------
> 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
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Eric F. <ef...@ha...> - 2010年07月28日 18:31:49
On 07/27/2010 02:31 PM, Phil Rosenfield wrote:
> Hi,
>
> I'm 6 months into learning python and haven't been able to find a way
> to do this, so I hope you don't mind a basic question.
>
> I'd like to use the polygons contour makes but I can't figure out how
> to get them from ContourSet. Any examples or links to helpful
> information would be excellent.
They are buried. Each contour set has a list of collections, and
each of those collections has a set of paths, and each of those paths 
has a vertices attribute for its corresponding polygon. In the 
following we will pick out the first path of the first collection.
cs = contour(rand(6,6))
c = cs.collections[0]
p = c.get_paths()[0]
v = p.vertices
lev = cs.levels[0]
The levels attribute is a list of levels corresponding to the list of 
collections: one collection per level.
Eric
> Thanks,
> Phil
>
From: Jenna L. <je...@as...> - 2010年07月28日 16:17:50
That looks fine to me too, but if you plot that as one subplot in a 5x5 array
of subplots or more, then you can see the shift I am talking about in the
eps file. Example:
import matplotlib.pyplot as plt
import numpy as np
arr = np.zeros((11, 11), dtype="d")
arr[3,3]=1
plt.figure(1)
plt.subplot(10,10,1)
im = plt.imshow(arr, interpolation="nearest", origin="lower")
cont = plt.contour(arr, levels=[0.5])
plt.savefig("a.eps")
Jae-Joon Lee wrote:
> 
> I tried a simple array (see the code below) but cannot reproduce the
> problem you reported.
> 
> import matplotlib.pyplot as plt
> import numpy as np
> 
> arr = np.zeros((11, 11), dtype="d")
> arr[3,3]=1
> im = plt.imshow(arr, interpolation="nearest", origin="lower")
> cont = plt.contour(arr, levels=[0.5])
> plt.savefig("a.eps")
> 
> Do you still see the shift with the above example code?
> And what version of matplotlib are you using?
> 
> If possible, please post a complete script with the data (use a
> mock-up data if you want)?
> Regards,
> 
> -JJ
> 
> 
> 
> On Fri, Jul 23, 2010 at 12:16 AM, Jenna Lemonias
> <je...@as...> wrote:
>> No, I don't think the issue is a flip in the y-axis. I have a number of
>> different examples of this, and many in which the contour is an ellipse
>> so I
>> can tell that the overall positioning is correct. It seems like
>> something
>> is going wrong only when I save the image... Thanks for the suggestion
>> though!
>>
>> Jenna
>>
>> On Wed, Jul 21, 2010 at 3:40 PM, Jenna Lemonias
>> <je...@as...>wrote:
>>
>>> I am trying to save a matplotlib 2d array image with an overlaid contour
>>> as
>>> an eps file. The contour appears to be shifted with respect to the
>>> image
>>> underneath in the eps file, particularly when I zoom in on the image.
>>> This
>>> shift is not noticeable in the plot within matplotlib.
>>>
>>> I am using imshow to display the image. The contour is created by
>>> plotting
>>> a list of closely-spaced x,y coordinates. The attached file
>>> matplotlib.png
>>> is a screenshot of the (zoomed-in) image as displayed by matplotlib. 
>>> The
>>> attached file epsfile.png is a screenshot of the (zoomed-in) eps file.
>>> When
>>> I save this image as an eps file, it is actually 1 of 20 subplots and
>>> the
>>> shift is noticeable in each subplot.
>>>
>>> Thanks in advance for your help!
>>>
>>> Jenna
>>>
>>>
>> Just as a wild guess, could this actually be an issue with how imshow
>> uses
>> the upper-left corner for (0,0)? I have seen 1-pixel shifts before, but
>> this shift is a little dramatic and I am left wondering if what we are
>> really seeing is that the contour that is desired should actually be
>> fliped
>> in the y-axis?
>>
>> Maybe you could try another example where you try to draw a contour
>> further
>> away from the center of the image and see if it still goes in the spot
>> you
>> expect it to be?
>>
>> Ben Root
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by Sprint
>> What will you do first with EVO, the first 4G phone?
>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
> 
> ------------------------------------------------------------------------------
> 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://ad.doubleclick.net/clk;226879339;13503038;l?
> http://clk.atdmt.com/CRS/go/247765532/direct/01/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://old.nabble.com/Saving-as-eps-file-shifts-image--tp29232680p29288310.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Benjamin R. <ben...@ou...> - 2010年07月28日 15:49:12
On Tue, Jul 27, 2010 at 1:31 PM, Friedrich Romstedt <
fri...@gm...> wrote:
> 2010年7月26日 Benjamin Root <ben...@ou...>:
> > After some reading of sphinx documentation, it appears to be a bug with
> > sphinx (or actually, "smartypants") because it should not be doing this
> sort
> > of interpretation within a docstring. Anyway, supposedly the workaround
> is
> > to put double backticks around the part that needs to be treated
> literally:
> > ``'--'``. I tried this out and built the docs locally and it works...
> sort
> > of. The text that is surrounded by double backticks are getting a
> different
> > background color. This doesn't look great to me. Maybe someone else has
> a
> > thought?
>
> How looks a backticked empty string like? If it is just nothing, it
> could be used in between of the two hyphens, to separate them by
> "nothing". Still very hackish ... But it's just like LaTeX -{}-.
>
> Friedrich
>
Actually, I just took another look at the documentation and realized that
the docstring for set_linestyle() was inconsistent with the docs for
plot(). plot() have been using the backticks for a while now, so if we just
use the double-backticks for all the values in set_linestyle() it would be
consistent and look much better than it is now.
I can make these changes and commit them to the trunk and the release
branch, if that is ok.
Ben Root
From: Ian T. <ian...@gm...> - 2010年07月28日 15:05:54
Attachments: contour_polygons.py
On 28 July 2010 01:31, Phil Rosenfield <phi...@as...>wrote:
> I'd like to use the polygons contour makes but I can't figure out how
> to get them from ContourSet. Any examples or links to helpful
> information would be excellent.
>
Attached is an example of how to extract the polygons from a ContourSet.
From: John H. <jd...@gm...> - 2010年07月28日 14:57:05
On Wed, Jul 28, 2010 at 8:35 AM, Mario Laforest 2
<mar...@ub...> wrote:
> Hello,
>
>
>
> I am trying to create clickable images for HTML. For transforming the
> coordinates in the examples I found they are using the function
> "seq_x_y()".
>
>
>
> But that function is not available anymore. How can I get transform the
> coordinates with the newer versions of Matplotlib?
Take a look at the transformations tutorial
http://matplotlib.sourceforge.net/users/transforms_tutorial.html
JDH
19 messages has been excluded from this view by a project administrator.

Showing results of 458

<< < 1 2 3 4 .. 19 > >> (Page 2 of 19)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /