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


Showing 4 results of 4

From: John H. <jdh...@ac...> - 2005年03月27日 22:01:59
>>>>> "Jean-Michel" == Jean-Michel Philippe <jea...@ar...> writes:
 Jean-Michel> Hi, Does anyone know why Agg backend does not support
 Jean-Michel> non-ASCII chars? I think many non-English speaking
 Jean-Michel> users would really appreciate to be able to use their
 Jean-Michel> full alphabet in graphics ;-) while taking advantage
 Jean-Michel> of the great Agg technique.
We are in favor of unicode support in agg, we just haven't had the
time, knowledge or man-power to do it. fonts are hard, as you
probably know, and we have to figure out the right handling in
freetype and the ft2font wrapper, in the pycxx extension generating
code, and in the font manager. All manageable, but tough.
Have you seen the accented character demo?
 http://matplotlib.sf.net/examples/accented_text.py
Hopefully, someone (maybe you <wink>) will find the time to tackle
unicode support for ft2font, font_manager, and backend_agg in the
not-too-distant-future.
JDH
From: John H. <jdh...@ac...> - 2005年03月27日 21:57:11
>>>>> "Russell" == Russell E Owen <ro...@ce...> writes:
 Russell> We'd like to set up a set of plots that look something
 Russell> like: PPPP PPPP PPPP PPPP PPPP PPPP PPPP PPPP PPPP PPPP
 Russell> PPPP PPPP
 Russell> hhh s... hhhhh s... hhh s... hhhhhh s.....
 Russell> where - each set of Ps is a 4x4 pcolor plot representing
 Russell> signal on a 4x4 detector at a particular time. I.e. a 4x4
 Russell> array of solid blocks of gray. - h is a histogram - s is
 Russell> the left edge of a scatter plot/strip chart
 Russell> We have the basic layout, but are missing a few
 Russell> subtleties...
 Russell> If possible, when the window is resized we'd like to: -
 Russell> Resize the histogram and scatterplots but not the pcolor
 Russell> plots. (After all, there's no detail to zoom into in a
 Russell> 4x4 pcolor plot!) - Keep the pcolor plots (Ps) square.
Perry and I have been actively discussing the need for a physical size
Axes, rather than a relative size. This doesn't exist currently, but
might help enable something like what you want -- some axes that
resize dynamically with the figure window and some that don't. The
problem of creating axes where the aspect ratio is preserved even
under figure resizes is important to many people, so hopefully we can
get a working implementation sooner rather than later.
 Russell> My first thought was to set up multiple FigureCanvas
 Russell> objects and use tk's layout options. But the updating
 Russell> then looked funny (and seemed to go slower, though that
 Russell> may be my imagination). We're updating the displays at 2
 Russell> Hz (for data coming in at 20Hz) and all the plots are
 Russell> related, so it's important to update them all at the same
 Russell> time.
 Russell> Any hints would be appreciated.
If you wanted to turn your 4x4 pcolors into images using one means or
another, you could hack something out. The
matplotlib.figure.Figure.figimage command does a raw pixel dump to the
Figure window, which is not resized. You would have to use it
carefully but it should be doable. Eg, create Numerix arrays that
were right pixel dimensions you wanted and set the scalar values of
the various regions using array indexing. Not very elegant, but might
be usable. The tk canvas solution you tried is another good idea, but
I'm not sure how to best handle the synchronous updates problem.
 Russell> P.S. when using the TkAgg API, is this the usual idiom
 Russell> for turning off axis labels?: yls =
 Russell> self.axScatter.get_yticklabels() for yl in yls:
 Russell> yl.set_visible(False) I did not find any equivalent to
 Russell> the pylab.set command that automatically iterates over
 Russell> collections of ticks or labels. No big deal, but I'd
 Russell> simplify the code if I could.
I just moved the set/get stuff into the Artist class so you can use it
at the API level. This is not yet in CVS, but will be soon. For now,
the way you do it will work fine, even though it may not be as pithy.
JDH
From: John H. <jdh...@ac...> - 2005年03月27日 21:48:47
>>>>> "Simon" == Simon Hook <sim...@jp...> writes:
 Simon> I get the error:
 Simon> CGI ErrorThe specified CGI application misbehaved by not
 Simon> returning a complete set of HTTP headers. The headers it
 Simon> did return are:
It looks like it is dying when it tries to rebuild the font cache.
Did you get my response to your last message when I explained the
importance of setting the MATPLOTLIBDATA and/or the HOME environment
variables, especially when running in a non-standard environment such
as a web app server? Have you set these variables, do the directories
exist and are they writable in the environment in which the app server
is running? Does the MATPLOTLIBDATA dir contain your rc file and the
various default font files, eg the stuff that normally resides in
share/matplotlib?
 http://sourceforge.net/mailarchive/message.php?msg_id=11209033
My guess is that mpl is not finding a writable directory in which to
store it's cache information.
Hope this helps,
JDH
From: John H. <jdh...@ac...> - 2005年03月27日 21:40:22
>>>>> "Ben" == Ben Wilhelm <zo...@pa...> writes:
 Ben> I have the need to make a pcolor loglog plot. Unfortunately I
 Ben> can't figure out how - as near as I can tell it's impossible,
 Ben> pcolor loglog just plain isn't supported. It seems like the
The log transformation is a property of the x and y axes, not of the
plot type.
 Ben> ability to logify arbitrary axes would be a good idea
 Ben> (there's got to be *somebody* out there who wants a semilog
 Ben> polar projection) but I can't find it anywhere. Suggestions?
 Ben> Right now my best idea is to do the log transformation myself
 Ben> (eww) and then modify the axis legend (eww).
 Ben> The following code was a vague attempt to force pcolor to use
 Ben> loglog scale, but it crashes with the message "Aborted" -
 Ben> seems like a suboptimal error message. I should point out
When posting code to expose a bug, it is most helpful to post a script
that actually does something -- eg the "main" function in your script
is never called -- as well as the contextual information like which
backend you are running, platform information and so on. Most of this
contextual information is provided by running a script with
--verbose-helpful and reporting the output.
 Ben> that I'm currently using 0.72.1 since updating the corporate
 Ben> version would take a little work, but I haven't seen anything
 Ben> in the 0.73.1 docs that imply that's changed. So if it has,
 Ben> lemme know and I'll go get someone to update. :)
Getting log transformations in the presence of non-positive data now
works better than it used to -- most of the fixes in this area were in
0.72 so your version should be OK. For technical reasons, some plot
types work better than others (eg plot is more robust than pcolor) in
handling illegal data. But all that aside, there is no reason you
can't do loglog pcolor plots, provided you make the right calls and
take care to pass in legal data. The example script below illustrates
how, with comments. It's tested on matplotlib-cvs on linux using
GTKAgg, but I am pretty confident that it will run on 0.72.x on
windows with other backends as well. Let me know.
JDH
import matplotlib
from matplotlib import pylab
# WRONG: import Numeric as Numeric
# Importing Numeric or numarray manually with pylab is not
# recommended. pylab includes it's own Numeric/numarray switcher in
# matplotlib.numerix as controlled by the numerix rc setting. If you
# import your own, you can get into trouble with array
# incompatibility. Something like the following is recommended
import matplotlib.numerix as nx
def main(argv):
 # WRONG: pylab.loglog([1,100],[1,100])
 # You don't really want to plot the log of this line do you? What
 # you want to do is set the xscale and yscale to be 'log'; see below
 ax = pylab.subplot(111)
 x = y = nx.arange(1.,100.) 
 X,Y = matplotlib.mlab.meshgrid(x,y)
 # Now pass in X and Y explicitly to pcolor. The default X and Y if you
 # don't pass them in will be index arrays starting at 0, which can
 # lead to a log problem since they contain non-positive data
 pylab.pcolor( X, Y, X*Y, shading = "flat" )
 # make sure the axis limits are positive before setting the log
 # scale since the transformations also apply to the axis tick locations
 pylab.axis([1., 100., 1., 100.])
 # Now set the xaxis and yaxis to a log scale
 pylab.set(ax, xscale='log', yscale='log')
 #pylab.savefig("/home/zorba/stats/color.png")
main([])
pylab.show()

Showing 4 results of 4

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