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

Showing results of 312

<< < 1 .. 7 8 9 10 11 .. 13 > >> (Page 9 of 13)
From: Jonathan S. <js...@cf...> - 2011年09月13日 12:44:42
Attachments: contour_label_demo.png
Hi all,
I've run into a problem with a contour plot that has a logarithmic
y-axis. The spacing around the inline contour label is too large,
leading to a large segment of the contour being blocked out/erased. I
tried making the plot with a linear axis and it didn't happen in that
case, so I'm thinking that it has to do with the contour labeling
routine not understanding logarithmic scaling. Attached is a plot
demonstrating the problem. Is there a solution for this?
Jon Slavin
From: Neal B. <ndb...@gm...> - 2011年09月12日 13:06:33
Neal Becker wrote:
> Actually, though, I didn't want to plot 2 different sets of data as in that
> example, I want 1 set of data plotted with 2 different x-axis (different
> units). Any suggestion on modifying this example to accomplish this?
> 
> import numpy as np
> import matplotlib.pyplot as plt
> from mpl_toolkits.axes_grid.parasite_axes import SubplotHost
> 
> fig = plt.figure(figsize=(10,8))
> host = SubplotHost(fig, 111)
> fig.add_subplot(host)
> parx = host.twiny()
> 
> parx.axis["top"].set_visible(False)
> offset = 0, -50
> new_axisline = parx.get_grid_helper().new_fixed_axis
> parx.axis["bottom"] = new_axisline(loc="bottom", axes=parx, offset=offset)
> parx.axis["bottom"].label.set_visible(True)
> 
> hplt, = host.plot(np.random.rand(100))
> p2, = parx.plot(np.linspace(0,20,100), np.random.rand(100)*5.0,
> color='green')
> 
> plt.show()
> 
OK, answer my own question. Just remove the line 'parx.plot(...'). I didn't 
realize that I'd get the second axis drawn without that plot call, but it works 
fine.
From: Paul N. <pno...@gm...> - 2011年09月12日 12:30:18
I have the HTML5 Canvas backend working on an Ubuntu machine using
the latest EPD distribution.
However, I am unable to get it to work through an ssh tunnel.
- I create a tunnel forwarding port 9000 on the Ubuntu host machine 
through a firewall machine to port 9000 on my local client.
- I run examples/subplot_demo.py in a separate ssh-tunneled terminal
- I open http://127.0.0.1:9000 in Google Chrome on the client.
I get the HTML 5 Canvas window, but no plot appears and it says 
'Disconnected'. Same thing happens if I open a browser in a Gnome 
session on the host. Running the example on the host in a Gnome 
session and viewing from a client does not work either.
But running the same example from a terminal on the host _and_ viewing it in a 
Gnome session on the host works.
When I run the example, it tries to open a terminal based browser like
lynx and w3m. I uninstalled these applications and now get nothing, but 
this may be an issue. On the host, it opens the window in Chrome automatically
 and starts the browser if necessary. Is there a way to stop this behavior?
Thanks,
Paul
From: Neal B. <ndb...@gm...> - 2011年09月12日 11:08:36
Actually, though, I didn't want to plot 2 different sets of data as in that 
example, I want 1 set of data plotted with 2 different x-axis (different units).
Any suggestion on modifying this example to accomplish this?
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid.parasite_axes import SubplotHost
fig = plt.figure(figsize=(10,8))
host = SubplotHost(fig, 111)
fig.add_subplot(host)
parx = host.twiny()
parx.axis["top"].set_visible(False)
offset = 0, -50
new_axisline = parx.get_grid_helper().new_fixed_axis
parx.axis["bottom"] = new_axisline(loc="bottom", axes=parx, offset=offset)
parx.axis["bottom"].label.set_visible(True)
hplt, = host.plot(np.random.rand(100))
p2, = parx.plot(np.linspace(0,20,100), np.random.rand(100)*5.0,
color='green')
plt.show()
From: Fernando P. <fpe...@gm...> - 2011年09月12日 06:23:29
Hi all,
SC is the largest conference focused on high-performance computing,
this year it will be held in Seattle:
http://sc11.supercomputing.org/
and as part of the conference, a Python-focused workshop is being
organized. The deadline for papers is coming up soon (Sept 19), so if
you are interested in participating there is still time to get your
submission ready! Papers up to 10 pages are welcome on any of the
following topics:
 Python-based scientific applications and libraries
 High performance computing
 Parallel Python-based programming languages
 Scientific visualization
 Scientific computing education
 Python performance and language issues
 Problem solving environments with Python
 Performance analysis tools for Python application
For full details, please see:
http://www.dlr.de/sc/desktopdefault.aspx/tabid-1183/1638_read-31733/
From: Gökhan S. <gok...@gm...> - 2011年09月12日 01:37:30
The master is here. JJ had showed me those multi axes tricks and he is back
again with the plenty of changes to the axes_grid toolkit.
The best thing to do is to make a new clone from the master repo and
experiment.
On Sun, Sep 11, 2011 at 1:37 PM, Neal Becker <ndb...@gm...> wrote:
> Jae-Joon Lee wrote:
>
> > On Sun, Sep 11, 2011 at 10:16 PM, Neal Becker <ndb...@gm...>
> wrote:
> >> Yes, that's very helpful. Just one thing. How would I get a bit more
> bottom
> >> margin on the main figure to leave more room for the extra axis?
> >>
> >> I'm using this as an example. I experimented with plt.subplots_adjust,
> which
> >> seems like it might do the right thing. Is this the 'best' approach?
> >> (I really don't know what all these methods do, just guessing)
> >
> > Yes, you need to fiddle with subplots_adjust command. The current
> > development branch of matplotlib (not yet released) has a new function
> > "tight_layout", which does this automatically for you.
> > Regards,
> >
> > -JJ
> Looking forward to that. Any idea of an ETA for a release?
>
>
>
> ------------------------------------------------------------------------------
> Using storage to extend the benefits of virtualization and iSCSI
> Virtualization increases hardware utilization and delivers a new level of
> agility. Learn what those decisions are and how to modernize your storage
> and backup environments for virtualization.
> http://www.accelacomm.com/jaw/sfnl/114/51434361/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
-- 
Gökhan
From: Neal B. <ndb...@gm...> - 2011年09月11日 19:38:07
Jae-Joon Lee wrote:
> On Sun, Sep 11, 2011 at 10:16 PM, Neal Becker <ndb...@gm...> wrote:
>> Yes, that's very helpful. Just one thing. How would I get a bit more bottom
>> margin on the main figure to leave more room for the extra axis?
>>
>> I'm using this as an example. I experimented with plt.subplots_adjust, which
>> seems like it might do the right thing. Is this the 'best' approach?
>> (I really don't know what all these methods do, just guessing)
> 
> Yes, you need to fiddle with subplots_adjust command. The current
> development branch of matplotlib (not yet released) has a new function
> "tight_layout", which does this automatically for you.
> Regards,
> 
> -JJ
Looking forward to that. Any idea of an ETA for a release?
From: Daniel H. <dh...@gm...> - 2011年09月11日 18:20:58
Mpl 1.0.0
The way Annotation.draw (in text.py) is implemented, if an annotation
is created with an annotation point (x,y) and text located at (tx,ty)
and then the you pan around on the graph such that (x,y) is no longer
visible, the annotation suddenly disappears.
I would suggest the following modification to Annotation.draw in
text.py. All it does is set a clip box so that the annotation and
arrow is still drawn, but the arrow is clipped at the axes boundary.
It is a much nicer effect than the annotation disappearing. I have
made this modification in my source locally, and it works very well,
but I thought I would suggest here for inclusion into the main code
base.
Modified lines are marked with a CHANGEME. It is only a four line change.
 @allow_rasterization
 def draw(self, renderer):
 """
 Draw the :class:`Annotation` object to the given *renderer*.
 """
 if renderer is not None:
 self._renderer = renderer
 if not self.get_visible(): return
 xy_pixel = self._get_position_xy(renderer)
 #if not self._check_xy(renderer, xy_pixel): CHANGEME (commented out)
 # return
CHANGEME (commented out)
 self._update_position_xytext(renderer, xy_pixel)
 self.update_bbox_position_size(renderer)
 if self.arrow is not None:
 if self.arrow.figure is None and self.figure is not None:
 self.arrow.figure = self.figure
 self.arrow.set_clip_box(self.axes.bbox) # CHANGEME (new line)
 self.arrow.draw(renderer)
 if self.arrow_patch is not None:
 if self.arrow_patch.figure is None and self.figure is not None:
 self.arrow_patch.figure = self.figure
 self.arrow_patch.set_clip_box(self.axes.bbox) # CHANGEME (new line)
 self.arrow_patch.draw(renderer)
 Text.draw(self, renderer)
--
Daniel Hyams
dh...@gm...
From: Jae-Joon L. <lee...@gm...> - 2011年09月11日 15:20:02
On Sun, Sep 11, 2011 at 10:16 PM, Neal Becker <ndb...@gm...> wrote:
> Yes, that's very helpful. Just one thing. How would I get a bit more bottom
> margin on the main figure to leave more room for the extra axis?
>
> I'm using this as an example. I experimented with plt.subplots_adjust, which
> seems like it might do the right thing. Is this the 'best' approach?
> (I really don't know what all these methods do, just guessing)
Yes, you need to fiddle with subplots_adjust command. The current
development branch of matplotlib (not yet released) has a new function
"tight_layout", which does this automatically for you.
Regards,
-JJ
From: Jae-Joon L. <lee...@gm...> - 2011年09月11日 15:16:35
Just in case, here is a version with "axes_grid1" toolkit. Note that
axes_grid is kind of deprecated.
Regards,
-JJ
import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits.axes_grid1 as axes_grid1
host = axes_grid1.host_subplot(111)
hplt, = host.plot(np.random.rand(100))
from matplotlib.transforms import Affine2D
transfrom_from_parx_to_host = Affine2D().scale(1000, 1)
parx = host.twin(transfrom_from_parx_to_host)
if 1: # adjust axis postion etc.
 parx.axis["right"].toggle(ticklabels=False)
 parx.axis["top"].toggle(ticklabels=False)
 parx.axis["bottom"].toggle(ticklabels=True)
 parx.axis["bottom"].line.set_visible(True)
 parx.spines["bottom"].set_position(('outward',20))
plt.show()
On Sat, Sep 10, 2011 at 6:14 AM, Gökhan Sever <gok...@gm...> wrote:
> Hi,
> The code below should create a properly placed 2nd x-axis. You might need to
> adjust the placement of the figure canvas to match into the window.
> import numpy as np
> import matplotlib.pyplot as plt
> from mpl_toolkits.axes_grid.parasite_axes import SubplotHost
> fig = plt.figure(figsize=(10,8))
> host = SubplotHost(fig, 111)
> fig.add_subplot(host)
> parx = host.twiny()
> parx.axis["top"].set_visible(False)
> offset = 0, -50
> new_axisline = parx.get_grid_helper().new_fixed_axis
> parx.axis["bottom"] = new_axisline(loc="bottom", axes=parx, offset=offset)
> parx.axis["bottom"].label.set_visible(True)
> hplt, = host.plot(np.random.rand(100))
> p2, = parx.plot(np.linspace(0,20,100), np.random.rand(100)*5.0,
> color='green')
> plt.show()
>
> There is also another example at:
> http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html#axisartist-with-parasiteaxes
> Hope this helps.
> On Fri, Sep 9, 2011 at 12:50 PM, Neal Becker <ndb...@gm...> wrote:
>>
>> Neal Becker wrote:
>>
>> > I have a semilog plot. I'd like to add a second x axis (maybe below the
>> > existing one, or else maybe on top of graph). This second x axis is
>> > simply
>> > describing the same existing data, in different units.
>> >
>> > For example imagine a plot of
>> >
>> > x - time in seconds
>> > y - velocity
>> >
>> > x2 - time in minutes
>> >
>> >
>>
>> This almost works:
>>  fig = plt.figure()
>>  ax = fig.add_subplot(111)
>> ...
>>  ax2 = ax.twiny()
>>  min_x, max_x = ax.get_xlim()
>>  ax2.set_xlim (min_x-1, max_x-1)
>>
>> except the 2nd x axis is on the top, and prints right on top of the title
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Why Cloud-Based Security and Archiving Make Sense
>> Osterman Research conducted this study that outlines how and why cloud
>> computing security and archiving is rapidly being adopted across the IT
>> space for its ease of implementation, lower cost, and increased
>> reliability. Learn more. http://www.accelacomm.com/jaw/sfnl/114/51425301/
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
> --
> Gökhan
>
> ------------------------------------------------------------------------------
> Why Cloud-Based Security and Archiving Make Sense
> Osterman Research conducted this study that outlines how and why cloud
> computing security and archiving is rapidly being adopted across the IT
> space for its ease of implementation, lower cost, and increased
> reliability. Learn more. http://www.accelacomm.com/jaw/sfnl/114/51425301/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Neal B. <ndb...@gm...> - 2011年09月11日 13:16:29
Gökhan Sever wrote:
> Hi,
> 
> The code below should create a properly placed 2nd x-axis. You might need to
> adjust the placement of the figure canvas to match into the window.
> 
> import numpy as np
> import matplotlib.pyplot as plt
> from mpl_toolkits.axes_grid.parasite_axes import SubplotHost
> 
> fig = plt.figure(figsize=(10,8))
> host = SubplotHost(fig, 111)
> fig.add_subplot(host)
> parx = host.twiny()
> 
> parx.axis["top"].set_visible(False)
> offset = 0, -50
> new_axisline = parx.get_grid_helper().new_fixed_axis
> parx.axis["bottom"] = new_axisline(loc="bottom", axes=parx, offset=offset)
> parx.axis["bottom"].label.set_visible(True)
> 
> hplt, = host.plot(np.random.rand(100))
> p2, = parx.plot(np.linspace(0,20,100), np.random.rand(100)*5.0,
> color='green')
> 
> plt.show()
> 
> 
> There is also another example at:
> 
http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html#axisartist-
with-parasiteaxes
> 
> Hope this helps.
Yes, that's very helpful. Just one thing. How would I get a bit more bottom 
margin on the main figure to leave more room for the extra axis?
I'm using this as an example. I experimented with plt.subplots_adjust, which 
seems like it might do the right thing. Is this the 'best' approach?
(I really don't know what all these methods do, just guessing)
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid.parasite_axes import SubplotHost
from matplotlib.backends.backend_pdf import PdfPages
pdf = PdfPages('results.pdf')
fig = plt.figure(figsize=(10,8))
host = SubplotHost(fig, 111)
ax = fig.add_subplot(host)
plt.subplots_adjust (bottom=0.1)
parx = host.twiny()
parx.axis["top"].set_visible(False)
offset = 0, -30
new_axisline = parx.get_grid_helper().new_fixed_axis
parx.axis["bottom"] = new_axisline(loc="bottom", axes=parx, offset=offset)
parx.axis["bottom"].label.set_visible(True)
hplt, = host.plot(np.linspace(0,20,100), np.random.rand(100))
plt.xlabel ('Es/No')
p2, = parx.plot(np.linspace(0,20,100)-5, np.random.rand(100)*5.0, color='green')
parx.set_xlabel ('$Eb_{i}/No$')
#plt.show()
pdf.savefig (fig)
plt.close()
pdf.close()
From: xyz <mi...@op...> - 2011年09月11日 12:09:15
Sorry, this is the correct link 
http://pcp.oxfordjournals.org/content/52/2/274/F2.expansion.html (Fig2).
Thank you in advance,
On 09/11/2011 04:33 PM, Eric Firing wrote:
> On 09/10/2011 07:57 PM, xyz wrote:
>> Hello,
>> How is it possible to paint this kind graph
>> http://pcp.oxfordjournals.org/content/52/2/274 with Matplotlib?
> Your link leads to a journal abstract, not to a graph. There are
> several figures in the paper. It looks like any of them could be made
> with matplotlib--all are 2-D figures, and mpl is a capable 2-D plotting
> library--but each would require some programming using that library.
>
> Eric
>
>> Thank you in advance.
>>
>> Cheers,
>>
>> Michal
> ------------------------------------------------------------------------------
> Using storage to extend the benefits of virtualization and iSCSI
> Virtualization increases hardware utilization and delivers a new level of
> agility. Learn what those decisions are and how to modernize your storage
> and backup environments for virtualization.
> http://www.accelacomm.com/jaw/sfnl/114/51434361/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Eric F. <ef...@ha...> - 2011年09月11日 06:33:32
On 09/10/2011 07:57 PM, xyz wrote:
> Hello,
> How is it possible to paint this kind graph
> http://pcp.oxfordjournals.org/content/52/2/274 with Matplotlib?
Your link leads to a journal abstract, not to a graph. There are 
several figures in the paper. It looks like any of them could be made 
with matplotlib--all are 2-D figures, and mpl is a capable 2-D plotting 
library--but each would require some programming using that library.
Eric
>
> Thank you in advance.
>
> Cheers,
>
> Michal
From: xyz <mi...@op...> - 2011年09月11日 06:01:09
Hello,
How is it possible to paint this kind graph 
http://pcp.oxfordjournals.org/content/52/2/274 with Matplotlib?
Thank you in advance.
Cheers,
Michal
From: xyz <mi...@op...> - 2011年09月10日 09:10:11
Hello,
I do not know how to extract coordinates from a dict in order to paint 
all three graphs:
from pprint import pprint
import matplotlib.pyplot as plt
fig = plt.figure()
data = {} # dict could contains more date, depends from the user input
#d1, d2, d3, .... are labels
data['d1'] = {1:2,2:5,3:6}
data['d2'] = {1:4,2:6,3:8}
data['d3'] = {1:1,2:2,3:2}
fig = plt.figure()
plt.plot(x, y1, '--bo', x, y2, '--go') # How would it be possible to 
replace it by dict data
How is it possible to draw all three graphs?
Thank you in advance.
From: Matt E. <ma...@ea...> - 2011年09月09日 22:04:56
Hi all,
I am encountering a memory leak type issue when running the following,
for example.
http://codepad.org/TNuCLT3k
Matplotlib version: 0.99.3
PyQt4 Version: 4.8.5
I found a thread in the archive relating to this issue which supposedly
disappeared upon updating to PyQt 4.8.4 (I trust it would not have been
reintroduced in going to .5).
Can someone confirm or deny replication of this issue with their setup
and/or offer a solution?
Thanks very much
Matt Earnshaw
From: Gökhan S. <gok...@gm...> - 2011年09月09日 21:15:05
Hi,
The code below should create a properly placed 2nd x-axis. You might need to
adjust the placement of the figure canvas to match into the window.
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid.parasite_axes import SubplotHost
fig = plt.figure(figsize=(10,8))
host = SubplotHost(fig, 111)
fig.add_subplot(host)
parx = host.twiny()
parx.axis["top"].set_visible(False)
offset = 0, -50
new_axisline = parx.get_grid_helper().new_fixed_axis
parx.axis["bottom"] = new_axisline(loc="bottom", axes=parx, offset=offset)
parx.axis["bottom"].label.set_visible(True)
hplt, = host.plot(np.random.rand(100))
p2, = parx.plot(np.linspace(0,20,100), np.random.rand(100)*5.0,
color='green')
plt.show()
There is also another example at:
http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html#axisartist-with-parasiteaxes
Hope this helps.
On Fri, Sep 9, 2011 at 12:50 PM, Neal Becker <ndb...@gm...> wrote:
> Neal Becker wrote:
>
> > I have a semilog plot. I'd like to add a second x axis (maybe below the
> > existing one, or else maybe on top of graph). This second x axis is
> simply
> > describing the same existing data, in different units.
> >
> > For example imagine a plot of
> >
> > x - time in seconds
> > y - velocity
> >
> > x2 - time in minutes
> >
> >
>
> This almost works:
> fig = plt.figure()
> ax = fig.add_subplot(111)
> ...
> ax2 = ax.twiny()
> min_x, max_x = ax.get_xlim()
> ax2.set_xlim (min_x-1, max_x-1)
>
> except the 2nd x axis is on the top, and prints right on top of the title
>
>
>
> ------------------------------------------------------------------------------
> Why Cloud-Based Security and Archiving Make Sense
> Osterman Research conducted this study that outlines how and why cloud
> computing security and archiving is rapidly being adopted across the IT
> space for its ease of implementation, lower cost, and increased
> reliability. Learn more. http://www.accelacomm.com/jaw/sfnl/114/51425301/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
-- 
Gökhan
From: Neal B. <ndb...@gm...> - 2011年09月09日 18:50:38
Neal Becker wrote:
> I have a semilog plot. I'd like to add a second x axis (maybe below the
> existing one, or else maybe on top of graph). This second x axis is simply
> describing the same existing data, in different units.
> 
> For example imagine a plot of
> 
> x - time in seconds
> y - velocity
> 
> x2 - time in minutes
> 
> 
This almost works:
 fig = plt.figure() 
 ax = fig.add_subplot(111) 
...
 ax2 = ax.twiny()
 min_x, max_x = ax.get_xlim()
 ax2.set_xlim (min_x-1, max_x-1)
except the 2nd x axis is on the top, and prints right on top of the title
From: Paul H. <pmh...@gm...> - 2011年09月09日 18:36:01
Ben and Yves,
Might this be behavior defined in the matplotlibrc file?
In [21]: import matplotlib as mpl
In [22]: mpl.rcParams['figure.edgecolor']
Out[22]: 'w'
-paul
On Fri, Sep 9, 2011 at 9:37 AM, Benjamin Root <ben...@ou...> wrote:
> On Fri, Sep 9, 2011 at 3:49 AM, Yves Revaz <yve...@ep...> wrote:
>>
>> On 09/08/2011 06:09 PM, Benjamin Root wrote:
>>
>> On Thu, Sep 8, 2011 at 10:30 AM, Yves Revaz <yve...@ep...> wrote:
>>>
>>> Dear List,
>>>
>>> when I'm saving a plot with the option facecolor='k',
>>> around my image, there is still a one pixel white border.
>>>
>>> How is it possible to remove this ?
>>>
>>> try for example this very simple script:
>>> (using )
>>>
>>> import pylab as pt
>>> from numpy import *
>>>
>>> x = arange(0,10)
>>> y = x**2
>>> pt.plot(x,y)
>>>
>>> pt.savefig('qq.png',facecolor='k')
>>>
>>>
>>> Thanks in advance.
>>>
>>> yves
>>>
>>
>> yves,
>>
>> This might depend on the version of matplotlib and which backend you are
>> using. I currently do not see this white line on my development build of
>> mpl using the GTKAgg backend. What are you using?
>>
>>
>> Hi Ben,
>>
>> Thanks for you reply.
>>
>> I'm using :
>>
>> >>> import matplotlib
>> >>> matplotlib.__version__
>> '1.0rc1'
>
> That version is over a year old. Since then, I know that some "off-by-one"
> pixel bugs have been fixed.
>
>>
>> with the GTKAgg backend.
>> I join a zoom of a corner of the image to show that
>> there is one white line and a second gray one.
>>
>> I tried different backend, with some of them (XV, GTKCairo),
>> the white line disapears but in all cases, the gray line is present :-( .
>>
>> Do you really have nothing like that ?
>>
>
> No, not in the latest development version, but I haven't checked for a gray
> line. Then again, that may be dependent upon the graphics viewer.
>
> You could try installing v1.0.1 now, or wait a bit for the upcoming v1.1
> release.
>
> I hope this helps!
> Ben Root
>
>
> ------------------------------------------------------------------------------
> Why Cloud-Based Security and Archiving Make Sense
> Osterman Research conducted this study that outlines how and why cloud
> computing security and archiving is rapidly being adopted across the IT
> space for its ease of implementation, lower cost, and increased
> reliability. Learn more. http://www.accelacomm.com/jaw/sfnl/114/51425301/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Daniel H. <dh...@gm...> - 2011年09月09日 18:18:59
Attachments: hitlist_problem.py
[resend: apologies for the html mail].
I was trying to implement something where the user could change the
properties of an artist by right clicking on it...so I needed to find
out what artists are under the cursor at the time of the click. It is
possible that the method that I'm using isn't the recommended one; if
not, I would appreciate any suggestions.
 I'm using fig.hitlist() to get the list of artists. This function
works just fine with a regular xy plot, but if one (or both) of the
axes are in log scale, I get a NotImplementedError exception and
associated stack trace (run the attached demo code to see). The
exception is being caused by line 249 in artists.py.
Now, if I modify artists.py slightly to swallow the exception, replacing
 for a in self.get_children():
   L.extend(a.hitlist(event))
 with
 try:
 for a in self.get_children():
   L.extend(a.hitlist(event))
 except:
  pass
 Then everything seems to work. However, being unfamiliar with the
code, I'm not sure what else that might break, or how bad of an idea
swallowing the exception is here.
 I have attached a small demo code. The error occurs in matplotlib
1.0.0 and matplotlib 1.0.1, on both Linux and Windows.
--
Daniel Hyams
dh...@gm...
From: Neal B. <ndb...@gm...> - 2011年09月09日 17:37:28
I have a semilog plot. I'd like to add a second x axis (maybe below the 
existing one, or else maybe on top of graph). This second x axis is simply 
describing the same existing data, in different units.
For example imagine a plot of
x - time in seconds
y - velocity
x2 - time in minutes
From: Benjamin R. <ben...@ou...> - 2011年09月09日 16:38:06
On Fri, Sep 9, 2011 at 3:49 AM, Yves Revaz <yve...@ep...> wrote:
> **
> On 09/08/2011 06:09 PM, Benjamin Root wrote:
>
> On Thu, Sep 8, 2011 at 10:30 AM, Yves Revaz <yve...@ep...> wrote:
>
>> Dear List,
>>
>> when I'm saving a plot with the option facecolor='k',
>> around my image, there is still a one pixel white border.
>>
>> How is it possible to remove this ?
>>
>> try for example this very simple script:
>> (using )
>>
>> import pylab as pt
>> from numpy import *
>>
>> x = arange(0,10)
>> y = x**2
>> pt.plot(x,y)
>>
>> pt.savefig('qq.png',facecolor='k')
>>
>>
>> Thanks in advance.
>>
>> yves
>>
>>
> yves,
>
> This might depend on the version of matplotlib and which backend you are
> using. I currently do not see this white line on my development build of
> mpl using the GTKAgg backend. What are you using?
>
>
> Hi Ben,
>
> Thanks for you reply.
>
> I'm using :
>
> >>> import matplotlib
> >>> matplotlib.__version__
> '1.0rc1'
>
That version is over a year old. Since then, I know that some "off-by-one"
pixel bugs have been fixed.
>
> with the GTKAgg backend.
> I join a zoom of a corner of the image to show that
> there is one white line and a second gray one.
>
> I tried different backend, with some of them (XV, GTKCairo),
> the white line disapears but in all cases, the gray line is present :-( .
>
> Do you really have nothing like that ?
>
>
No, not in the latest development version, but I haven't checked for a gray
line. Then again, that may be dependent upon the graphics viewer.
You could try installing v1.0.1 now, or wait a bit for the upcoming v1.1
release.
I hope this helps!
Ben Root
On 9/9/2011 6:42 AM, Scott Sinclair wrote:
> On 8 September 2011 19:20, Matt Funk <mat...@gm...> wrote:
>> Hi,
>> sorry that it has taken me so long to reply. Anyway, i could be wrong, but i
>> don't think that the code:
>> xi = np.linspace(llcrnlon,urcrnlon,1000)
>> yi = np.linspace(llcrnlat,urcrnlat,1000)
>>
>> will produce a grid which gives the lat/lon coordinates with 1km spacing.
>> The reason being is that the distance between 2 lons (say -117.731659 and
>> -91.303642) is different depending on where you are in terms of the latitude
>> (i.e. the extreme examples are of course the north pole vs the equator). So
>> the above gives a regular grid in terms of degrees but not in terms of
>> distance.
> Yes, that's correct. You'll need to project your original data
> locations into a cartesian co-ordinate system before interpolating
> their values onto a regular grid in that co-ordinate system using
> griddata et al.
>
> You might like to use pyproj (included with the basemap toolkit) to
> help you project from lat/lon to your chosen co-ordinate system..
I have been using gdal for many of my geographic needs. Is there an
advantage/disadvantage using pyproj vs capabilities found in gdal (from
what i understand both are based on PROJ.4)? Can you comment on this?
Also, i was thinking of projecting things to UTM for interpolation
purposes. Is there any apparent reason this is a bad idea vs a different
projected coordinate system?
matt
>
> Cheers,
> Scott
>
> ------------------------------------------------------------------------------
> Why Cloud-Based Security and Archiving Make Sense
> Osterman Research conducted this study that outlines how and why cloud
> computing security and archiving is rapidly being adopted across the IT 
> space for its ease of implementation, lower cost, and increased 
> reliability. Learn more. http://www.accelacomm.com/jaw/sfnl/114/51425301/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
Matt Funk
Research Associate
Plant and Environmental Scienc. Dept.
New Mexico State University
On 8 September 2011 19:20, Matt Funk <mat...@gm...> wrote:
> Hi,
> sorry that it has taken me so long to reply. Anyway, i could be wrong, but i
> don't think that the code:
>   xi = np.linspace(llcrnlon,urcrnlon,1000)
>   yi = np.linspace(llcrnlat,urcrnlat,1000)
>
> will produce a grid which gives the lat/lon coordinates with 1km spacing.
> The reason being is that the distance between 2 lons (say -117.731659 and
> -91.303642) is different depending on where you are in terms of the latitude
> (i.e. the extreme examples are of course the north pole vs the equator). So
> the above gives a regular grid in terms of degrees but not in terms of
> distance.
Yes, that's correct. You'll need to project your original data
locations into a cartesian co-ordinate system before interpolating
their values onto a regular grid in that co-ordinate system using
griddata et al.
You might like to use pyproj (included with the basemap toolkit) to
help you project from lat/lon to your chosen co-ordinate system..
Cheers,
Scott
From: Jakob M. <jak...@gm...> - 2011年09月09日 10:49:28
2011年9月8日 Jeff Whitaker <js...@fa...>:
> On 9/8/11 1:51 AM, Jakob Malm wrote:
>>
>> Picking up on an old thread. Hopefully Jeff is still listening in...
>>
>> On 2010年04月04日 23:24, Jeff Whitaker wrote:
>>>
>>> On 4/4/10 11:06 AM, Will Hewson wrote:
>>>>
>>>> Hi again Jeff et al...
>>>>
>>>> I've had a play around with the extra few lines of code - on paper this
>>>> seems like it should solve the problems I'm experiencing. However, an
>>>> error's being thrown up by the transform scalar function, as my lons and
>>>> lats won't necessarily be increasing. The data I'm plotting is satellite
>>>> data and so at the beginning and end of the orbit file lats go over the
>>>> pole
>>>> from 90 to -90, with a similar problem for the lons - whereby the data
>>>> is
>>>> taken across the satellite track. I've thought about sorting the data
>>>> before
>>>> passing it to transform_scalar but I'm always going to be left with the
>>>> problem in either lats or lons.
>>>>
>>>> I've uploaded the file I'm currently working with this time. It's three
>>>> columns of lons, lats and z values.
>>>>
>>>> Once again, many thanks for your help.
>>>>
>>>> Will.
>>>>
>>>> http://old.nabble.com/file/p28133659/test.plt test.plt
>>>>
>>> Will: Is it a regular lat/lon grid or a satellite swath? If it's the
>>> latter, you can't use my solution.
>>>
>>> -Jeff
>>
>> What if it _is_ a satellite swath? Can I get around the problem of
>> off-projection plotting with Basemap.pcolormesh()?
>> Example code and plots can be found at
>>
>> http://pythonbits.blogspot.com/2011/09/i-have-problem-with-basemap-plotting.html
>>
>> Thanks,
>> Jakob Malm
>>
>
>
> Jakob: I think that's the price you pay for the speed of pcolormesh (vs
> pcolor). It appears to make more assumptions about the structure of your
> data. I don't see any way around it.
>
> -Jeff
>
Hmm... I believe I have been able to get around it previously, but
perhaps I just fell back to using pcolor...
Thanks,
Jakob
9 messages has been excluded from this view by a project administrator.

Showing results of 312

<< < 1 .. 7 8 9 10 11 .. 13 > >> (Page 9 of 13)
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 によって変換されたページ (->オリジナル) /