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



Showing 14 results of 14

From: Jae-Joon L. <lee...@gm...> - 2010年03月04日 19:59:38
Not sure what exactly you want. Is this close?
ax = subplot(111)
tr = ax.get_xaxis_transform()
ax.plot([0.2, 0.8], [0.5, 0.5],
 transform=tr)
The x-coodinate is in data coordinate, but y coordinate is in
(normalized) axes coordinate.
More about the transforms behind matplotlib can be found in
http://matplotlib.sourceforge.net/trunk-docs/users/transforms_tutorial.html
-JJ
On Thu, Mar 4, 2010 at 3:10 AM, Timo Heine <tim...@gm...> wrote:
> Hello,
> I'v made a small program which plots data from a CAN-bus log file. Some of
> the data to plot is logical type on/off values (bit on or off). I have tried
> to find a way to plot this kind of data with no success.
> Basically what I want to do is to draw a horizontal line with relative y
> co-ordinates and absolute xmin and xmax co-ordinate. Then I could draw a
> line when a bit is high and have it always in plot area even when zooming
> etc. Like axhline(...) but with relative y and absolute x
> co-ordinates. Another way to do this could be using subplots, but I can't
> figure out how to use same x-scale on the both plots.
> Any suggestions?
> Best Regards
> Timo
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Jae-Joon L. <lee...@gm...> - 2010年03月04日 19:45:32
With axes aspect_ratio set, the position of the axes is determined
during the drawing time. And the position of the inset axes also need
to be adjusted during the drawing time to incorporate this,
One way to archive this is to set axes_locator attribute, which accept
a callable object that returns the position of the axes.
Here is a slightly modified version of your add_inset.
def add_inset(ax,ij):
 # Define a composite transform to go from data space in the Axes
 # instance to figure coordinates.
 # We need to perform a composite transform to get the location:
 # data to display followed by display to figure (because axes())
 # takes a rect for positions relative to the figure
 def my_axes_locator(axes, renderer):
 compTrans = ax.transData + ax.get_figure().transFigure.inverted()
 width=0.1
 height=0.1
 x,y = compTrans.transform(ij)
 bbox = [x-width/2.,y-height/2.,width,height]
 return bbox
 # Place a subplot centered on the specified location with a fixed size
 # (relative to the size of the figure)
 # The green dot we plot here should cover up the red dot on the plot
 # underneath this one. We have a problem if they don't align.
 ax2 = plt.axes([0,0,1,1],axisbg='none', axes_locator=my_axes_locator)
 ax2.plot(0.5,0.5,'go')
 ax2.set_xlim((0,1))
 ax2.set_ylim((0,1))
 return ax2
Regards,
-JJ
On Thu, Mar 4, 2010 at 12:53 PM, Mike Kay <vd...@gm...> wrote:
> Hi list -
>
> I've got a need to add several axes instances (e.g., barplots) to an
> existing figure. These additional axes need to be placed relative to data
> points on that plot.
>
> A problem occurs if the aspect ratio of the parent axes is set to a fixed
> value rather than using 'auto'.
>
> The attached script illustrates the problem with a pair of plots. Both plot
> a single red dot on the parent figure. A subplot is then placed directly on
> top of this point and a single point is plotted there, in green. If all's
> well you shouldn't see the red dot and should just see the green dot. In
> figure 2, where the aspect ratio is fixed, the subplot does not get placed
> at the correct location.
>
> Have I stumbled onto a subtlety of transforms that I'm not accounting for or
> is this perhaps a bug?
>
> matplotlib version 0.99.1 on linux; numpy 1.2.1
>
> thanks a lot,
> -mike
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Friedrich R. <fri...@gm...> - 2010年03月04日 18:36:16
Attachments: Bits.png
Do you want something like the attached?
I created it with my package that no-one wants :-(
>>> import diagram_cl
>>> import diagram_cl.kernels.tk
>>> import numpy
>>> import Tkinter
>>> d1 = diagram_cl.Diagram()
>>> series = (numpy.random.random(100) > 0.5).astype(numpy.float)
>>> for idx in xrange(0, len(series)):
... layer = diagram_cl.Layer2D(x = [0, series[idx]], y = [idx,
idx], color = 'blue')
... d1.add_layer(layer)
...
>>> tk = Tkinter.Tk()
>>> k1 = diagram_cl.kernels.tk.Diagram(tk, d1)
Double-right click on the figure, "Save", 200x200, "Bits.png".
But of course, you can also do it with normal matplotlib (I'm not used
to the pyplot things though, I'm rather using purist's API):
Hmm, that's why it would be not the standard way to do it, so can
anyone else post pure matplotlib means?
Friedrich
From: Jeff W. <js...@fa...> - 2010年03月04日 18:03:48
Jim Vickroy wrote:
> Hi,
>
> I have been unable to place a colorbar on the LEFT side of a figure. 
> For example, in the Gaussian noise with vertical colorbar 
> <http://matplotlib.sourceforge.net/examples/pylab_examples/colorbar_tick_labelling_demo.html> 
> demo, how can the colorbar be positioned on the left side of the figure.
>
> Thanks,
> -- jv
> 
Create your own axes instance for the colorbar (as in 
http://matplotlib.sourceforge.net/examples/pylab_examples/multi_image.html).
-Jeff
-- 
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jef...@no...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: Jim V. <Jim...@no...> - 2010年03月04日 17:58:43
Hi,
I have been unable to place a colorbar on the LEFT side of a figure. 
For example, in the Gaussian noise with vertical colorbar 
<http://matplotlib.sourceforge.net/examples/pylab_examples/colorbar_tick_labelling_demo.html> 
demo, how can the colorbar be positioned on the left side of the figure.
Thanks,
-- jv
From: kamaleon <fra...@ya...> - 2010年03月04日 17:58:21
Thanks you put it right,
I wanted to know how to remove them inside the subplot. It is done.
Cheers
Matthias Michler wrote:
> 
> On Thursday 04 March 2010 17:11:54 kamaleon wrote:
>> Thanks Matthias, this seems help me.
>> But how to remove the xlabel, ylable and the tilte in the subplot?
>> Cheers
>>
>> Matthias Michler wrote:
>> > On Thursday 04 March 2010 13:35:12 kamaleon wrote:
> [...]
> 
> Hi ,
> 
> what do you mean by xlabel, ylabel and title?
> In my example these were not set. In case you set them, you can remove
> them 
> using
> xlabel('')
> ylabel('')
> title('')
> 
> or do you mean the ticks and tick-labels on the axes?
> These can be removed using
> 
> xticks([ ])
> ytick([ ])
> 
> Kind regards,
> Matthias
> 
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://old.nabble.com/how-to-insert-a-part-of-a-plot-in-the-same-figure-tp27780169p27784306.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Mike K. <vd...@gm...> - 2010年03月04日 17:53:21
Attachments: insets.py
Hi list -
I've got a need to add several axes instances (e.g., barplots) to an
existing figure. These additional axes need to be placed relative to data
points on that plot.
A problem occurs if the aspect ratio of the parent axes is set to a fixed
value rather than using 'auto'.
The attached script illustrates the problem with a pair of plots. Both plot
a single red dot on the parent figure. A subplot is then placed directly on
top of this point and a single point is plotted there, in green. If all's
well you shouldn't see the red dot and should just see the green dot. In
figure 2, where the aspect ratio is fixed, the subplot does not get placed
at the correct location.
Have I stumbled onto a subtlety of transforms that I'm not accounting for or
is this perhaps a bug?
matplotlib version 0.99.1 on linux; numpy 1.2.1
thanks a lot,
-mike
From: Ben A. <BAx...@co...> - 2010年03月04日 16:37:29
what kind of errors did you get when building on windows? I recently found out that Visual Studio is required to build MPL on windows. This is because MPL contains C++ sources. Additionally, you must have the same version of Visual Studio that was used to build Python. So if you installed python 2.2.1 from a windows installer, then you will have to find out which version of Visual Studio to use. But I think if you build python yourself, then you can use whatever version of Visual Studio you want.
This is the error you get when you have the wrong version of Visual Studio. At least in Python 2.6. The error message may be different in older versions of python.
error: Unable to find vcvarsall.bat
-Ben
________________________________
From: Schnappauf, Andreas [mailto:And...@Is...]
Sent: Thursday, March 04, 2010 9:04 AM
To: mat...@li...
Subject: [Matplotlib-users] Older Version of Matplotlib for Python 2.2.1
Hi there,
I was searching for an older version of matplotlib for using it with python 2.2.1 (parts of the project can only be interpreted with this old version :().
Is there a package for an installation under windows (just like the current versions)?
I tried to build 0.80 and 0.87 from the sources and had no success.
Thx for any help!
Greetings
Andreas
________________________________
iSyst Intelligente Systeme GmbH
Nordostpark 91 | 90411 Nuernberg
Geschaeftsfuehrer: Prof. Dr.-Ing. Hans Rauch, Christine Rauch, Daniel Heinrich
Sitz der Gesellschaft: Nuernberg
Registergericht: Amtsgericht Nuernberg HRB 17887
Steuernr. 241/129/40894 | USt-IdNr.: DE212895677
From: kamaleon <fra...@ya...> - 2010年03月04日 16:12:00
Thanks Matthias, this seems help me.
But how to remove the xlabel, ylable and the tilte in the subplot?
Cheers
Matthias Michler wrote:
> 
> On Thursday 04 March 2010 13:35:12 kamaleon wrote:
>> Hey All,
>>
>> I have a fig, see attach image. I am plotting the number of infected
>> nodes
>> versus time. Time is running from 0 to 100.
>> I need to insert a subplot in that figure that shows me the number of
>> infected nodes for time running from 0 to 20 for example. If there is an
>> example that can do the same thing I want please post it to me or tell
>> me
>> how I can do it in matplotlib.
>>
>> Cheers.
>> http://old.nabble.com/file/p27780169/simbara-0%2B.41667-0-0.11-0.13-0.15-0.
>>18.png
> 
> I would add an additional axes 'ax2' with different x/y-limits and plot
> all 
> data to this axes. 
> 
> ax1 = axes()
> ax2 = axes([0.4, 0.4, 0.4, 0.4]) 
> # rectangle [left, bottom, width, height] in normalized (0, 1) units
> 
> ax1.plot(arange(100))
> draw()
> ax2.plot(arange(100))
> draw()
> ax2.set_xlim(0, 20)
> draw()
> 
> Kind regards,
> Matthias
> 
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://old.nabble.com/how-to-insert-a-part-of-a-plot-in-the-same-figure-tp27780169p27782907.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Schnappauf, A. <And...@Is...> - 2010年03月04日 14:28:39
Hi there,
I was searching for an older version of matplotlib for using it with python 2.2.1 (parts of the project can only be interpreted with this old version :().
Is there a package for an installation under windows (just like the current versions)?
I tried to build 0.80 and 0.87 from the sources and had no success.
Thx for any help!
Greetings
Andreas
________________________________
iSyst Intelligente Systeme GmbH
Nordostpark 91 | 90411 Nuernberg
Geschaeftsfuehrer: Prof. Dr.-Ing. Hans Rauch, Christine Rauch, Daniel Heinrich
Sitz der Gesellschaft: Nuernberg
Registergericht: Amtsgericht Nuernberg HRB 17887
Steuernr. 241/129/40894 | USt-IdNr.: DE212895677
From: kamaleon <fra...@ya...> - 2010年03月04日 12:35:27
Hey All,
I have a fig, see attach image. I am plotting the number of infected nodes
versus time. Time is running from 0 to 100.
I need to insert a subplot in that figure that shows me the number of
infected nodes for time running from 0 to 20 for example. If there is an
example that can do the same thing I want please post it to me or tell me
how I can do it in matplotlib.
Cheers.
http://old.nabble.com/file/p27780169/simbara-0%2B.41667-0-0.11-0.13-0.15-0.18.png 
-- 
View this message in context: http://old.nabble.com/how-to-insert-a-part-of-a-plot-in-the-same-figure-tp27780169p27780169.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: François B. <fra...@un...> - 2010年03月04日 11:17:05
Attachments: francois_beaubert.vcf
Andrea Gavana a écrit :
> Only the second approach slightly resembles what I have in mind.
> Navigating the plot using shortcuts and the MPL toolbars is less than
> 1% of what you can do to customize a MPL plot. Asking a user who knows
> nothing about Python (or programming in general) to use the IPython
> shell to modify the plot in runtime is unrealistic at best.
>
> The second approach looks interesting (pity it's been done using Qt,
> but then, the world is not perfect either...). I could use some of
> that code to build something that looks like a *beginning* of a
> possible customization of plots (using THE GUI toolkit). I thought
> this issue could have been important, as any other 2D/3D plotting
> toolkits (commercial and not commercial) have some (or a lot) of
> ability to customize their plots once they have been generated...
>
> Andrea.
> 
Jeremy Sanders initially developed Veusz as backend to Matplotlib but 
this branch was temporarily abandoned to restart recently. 
Matplotlib is THE reference library for scientific graphics under python 
and Veusz is also an EXCELLENT GUI app for scientific graphics. I think 
that Veusz+Matplolib could considerably widen their fields of 
application and theirs user's community if Matplotlib was used as a 
backend by default. This had already been spoken in veusz's mailing 
list and after these exchanges a new experimental branch (based on 
Matplotlib) was born. IMHO Matplotlib has now the object-orientated 
structure to easily use it for this purpose. Furthermore it now has 3d 
support as well as quiver plot and much more to offer.
https://mail.gna.org/public/veusz-discuss/2009-04/msg00005.html
https://code.launchpad.net/veusz/experimental
You could also see what Pierre Raybaut has already done with Spyder
 http://code.google.com/p/spyderlib/
Regards
Francois
From: Alexander D. <ale...@la...> - 2010年03月04日 08:40:22
Hi,
thanks a lot for your help, tips and investigations, but I still have
the problem. It looks like this cannot be reproduced somewhere else,
but I found out that I can see image with a dpi larger than 64 in the
figsave command. Anything with a dpi of 64 or smaller is just white.
See: http://atlas1.atlas.aei.uni-hannover.de/~dietz/Test/Subtest/
Cheers
 Alex
On Tue, Mar 2, 2010 at 20:47, Renato Alves <rj...@ig...> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Quoting Alexander Dietz on 03/02/2010 02:17 PM:
>> Hi,
>>
>> that is very interesting. So what about the following image:
>>
>> test_large.png
>>
>> which has been create with the exact same code. Does this file has an
>> alpha channel? Because this file I can see clearly on my browser.
>
> Yes, it does.
> Try running 'file name_of_file' on the console. You will RGB in one case
> and RGBA in the other.
>
> I ran a few tests on the files and they all look fine. No corruption.
>
> So it has to be something on your firefox... if you use a custom build,
> try recompiling it. Something could have gone wrong in the first run.
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkuNa2IACgkQYh11EUYTX9RhWACgmMj3pkqJOH2gJn8CYH8pRlnI
> a54An3S4zxj4vLO8v+4WobeoO5UPOUkq
> =f3Na
> -----END PGP SIGNATURE-----
>
From: Timo H. <tim...@gm...> - 2010年03月04日 08:10:15
Hello,
I'v made a small program which plots data from a CAN-bus log file. Some of
the data to plot is logical type on/off values (bit on or off). I have tried
to find a way to plot this kind of data with no success.
Basically what I want to do is to draw a horizontal line with relative y
co-ordinates and absolute xmin and xmax co-ordinate. Then I could draw a
line when a bit is high and have it always in plot area even when zooming
etc. Like axhline(...) but with relative y and absolute x
co-ordinates. Another way to do this could be using subplots, but I can't
figure out how to use same x-scale on the both plots.
Any suggestions?
Best Regards
Timo
3 messages has been excluded from this view by a project administrator.

Showing 14 results of 14

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 によって変換されたページ (->オリジナル) /