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

Showing 7 results of 7

> What version of mpl are you using? 
My mpl version is 0.99.1
> Are you modifying the default anti-aliasing in the patch collections that
> contour is creating?
Could you please tell me how to this? I am very new to matplotlib, thank you
very much if you can give me some advices.
>Are you seeing the problem when using the ps and pdf backends, or only with
agg (that is, creating png files directly)?
So far I only creating png files directly. Also, how to use ps and pdf
backend?
> ....which has been fixed in svn.
Do you mean I should download another mpl by svn?
Thank you for your answers very much!
efiring wrote:
> 
> What version of mpl are you using? Are you modifying the default 
> anti-aliasing in the patch collections that contour is creating? Are you 
> seeing the problem when using the ps and pdf backends, or only with agg 
> (that is, creating png files directly)?
> 
> There are two problems that can contribute to this, one related to the 
> way the agg backend handles the boundaries between filled regions, and 
> the other a bug in path simplification, which has been fixed in svn.
> 
> Eric
> 
> 
> ------------------------------------------------------------------------------
> Download Intel® 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/contourf-creats-white-like-lines-%28or-gaps%29-between-each-two-color-patches-tp27982822p28210898.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: John H. <jd...@gm...> - 2010年04月11日 17:07:41
This is mainly a question for JJ. I would like to make a schematic
diagram, like you might get from Dia or OmniGraffle. With the offset
boxes, annotations, vpackers/hpackers and fancy arrows, it seems like
the pieces are mostly in place. Unlike simple annotations, I need to
have multiple arrows originating from a single box. The diagram I am
trying to draw shows the relationship between various packages for
scientific computing in python. The crude ASCII art picture looks
like this:
 Python
 / \
 / \
 IPython Numpy
 | / \
 | / \
 matplotlib scipy
where arrows are pointing from
 Python -> IPython
 Python -> numpy
 IPython -> matplotlib
 numpy -> matplotlib
 numpy -> scipy
and IPython and numpy are on one level (HPacker?) and are below Python
(Vpacker?) and so on. Each text instance is surrounded by a fancy box
and are connected by fancy arrows.
Is it fairly easy to put something like this together using all the
offsetbox tools and fancy arrows?
Thanks,
JDH
From: Peter B. <bu...@gm...> - 2010年04月11日 16:40:59
sorry if this has been covered before, but I must say I've found the
following quite confusing :
color="cyan" is not in fact equivalent to color='c'
in colors.py :
Commands which take color arguments can use several formats to specify
the colors. For the basic builtin colors, you can use a single letter
 - b : blue
 - g : green
 - r : red
 - c : cyan
 - m : magenta
 - y : yellow
 - k : black
 - w : white
in ColorConverter :
 colors = {
 'b' : (0.0, 0.0, 1.0),
 'g' : (0.0, 0.5, 0.0),
 'r' : (1.0, 0.0, 0.0),
 'c' : (0.0, 0.75, 0.75),
 'm' : (0.75, 0, 0.75),
 'y' : (0.75, 0.75, 0),
 'k' : (0.0, 0.0, 0.0),
 'w' : (1.0, 1.0, 1.0),
 }
we are told 'c' is short for cyan. Yet color="cyan" is not equivalent
to color='c'
 'cyan' : '#00FFFF'
In [50]: rgb2hex((0.0, 0.75, 0.75))
Out[50]: '#00bfbf'
From: John H. <jd...@gm...> - 2010年04月11日 14:19:39
On Sun, Apr 11, 2010 at 7:15 AM, tom...@gm...
<tom...@gm...> wrote:
> can someone help me to plot a polygon in matplotlib?
>
> I have been reading about the axes.patches.Polygon class and I have defined
> the
>
> Polygon object that has a preset lw and points. How do I plot it?
>
> I'm confused because the Axes documentation states that this class holds
> most of
>
> the figure objects like Rectangle, Line2D, and then the website states that
> the Line2D
>
> is a return object from the plt.plot() invocation.
Yes, Axes.plot is a helper function which creates a Line2D object,
adds it to the axes, sets the transformation, etc... This process is
covered in some detail in the matplotlib Artist tutorial
 http://matplotlib.sourceforge.net/users/artists.html
and in the advanced matplotlib tutorial at scipy -- video available here
 http://www.archive.org/details/scipy09_advancedTutorialDay1_3
> What if I create my own
> set of Rectangle
>
> (Polygon) objects and want to create a list of them and plot them?
If you create your own polygons/rectangles/patches, create them, and
then add them with Axes.add_patch
 http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.Axes.add_patch
If you want to create a bunch of them, consider a PolygonCollection
(or a RegularPolygonCollection depending on your use case)
 http://matplotlib.sourceforge.net/api/collections_api.html
 http://matplotlib.sourceforge.net/search.html?q=codex+PolyCollection
> Also, I'm using this sequence of commands to work in OO mode interactively
>
> (just to learn) but when I execute plt.draw() no figure appears.
We make a distinction between raising a figure (plt.show) and
rendering to an existing figure (plt.draw). In interactive mode
(which is what ipython -pylab turns on) figures are automatically
raised/shown. You can control these settings from a regular python
shell using ion and ioff. See
 http://matplotlib.sourceforge.net/users/shell.html
Here is a complete example::
 import matplotlib.patches as patches
 import matplotlib.pyplot as plt
 fig = plt.figure()
 ax = fig.add_subplot(111)
 verts = [0,0], [0,1], [1,1], [1,0]
 poly = patches.Polygon(verts)
 ax.add_patch(poly)
 ax.set_xlim(-2,2)
 ax.set_ylim(-2,2)
 plt.show()
Hope this helps,
JDH
From: Alan G I. <ala...@gm...> - 2010年04月11日 13:40:02
On 4/11/2010 9:27 AM, Friedrich Romstedt wrote:
> I think you can use Tk via the Tkinter Python package. On linux I
> heard it's looking a bit weird, but as a starting points it's easy
> enough.
Weird how?
Will that be fixed with the new release (ttk, in Python 2.7)?
Thanks,
Alan Isaac
From: Friedrich R. <fri...@gm...> - 2010年04月11日 13:27:10
2010年4月11日 tom...@gm... <tom...@gm...>:
> can someone help me to plot a polygon in matplotlib?
> I have been reading about the axes.patches.Polygon class and I have defined
> the
> Polygon object that has a preset lw and points. How do I plot it?
Here http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.Axes.add_artist
maybe helps?
> I'm confused because the Axes documentation states that this class holds
> most of
> the figure objects like Rectangle, Line2D, and then the website states that
> the Line2D
> is a return object from the plt.plot() invocation. What if I create my own
> set of Rectangle
> (Polygon) objects and want to create a list of them and plot them?
afaik, the artist, or whatever, is retured to make its properties
adjustable later.
> Also, I'm using this sequence of commands to work in OO mode interactively
> (just to learn) but when I execute plt.draw() no figure appears.
>
> import numpy as np
> import matplotlib.pyplot as plt
>
> myFig = plt.figure()
>
> myAx = myFig.add_axes() # I have tried myFig.add_subplot(1,1,1) but it
> didn't help
>
> x = np.arange(0,np.pi, 0.01)
>
> myAx.plot (x, np.sin(x))
>
> plt.draw() # nothing happens
As your oo Figure is not registered to the plt module, since you
created it via api, this should be normal. Maybe have a look at
http://matplotlib.sourceforge.net/examples/user_interfaces/index.html
, I think you have to embed your api-created Figure in a widget
manager of your choice.
> These commands are executed within an interactive ipython session but if I
> start ipython
>
> with ipython -pylab, plt.draw() draws a figure I can see. I'm running Arch
> linux and Openbox
>
> as a window manager, the system is 64 bit.
I think you can use Tk via the Tkinter Python package. On linux I
heard it's looking a bit weird, but as a starting points it's easy
enough. But maybe try also the other widget managers, like Gtk.
There are certainly some people around which have more knowledge on
Gtk and so on than me having with Tkinter.
hth,
Friedrich
From: <tom...@gm...> - 2010年04月11日 12:18:37
Hi everyone,
can someone help me to plot a polygon in matplotlib?
I have been reading about the axes.patches.Polygon class and I have defined the
Polygon object that has a preset lw and points. How do I plot it? 
I'm confused because the Axes documentation states that this class holds most of 
the figure objects like Rectangle, Line2D, and then the website states that the Line2D
is a return object from the plt.plot() invocation. What if I create my own set of Rectangle
(Polygon) objects and want to create a list of them and plot them? 
Also, I'm using this sequence of commands to work in OO mode interactively 
(just to learn) but when I execute plt.draw() no figure appears. 
import numpy as np
import matplotlib.pyplot as plt
myFig = plt.figure()
myAx = myFig.add_axes() # I have tried myFig.add_subplot(1,1,1) but it didn't help
x = np.arange(0,np.pi, 0.01)
myAx.plot (x, np.sin(x))
plt.draw() # nothing happens
These commands are executed within an interactive ipython session but if I start ipython 
with ipython -pylab, plt.draw() draws a figure I can see. I'm running Arch linux and Openbox 
as a window manager, the system is 64 bit.

Showing 7 results of 7

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