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
|
|
From: Brickle M. <bri...@gm...> - 2012-11-04 06:43:09
|
In an Qt application I am extending, I display a list of thumbnails, selecting a thumbnail opens a plot window with the source of the thumbnail. I a newbie at all this but did manage to write a simple widget which embedded a matplotlib FigureCanvas. It appears that I also need to code the zoom to rectangle and save view functionality I like in the default plot window. I have no idea if this is easy or hard, so thought it may just be easier be able to reuse the default plotting window. When I show() a plot form within a Qt application I get the following message printed on the console: QCoreApplication::exec: The event loop is already running I think I understand the error, obviously the application I calling form control the even loop. I suppose I need to somehow supply a parent window to pylab plot or the show() function. Is there a way to create a plot and show so as not to use the main loop? Thanks. Brickle. -- |
|
From: Bob K. <rnk...@ya...> - 2012-11-04 04:55:10
|
Hello,
I have a package that has many functions that bring up plots to show data and interactive plots to interact with data. How can I have my figures show and both be on top and be in focus? The best way I have found to manage Matplotlib plots in my package is to use interactive mode plt.ion() and pause the program with raw_input() statements to show or interact with the plots. This has been working fine with one exception. I have not been able to figure out how have the plot figure come up and have the figure both be on top and in focus. I am using Window XP,Python 2.5.4, Matplotlib version 1.0.0 with backend Tkagg. Tk has a command focus_force(), I have not been able to find a similar command in Matplotlib.
This is a simple example demonstrating the plotting behavior. The second plot is rendered but is not in windows focus.
import matplotlib.pyplot as plt
plt.ion()
fig = plt.figure(figsize=(10,8))
ax = fig.add_axes([.15,.1,.8,.65])
ax.plot([1,2,3])
ax.set_title('Fisrt Plot')
raw_input('Enter to close and Continue: ')
plt.close(fig)
fig2 = plt.figure(figsize=(10,8))
ax = fig2.add_axes([.15,.1,.8,.65])
ax.plot([1,2,3])
ax.set_title('Second Plot')
raw_input('Enter to close and Continue: ')
plt.close(fig2)
Thank you,
Bob Kestner
|
|
From: Arek K. <ake...@ya...> - 2012-11-04 01:25:27
|
Hi all, I am aware when using overlapping axes twinx I can only pick the objects in the active axes. I would like to pick objects (lines) in both axes. Does anyone have the workaround to this problem Regards, Arek |
|
From: Benjamin R. <ben...@ou...> - 2012-11-02 15:45:21
|
On Fri, Nov 2, 2012 at 3:18 AM, Alexandr <o.p...@gm...> wrote: > Benjamin Root <ben.root@...> writes: > > > > > > > On Thu, Jun 9, 2011 at 10:13 AM, Benjamin Root <ben.root <at> ou.edu> > wrote: > > > > > > > > > > On Thu, Jun 9, 2011 at 6:25 AM, Richard Hofmeister <richard.hofmeister- > 3jV...@pu...> wrote: > > Hello mplot3d specialists,I would like to change the aspect ratio of the > 3d > axes similar to matlab's functionality with daspect() or the > 'dataaspectratio' > property of 3d-axes.In the end, the x-y-plane should be non-square due to > different lengths (not range) of the x and y axis (i know that i can use > the > aspect property of the axes to set the x-z/y-z aspect ratio).There is also > the > package "scitools", which provides all the matlab-3d functions including > daspect > via a VTK-backend; that would be my next try.For the simple 3d-plotting > without > fancy shading, i would like to stick to mplot3d: > > > > > > > > Is it possible to change the axis lengths/aspect ratios > independently?Richard > > > > > > > > > > Richard,Good question. I have never thought about such a feature for > mplot3d. Looking back at the code, it does not appear to be feasible to > do in > its current state, as the code seems to assume that the 3d grid is a > constructed > from a unit cube. However, I will see if I can add aspect multipliers to > the > point calculation and get arbitrary aspects. Maybe I can get that feature > added > into the upcoming 1.1.0 release.Ben Root > > > > > > > > > > Richard,I took a look at how this might be implemented. There would > have to > be some extra work to make the plots look right when experiencing changes > in > aspect. I first tried an implementation of just the plot box aspect ratio > (pbaspect) as a member variable of the axes object. It will probably turn > into > a property so that I can link it with a daspect value. Also, the values > should > be normalized to 1, unless you want to see some interesting > shrinkage/growth of > your plot area.Try my branch here: > https://github.com/WeatherGod/matplotlib/tree/mplot3d/pbaspectAfterbuilding > that branch, try the following script (shamelessly adapted from some > Matlab help > pages for pbaspect and daspect).import matplotlib.pyplot as pltfrom > mpl_toolkits.mplot3d import Axes3Dimport numpy as npfig = plt.figure()ax = > fig.gca(projection='3d')x, y = np.mgrid[-2:2:.2, -2:2:.2]z = x * > np.exp(-x**2 - > y**2) > > > > ax.plot_surface(x, y, z, rstride=1, cstride=1)ax.pbaspect = [1.0, 1.0, > 0.25]plt.show()While this will squash the z-axis nicely, it does not force > the > z-ticks to be pruned, so it gets a little ugly. However, the axis ticks > can be > changed manually. Also, with some of my other changes coming soon, it > should be > possible for the Axes3D object to automatically adjust the spacing of the > tick > labels so that it is not impacted by the changes in aspect ratio in the > perpendicular direction (i.e. - the x and y tick labels are closer to the > axis > due to the z-axis scaling).Keep an eye on that branch as I work to improve > this > feature, and feel free to contribute to it as well!Ben Root > > > > > > > ------------------------------------------------------------------------------ > > EditLive Enterprise is the world's most technically advanced content > > authoring tool. Experience the power of Track Changes, Inline Image > > Editing and ensure content is compliant with Accessibility Checking. > > http://p.sf.net/sfu/ephox-dev2dev > > > > _______________________________________________ > > Matplotlib-users mailing list > > Matplotlib-users@... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > Hello! > > I am looking for a tool like pbaspect. The only question is how to > implement it > into matplotlib? Do you have a step by step instruction? > > Thank you. > Regards, > Alexandr > > I guess there has been enough interest in this feature that I probably should devote some time to correctly implementing it. I'll see what I can do! Ben Root |
|
From: Vlastimil B. <vla...@gm...> - 2012-11-02 11:01:43
|
2012/11/1 Hans Bering <han...@ar...>: > Hello everybody, > > I'm building a small Tkinter GUI using matplotlib, in which I have to > change/update plots quite often depending on user input (with different > contents & sizes, in different places in the GUI, etc.; but always only > one figure at a time). > > As a first resort, I regenerated the figures with plt.figure(...) whenever > necessary; unfortunately, the program happily accumulated memory with > every new figure until the computer would no longer cooperate in a timely > fashion. The following minimal script should demonstrate the tendency: > ... > Now I am wondering if I am missing some detail, e.g., some other clean-up > procedure? Or should this work & could be a memory leak in matplotlib or > Tkinter? And/or is this approach (of generating a new figure every time) > not recommended in the first place? I tried reusing the figure, but some > aspects like changing the layout in the GUI and applying new size and dpi > then proved tricky in their own ways. > > Many thanks in advance, > Hans > Hi, I'd recommend to use an embedded plot and only clear and replace its content (rather than tu use pyplot and recreate the figure multiple times. I believe, changing of the figure should be possible too. see e.g. the sample for tkinter http://matplotlib.org/examples/user_interfaces/embedding_in_tk.html I only roughly adapted that source to use your function and the memory usage appears to be more effective (although there is some increase too - as displayed in Process Explorer). Would some variation of the following work for you? hth, vbr ######################################## #!/usr/bin/env python import matplotlib matplotlib.use('TkAgg') import math from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg from matplotlib.figure import Figure import Tkinter root = Tkinter.Tk() root.wm_title("Embedding in TK") fig = Figure(figsize=(5,4), dpi=100) ax = fig.add_subplot(111) canvas = FigureCanvasTkAgg(fig, master=root) canvas.show() canvas.get_tk_widget().pack(side=Tkinter.TOP, fill=Tkinter.BOTH, expand=1) toolbar = NavigationToolbar2TkAgg( canvas, root ) toolbar.update() canvas._tkcanvas.pack(side=Tkinter.TOP, fill=Tkinter.BOTH, expand=1) plotShift = 0 def replot(): global plotShift, a, f ax.clear() xVals = xrange(100) ax.plot(xVals, [math.sin(x + plotShift) for x in xVals]) fig.canvas.draw() plotShift += 10 button = Tkinter.Button(master=root, text='replot', command=replot) button.pack(side=Tkinter.BOTTOM) Tkinter.mainloop() |
|
From: Alexandr <o.p...@gm...> - 2012-11-02 07:25:06
|
Benjamin Root <ben.root@...> writes: > > > On Thu, Jun 9, 2011 at 10:13 AM, Benjamin Root <ben.root <at> ou.edu> wrote: > > > > > On Thu, Jun 9, 2011 at 6:25 AM, Richard Hofmeister <richard.hofmeister- 3jV...@pu...> wrote: > Hello mplot3d specialists,I would like to change the aspect ratio of the 3d axes similar to matlab's functionality with daspect() or the 'dataaspectratio' property of 3d-axes.In the end, the x-y-plane should be non-square due to different lengths (not range) of the x and y axis (i know that i can use the aspect property of the axes to set the x-z/y-z aspect ratio).There is also the package "scitools", which provides all the matlab-3d functions including daspect via a VTK-backend; that would be my next try.For the simple 3d-plotting without fancy shading, i would like to stick to mplot3d: > > > > Is it possible to change the axis lengths/aspect ratios independently?Richard > > > > > Richard,Good question. I have never thought about such a feature for mplot3d. Looking back at the code, it does not appear to be feasible to do in its current state, as the code seems to assume that the 3d grid is a constructed from a unit cube. However, I will see if I can add aspect multipliers to the point calculation and get arbitrary aspects. Maybe I can get that feature added into the upcoming 1.1.0 release.Ben Root > > > > > Richard,I took a look at how this might be implemented. There would have to be some extra work to make the plots look right when experiencing changes in aspect. I first tried an implementation of just the plot box aspect ratio (pbaspect) as a member variable of the axes object. It will probably turn into a property so that I can link it with a daspect value. Also, the values should be normalized to 1, unless you want to see some interesting shrinkage/growth of your plot area.Try my branch here: https://github.com/WeatherGod/matplotlib/tree/mplot3d/pbaspectAfter building that branch, try the following script (shamelessly adapted from some Matlab help pages for pbaspect and daspect).import matplotlib.pyplot as pltfrom mpl_toolkits.mplot3d import Axes3Dimport numpy as npfig = plt.figure()ax = fig.gca(projection='3d')x, y = np.mgrid[-2:2:.2, -2:2:.2]z = x * np.exp(-x**2 - y**2) > > ax.plot_surface(x, y, z, rstride=1, cstride=1)ax.pbaspect = [1.0, 1.0, 0.25]plt.show()While this will squash the z-axis nicely, it does not force the z-ticks to be pruned, so it gets a little ugly. However, the axis ticks can be changed manually. Also, with some of my other changes coming soon, it should be possible for the Axes3D object to automatically adjust the spacing of the tick labels so that it is not impacted by the changes in aspect ratio in the perpendicular direction (i.e. - the x and y tick labels are closer to the axis due to the z-axis scaling).Keep an eye on that branch as I work to improve this feature, and feel free to contribute to it as well!Ben Root > > > ------------------------------------------------------------------------------ > EditLive Enterprise is the world's most technically advanced content > authoring tool. Experience the power of Track Changes, Inline Image > Editing and ensure content is compliant with Accessibility Checking. > http://p.sf.net/sfu/ephox-dev2dev > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > Hello! I am looking for a tool like pbaspect. The only question is how to implement it into matplotlib? Do you have a step by step instruction? Thank you. Regards, Alexandr |
|
From: Hans B. <han...@ar...> - 2012-11-01 20:53:09
|
Hello everybody,
I'm building a small Tkinter GUI using matplotlib, in which I have to
change/update plots quite often depending on user input (with different
contents & sizes, in different places in the GUI, etc.; but always only
one figure at a time).
As a first resort, I regenerated the figures with plt.figure(...) whenever
necessary; unfortunately, the program happily accumulated memory with
every new figure until the computer would no longer cooperate in a timely
fashion. The following minimal script should demonstrate the tendency:
--- start of script ---
import math
from Tkinter import Tk, Button
import Tkconstants
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.figure import Figure
from matplotlib import pyplot as plt
def replot():
global globalCanvas, globalFigure, plotShift
# any variety of clean-up calls
if globalFigure is not None:
plt.close()
globalCanvas.get_tk_widget().destroy()
globalFigure.clf()
globalFigure = Figure(dpi=120, figsize=(4, 4))
globalCanvas = FigureCanvasTkAgg(globalFigure, master=root)
globalCanvas.get_tk_widget().grid(row=0, column=1)
xVals = xrange(100)
ax = globalFigure.add_subplot(111)
ax.plot(xVals, [math.sin(x + plotShift) for x in xVals])
plotShift += 10
# MAIN
globalCanvas = None
globalFigure = None
plotShift = 0 # just to see the plot change
root = Tk()
draw_button = Button(root, text="Replot", command=replot)
draw_button.grid(row=0, column=0, sticky=Tkconstants.N)
root.mainloop()
--- end of script ---
I have tried various clean-up calls, but the effect (of memory piling up)
is always the same. Using objgraph (http://mg.pov.lt/objgraph/), I took a
look at object counts by adding the following snippet at the end of the
"replot" call:
--- start of insertion ---
import gc
import objgraph
gc.collect()
print "---"
for c in ('FigureCanvasTkAgg', 'Figure'):
print "{}\t{}".format(len(objgraph.by_type(c)), c)
--- end of insertion ---
The output shows that the total number of both Figures and
FigureCanvasTkAggs increases constantly (i.e., one each after the first
call, then two each, etc.), whereas I had expected that old ones get
released, and that the count remains at one each.
Now I am wondering if I am missing some detail, e.g., some other clean-up
procedure? Or should this work & could be a memory leak in matplotlib or
Tkinter? And/or is this approach (of generating a new figure every time)
not recommended in the first place? I tried reusing the figure, but some
aspects like changing the layout in the GUI and applying new size and dpi
then proved tricky in their own ways.
Many thanks in advance,
Hans
|
|
From: Sandro T. <mo...@de...> - 2012-11-01 10:15:28
|
Hello Daryl, On Wed, Oct 31, 2012 at 9:48 PM, Daryl Herzmann <ak...@gm...> wrote: > Howdy, > > I built basemap 1.0.5 and matplotlib 1.2.0rc3 via the simple command 'python > setup.py bdist_rpm' without an error that I can tell. When I attempt to > install them, I get a conflict between the two. For example: > > file /usr/lib64/python2.6/site-packages/mpl_toolkits/__init__.pyc from > install of basemap-1.0.5-1.x86_64 conflicts with file from package > matplotlib-1.2.0rc3-1.x86_64 > file /usr/lib64/python2.6/site-packages/mpl_toolkits/__init__.pyo from > install of basemap-1.0.5-1.x86_64 conflicts with file from package > matplotlib-1.2.0rc3-1.x86_64 > > Working around this error is easy with some rpm flags, but was curious what > the proper solution for this situation is? In Debian we're dealing with this situation letting 'matplotlib' package owning the "mpl_toolkits" namespace (so only matplotlib will install the __init__.py file in that directory) and basemap will install stuff in "mpl_toolkits/basemap" directory and depending on matplotlib (it requires to NOT install mpl_toolkits/__init__.py file when install basemap, by either remote it when creating the package or similar solution). This way matplotlib package will create the namespace for all the other packages to install modules in it, and avoiding conflicts like the one you described. HTH, -- Sandro Tosi (aka morph, morpheus, matrixhasu) My website: http://matrixhasu.altervista.org/ Me at Debian: http://wiki.debian.org/SandroTosi |
|
From: Daryl H. <ak...@gm...> - 2012-10-31 20:49:02
|
Howdy, I built basemap 1.0.5 and matplotlib 1.2.0rc3 via the simple command 'python setup.py bdist_rpm' without an error that I can tell. When I attempt to install them, I get a conflict between the two. For example: file /usr/lib64/python2.6/site-packages/mpl_toolkits/__init__.pyc from install of basemap-1.0.5-1.x86_64 conflicts with file from package matplotlib-1.2.0rc3-1.x86_64 file /usr/lib64/python2.6/site-packages/mpl_toolkits/__init__.pyo from install of basemap-1.0.5-1.x86_64 conflicts with file from package matplotlib-1.2.0rc3-1.x86_64 Working around this error is easy with some rpm flags, but was curious what the proper solution for this situation is? thanks! daryl PS. When i built matplotlib 1.2.0rc3 on RHEL6 64bit, I need to hard set provide_dateutil to make the resulting build work when deployed. I think the problem is that the build is seeing it already installed from the previous install of matplotlib , which gets blown out with the rpm update? I am probably rehashing well known items, sorry. |
|
From: Michael D. <md...@st...> - 2012-10-31 01:22:31
|
The third and (crossing fingers) final release candidate for matplotlib 1.2.0 has been posted. Source tarballs and binaries for Windows and OS-X are available from the matplotlib github download page: https://github.com/matplotlib/matplotlib/downloads Please try it out and report any bugs so we can make this the best matplotlib release yet! Mike |
|
From: Damon M. <dam...@gm...> - 2012-10-30 23:13:22
|
On Tuesday, October 30, 2012, Russell E. Owen wrote: > In article <508...@st... <javascript:;>>, > Michael Droettboom <md...@st... <javascript:;>> > wrote: > > > Agreed! Thanks to everyone for their hard work. I think this has > > shaped up to be a great release. > > > > I'm fortunate to have power and connectivity today, so I was able to get > > a release tested, tagged and uploaded. > > > > To our binary builders: as able, it would be great to put the binaries > > up (or send them to me to do so), and then I'll make an announcement on > > matplotlib-users. I really intend (barring any really serious issues) > > this to be the last rc before the 1.2.0 final. > > > > Thanks again, > > Mike > > The Mac binaries are now up. This time it built perfectly on MacOS X > 10.4; thanks to the folks that worked so hard fixing those build > problems. > > The 32-bit version is not well tested because I have neither inkscape > nor ghostscript installed on that ancient system, but it passes the > tests that it can run under those circumstances. > > The 64-bit version passes all tests except 2 knownfail and 3 skipped. > > -- Russell > > P.S. I had to build the 64-bit version twice. The first time I tried to > build it using the same directory of code that I used to build 32-bit > version. I first deleted the "build" and "dist" subdirectories and ran > "python setup.py clean", then built as usual. There were no errors or > warnings during the build, but the unit tests would not run on the > results -- complaining of missing modules. > > So I built again using a freshly unpacked code directory and that worked > just fine. > > I'm pretty sure I've seen this problem before, but keep forgetting to > ask about it. > > Is this a bug somewhere (e.g. in matplotlib's setup.py or somewhere in > python) or is there some better way to clear out a python code directory? > Yes! I'm sending you a virtual high five! Thanks for thy Russell. -- Damon McDougall http://www.damon-is-a-geek.com B2.39 Mathematics Institute University of Warwick Coventry West Midlands CV4 7AL United Kingdom |
|
From: Eric F. <ef...@ha...> - 2012-10-30 21:39:37
|
On 2012/10/29 2:00 PM, Mike Kaufman wrote: > On 10/29/12 1:08 PM, Jody Klymak wrote: >> >> On Oct 28, 2012, at 17:47 PM, Eric Firing <ef...@ha...> wrote: >>> >>> cb = colorbar() >>> cb.solids.set_rasterized(True) >> >> >> Great! Though I think it'd have taken me a while to figure that one out! > > I gotta agree. Is this (and the solids object) documented anywhere? No, and it probably won't be any time soon. Rasterization here is a last resort work-around for buggy pdf renderers. The solids object is mentioned in the colorbar docstring as something one can modify for such workarounds (an alternative is given), but perhaps without saying what kind of a thing it is. Eric > > M > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_sfd2d_oct > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Michael D. <md...@st...> - 2012-10-30 17:52:48
|
On 10/30/2012 12:25 PM, Brandon Heller wrote: > Hi Phil, > > Next time I'll be more explicit. I added the question to SA after I > tried to get a public link to my message and saw that archives past > July of this year seem to be missing. It wasn't clear that this list > was even still alive: > http://sourceforge.net/mailarchive/forum.php?forum_name=matplotlib-users > > Any idea why the archives seem to have stopped? Thanks for pointing that out. I'm not sure what's wrong, but I'll look into it. Mike > > Thanks, > Brandon > > On Tue, Oct 30, 2012 at 2:23 AM, Phil Elson <pel...@gm... > <mailto:pel...@gm...>> wrote: > > Hi Brandon, > > I notice that this is cross-posted on StackOverflow > (http://stackoverflow.com/questions/13132194/type-1-fonts-with-log-graphs). > Personally, I have no problem with cross posting, but to save two > people having to answer the same question, I would make sure it > was explicit that this had also been posted elsewhere. > > Thanks, > > Phil > > > On 30 October 2012 03:13, Brandon Heller <bra...@st... > <mailto:bra...@st...>> wrote: > > Hi, > > I'm trying to use Matplotlib graphs as part of a camera-ready > submission, and the publishing house requires the use of Type > 1 fonts > only. > > I'm finding that the PDF backend happily outputs Type-1 fonts for > simple graphs with linear Y axes, but outputs Type-3 fonts for > logarithmic Y axes. > > Using a logarithmic yscale incurs the use of mathtext, which > seems to > use Type 3 fonts, presumably because of the default use of > exponential > notation. I can use an ugly hack to get around this - using > pyplot.yticks() to force the axis ticks to not use exponents - but > this would require moving the plot region to accommodate large > labels > (like 10 ^ 6) or writing the axes as 10, 100, 1K, etc. so they > fit. > > There's a minimum working example below, which I've tested > with the > matplotlib master branch as of today, as well as 1.1.1, which > produces > the same behavior, so I don't know that this is a bug, > probably just > unexpected behavior. > > > #!/usr/bin/env python > # Simple program to test for type 1 fonts. > # Generate a line graph w/linear and log Y axes. > > from matplotlib import rc, rcParams > > #rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']}) > > # These lines are needed to get type-1 results: > # > http://nerdjusttyped.blogspot.com/2010/07/type-1-fonts-and-matplotlib-figures.html > rcParams['ps.useafm'] = True > rcParams['pdf.use14corefonts'] = True > rcParams['text.usetex'] = False > > import matplotlib.pyplot as plt > > YSCALES = ['linear', 'log'] > > def plot(filename, yscale): > plt.figure(1) > xvals = range(1, 2) > yvals = xvals > plt.plot(xvals, yvals) > plt.yscale(yscale) > #YTICKS = [1, 10] > #plt.yticks(YTICKS, YTICKS) # locs, labels > ax = plt.gca() > #print ax.get_xticklabels()[0].get_text() > print ",".join([a.get_label() for a in ax.get_yticklabels()]) > plt.savefig(filename + '.pdf') > > > if __name__ == '__main__': > for yscale in YSCALES: > plot('linegraph-' + yscale, yscale) > > > > Does anyone know a clean way to get Type 1 fonts with log axes? > > Thanks, > Brandon > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_sfd2d_oct > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > <mailto:Mat...@li...> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_sfd2d_oct > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Brandon H. <bra...@st...> - 2012-10-30 17:06:18
|
On Tue, Oct 30, 2012 at 5:51 AM, Michael Droettboom <md...@st...> wrote:
> There are a couple of alternative formatters for log scaling that don't
> require mathtext.
>
> You can do:
>
> from matplotlib.tickers import LogFormatter, LogFormatterExponent
> ...
> ax.xaxis.set_major_formatter(LogFormatter())
> # or LogFormatterExponent(), which is just the exponent
>
>
To clarify the font issue. The PDF backend has no support for outputting
> Type 1 fonts. There is an rcParam "pdf.fonttype" that allows you to choose
> between Type 3 and Type 42 fonts, however. Type 3 stores each character as
> a path and then uses those to put strings together. It supports font
> subsetting, so an entire large font is not embedded in the file. Type 42
> (essentially) just embeds a TrueType font in the file, and we don't support
> subsetting there.
>
> There is also the "pdf.use14corefonts" that will use the 14 built-in PDF
> fonts whenever possible (and therefore not embed any fonts). However,
> mathtext requires a special font for the math symbols, and thus it starts
> to embed fonts.
>
> You may try setting "mathtext.default" to "regular", which will use the
> font used as the default for the rest of the text first. This should have
> the effect of not embedding any extra fonts in the file as long as you
> don't use any special symbols in the math.
>
Hi Mike,
Thanks for the suggestions - I tried both. The first (use a LogFormatter)
yields only Type 1 but doesn't look look as good as exponential notation
(my style preference). The second (mathtext.default = regular) defaulted
to CMR and kept the exponents as Type 1, but not the helvetica used by the
rest of the graph. It used CMR even when I had set another font as the
default:
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
... so maybe I'm not setting the default properly. Any ideas there?
A suggestion from my colleague Vimal Kumar was to post-process the output
to replace Type3 w/Type 1:
sed -i.bak \
-e "s/Type3/Type1/g" \
-e "s/BitstreamVeraSans-Roman/Helvetica/g" \
-e "s/DejaVuSans/Helvetica/g" \
$file
This has the advantage that no mattext or tex is required, though I have to
assume the letter spacing is meant for the original font. In practice, the
only replaced fonts are on the Y axis, so even if the spacing between
letters seems a bit bigger, I don't think this is a huge issue. Of course,
it would still be nice to solve this problem in MPL itself, though.
Thanks,
Brandon
>
> Mike
>
>
> On 10/30/2012 05:23 AM, Phil Elson wrote:
>
> Hi Brandon,
>
> I notice that this is cross-posted on StackOverflow (
> http://stackoverflow.com/questions/13132194/type-1-fonts-with-log-graphs).
> Personally, I have no problem with cross posting, but to save two people
> having to answer the same question, I would make sure it was explicit that
> this had also been posted elsewhere.
>
> Thanks,
>
> Phil
>
>
> On 30 October 2012 03:13, Brandon Heller <bra...@st...> wrote:
>
>> Hi,
>>
>> I'm trying to use Matplotlib graphs as part of a camera-ready
>> submission, and the publishing house requires the use of Type 1 fonts
>> only.
>>
>> I'm finding that the PDF backend happily outputs Type-1 fonts for
>> simple graphs with linear Y axes, but outputs Type-3 fonts for
>> logarithmic Y axes.
>>
>> Using a logarithmic yscale incurs the use of mathtext, which seems to
>> use Type 3 fonts, presumably because of the default use of exponential
>> notation. I can use an ugly hack to get around this - using
>> pyplot.yticks() to force the axis ticks to not use exponents - but
>> this would require moving the plot region to accommodate large labels
>> (like 10 ^ 6) or writing the axes as 10, 100, 1K, etc. so they fit.
>>
>> There's a minimum working example below, which I've tested with the
>> matplotlib master branch as of today, as well as 1.1.1, which produces
>> the same behavior, so I don't know that this is a bug, probably just
>> unexpected behavior.
>>
>>
>> #!/usr/bin/env python
>> # Simple program to test for type 1 fonts.
>> # Generate a line graph w/linear and log Y axes.
>>
>> from matplotlib import rc, rcParams
>>
>> #rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
>>
>> # These lines are needed to get type-1 results:
>> #
>> http://nerdjusttyped.blogspot.com/2010/07/type-1-fonts-and-matplotlib-figures.html
>> rcParams['ps.useafm'] = True
>> rcParams['pdf.use14corefonts'] = True
>> rcParams['text.usetex'] = False
>>
>> import matplotlib.pyplot as plt
>>
>> YSCALES = ['linear', 'log']
>>
>> def plot(filename, yscale):
>> plt.figure(1)
>> xvals = range(1, 2)
>> yvals = xvals
>> plt.plot(xvals, yvals)
>> plt.yscale(yscale)
>> #YTICKS = [1, 10]
>> #plt.yticks(YTICKS, YTICKS) # locs, labels
>> ax = plt.gca()
>> #print ax.get_xticklabels()[0].get_text()
>> print ",".join([a.get_label() for a in ax.get_yticklabels()])
>> plt.savefig(filename + '.pdf')
>>
>>
>> if __name__ == '__main__':
>> for yscale in YSCALES:
>> plot('linegraph-' + yscale, yscale)
>>
>>
>>
>> Does anyone know a clean way to get Type 1 fonts with log axes?
>>
>> Thanks,
>> Brandon
>>
>>
>> ------------------------------------------------------------------------------
>> Everyone hates slow websites. So do we.
>> Make your web apps faster with AppDynamics
>> Download AppDynamics Lite for free today:
>> http://p.sf.net/sfu/appdyn_sfd2d_oct
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:http://p.sf.net/sfu/appdyn_sfd2d_oct
>
>
>
> _______________________________________________
> Matplotlib-users mailing lis...@li...://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
|
|
From: Brandon H. <bra...@st...> - 2012-10-30 16:25:56
|
Hi Phil, Next time I'll be more explicit. I added the question to SA after I tried to get a public link to my message and saw that archives past July of this year seem to be missing. It wasn't clear that this list was even still alive: http://sourceforge.net/mailarchive/forum.php?forum_name=matplotlib-users Any idea why the archives seem to have stopped? Thanks, Brandon On Tue, Oct 30, 2012 at 2:23 AM, Phil Elson <pel...@gm...> wrote: > Hi Brandon, > > I notice that this is cross-posted on StackOverflow ( > http://stackoverflow.com/questions/13132194/type-1-fonts-with-log-graphs). > Personally, I have no problem with cross posting, but to save two people > having to answer the same question, I would make sure it was explicit that > this had also been posted elsewhere. > > Thanks, > > Phil > > > On 30 October 2012 03:13, Brandon Heller <bra...@st...> wrote: > >> Hi, >> >> I'm trying to use Matplotlib graphs as part of a camera-ready >> submission, and the publishing house requires the use of Type 1 fonts >> only. >> >> I'm finding that the PDF backend happily outputs Type-1 fonts for >> simple graphs with linear Y axes, but outputs Type-3 fonts for >> logarithmic Y axes. >> >> Using a logarithmic yscale incurs the use of mathtext, which seems to >> use Type 3 fonts, presumably because of the default use of exponential >> notation. I can use an ugly hack to get around this - using >> pyplot.yticks() to force the axis ticks to not use exponents - but >> this would require moving the plot region to accommodate large labels >> (like 10 ^ 6) or writing the axes as 10, 100, 1K, etc. so they fit. >> >> There's a minimum working example below, which I've tested with the >> matplotlib master branch as of today, as well as 1.1.1, which produces >> the same behavior, so I don't know that this is a bug, probably just >> unexpected behavior. >> >> >> #!/usr/bin/env python >> # Simple program to test for type 1 fonts. >> # Generate a line graph w/linear and log Y axes. >> >> from matplotlib import rc, rcParams >> >> #rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']}) >> >> # These lines are needed to get type-1 results: >> # >> http://nerdjusttyped.blogspot.com/2010/07/type-1-fonts-and-matplotlib-figures.html >> rcParams['ps.useafm'] = True >> rcParams['pdf.use14corefonts'] = True >> rcParams['text.usetex'] = False >> >> import matplotlib.pyplot as plt >> >> YSCALES = ['linear', 'log'] >> >> def plot(filename, yscale): >> plt.figure(1) >> xvals = range(1, 2) >> yvals = xvals >> plt.plot(xvals, yvals) >> plt.yscale(yscale) >> #YTICKS = [1, 10] >> #plt.yticks(YTICKS, YTICKS) # locs, labels >> ax = plt.gca() >> #print ax.get_xticklabels()[0].get_text() >> print ",".join([a.get_label() for a in ax.get_yticklabels()]) >> plt.savefig(filename + '.pdf') >> >> >> if __name__ == '__main__': >> for yscale in YSCALES: >> plot('linegraph-' + yscale, yscale) >> >> >> >> Does anyone know a clean way to get Type 1 fonts with log axes? >> >> Thanks, >> Brandon >> >> >> ------------------------------------------------------------------------------ >> Everyone hates slow websites. So do we. >> Make your web apps faster with AppDynamics >> Download AppDynamics Lite for free today: >> http://p.sf.net/sfu/appdyn_sfd2d_oct >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > |
|
From: Brickle M. <bri...@gm...> - 2012-10-30 14:40:41
|
For some fun I am trying to plot a surface representation of 2D image where the height level corresponds to the intensity at each pixel. I have been able to change the cmap but would like to assign the original pixel colour values (Grayscale or RGB) to corresponding in the surface plot. Is this possible? To be honest, I not even sure if I have constructed the plot correctly. Any help appreciated. Regards, Brickle. ---- ----- Surface Representation of 2D Image -------- from mpl_toolkits.mplot3d import axes3d import matplotlib.pyplot as plt from skimage import data, color import numpy as np from scipy import ndimage from matplotlib import cm image = color.rgb2gray(data.lena()) image = ndimage.gaussian_filter(image, 8) x = range(image.shape[0]) y = range(image.shape[1]) X,Y = np.meshgrid(x,y) # Is this the correct way? Z = image # Not sure if this is correct? fig = plt.figure() ax = fig.add_subplot(1,1,1, projection='3d') ax.plot_surface(X,Y,Z, cmap=cm.gray) plt.show() ---------------------------------------------- |
|
From: Michael D. <md...@st...> - 2012-10-30 12:51:41
|
There are a couple of alternative formatters for log scaling that don't require mathtext. You can do: from matplotlib.tickers import LogFormatter, LogFormatterExponent ... ax.xaxis.set_major_formatter(LogFormatter()) # or LogFormatterExponent(), which is just the exponent To clarify the font issue. The PDF backend has no support for outputting Type 1 fonts. There is an rcParam "pdf.fonttype" that allows you to choose between Type 3 and Type 42 fonts, however. Type 3 stores each character as a path and then uses those to put strings together. It supports font subsetting, so an entire large font is not embedded in the file. Type 42 (essentially) just embeds a TrueType font in the file, and we don't support subsetting there. There is also the "pdf.use14corefonts" that will use the 14 built-in PDF fonts whenever possible (and therefore not embed any fonts). However, mathtext requires a special font for the math symbols, and thus it starts to embed fonts. You may try setting "mathtext.default" to "regular", which will use the font used as the default for the rest of the text first. This should have the effect of not embedding any extra fonts in the file as long as you don't use any special symbols in the math. Mike On 10/30/2012 05:23 AM, Phil Elson wrote: > Hi Brandon, > > I notice that this is cross-posted on StackOverflow > (http://stackoverflow.com/questions/13132194/type-1-fonts-with-log-graphs). > Personally, I have no problem with cross posting, but to save two > people having to answer the same question, I would make sure it was > explicit that this had also been posted elsewhere. > > Thanks, > > Phil > > > On 30 October 2012 03:13, Brandon Heller <bra...@st... > <mailto:bra...@st...>> wrote: > > Hi, > > I'm trying to use Matplotlib graphs as part of a camera-ready > submission, and the publishing house requires the use of Type 1 fonts > only. > > I'm finding that the PDF backend happily outputs Type-1 fonts for > simple graphs with linear Y axes, but outputs Type-3 fonts for > logarithmic Y axes. > > Using a logarithmic yscale incurs the use of mathtext, which seems to > use Type 3 fonts, presumably because of the default use of exponential > notation. I can use an ugly hack to get around this - using > pyplot.yticks() to force the axis ticks to not use exponents - but > this would require moving the plot region to accommodate large labels > (like 10 ^ 6) or writing the axes as 10, 100, 1K, etc. so they fit. > > There's a minimum working example below, which I've tested with the > matplotlib master branch as of today, as well as 1.1.1, which produces > the same behavior, so I don't know that this is a bug, probably just > unexpected behavior. > > > #!/usr/bin/env python > # Simple program to test for type 1 fonts. > # Generate a line graph w/linear and log Y axes. > > from matplotlib import rc, rcParams > > #rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']}) > > # These lines are needed to get type-1 results: > # > http://nerdjusttyped.blogspot.com/2010/07/type-1-fonts-and-matplotlib-figures.html > rcParams['ps.useafm'] = True > rcParams['pdf.use14corefonts'] = True > rcParams['text.usetex'] = False > > import matplotlib.pyplot as plt > > YSCALES = ['linear', 'log'] > > def plot(filename, yscale): > plt.figure(1) > xvals = range(1, 2) > yvals = xvals > plt.plot(xvals, yvals) > plt.yscale(yscale) > #YTICKS = [1, 10] > #plt.yticks(YTICKS, YTICKS) # locs, labels > ax = plt.gca() > #print ax.get_xticklabels()[0].get_text() > print ",".join([a.get_label() for a in ax.get_yticklabels()]) > plt.savefig(filename + '.pdf') > > > if __name__ == '__main__': > for yscale in YSCALES: > plot('linegraph-' + yscale, yscale) > > > > Does anyone know a clean way to get Type 1 fonts with log axes? > > Thanks, > Brandon > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_sfd2d_oct > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > <mailto:Mat...@li...> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_sfd2d_oct > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Phil E. <pel...@gm...> - 2012-10-30 09:23:12
|
Hi Brandon, I notice that this is cross-posted on StackOverflow ( http://stackoverflow.com/questions/13132194/type-1-fonts-with-log-graphs). Personally, I have no problem with cross posting, but to save two people having to answer the same question, I would make sure it was explicit that this had also been posted elsewhere. Thanks, Phil On 30 October 2012 03:13, Brandon Heller <bra...@st...> wrote: > Hi, > > I'm trying to use Matplotlib graphs as part of a camera-ready > submission, and the publishing house requires the use of Type 1 fonts > only. > > I'm finding that the PDF backend happily outputs Type-1 fonts for > simple graphs with linear Y axes, but outputs Type-3 fonts for > logarithmic Y axes. > > Using a logarithmic yscale incurs the use of mathtext, which seems to > use Type 3 fonts, presumably because of the default use of exponential > notation. I can use an ugly hack to get around this - using > pyplot.yticks() to force the axis ticks to not use exponents - but > this would require moving the plot region to accommodate large labels > (like 10 ^ 6) or writing the axes as 10, 100, 1K, etc. so they fit. > > There's a minimum working example below, which I've tested with the > matplotlib master branch as of today, as well as 1.1.1, which produces > the same behavior, so I don't know that this is a bug, probably just > unexpected behavior. > > > #!/usr/bin/env python > # Simple program to test for type 1 fonts. > # Generate a line graph w/linear and log Y axes. > > from matplotlib import rc, rcParams > > #rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']}) > > # These lines are needed to get type-1 results: > # > http://nerdjusttyped.blogspot.com/2010/07/type-1-fonts-and-matplotlib-figures.html > rcParams['ps.useafm'] = True > rcParams['pdf.use14corefonts'] = True > rcParams['text.usetex'] = False > > import matplotlib.pyplot as plt > > YSCALES = ['linear', 'log'] > > def plot(filename, yscale): > plt.figure(1) > xvals = range(1, 2) > yvals = xvals > plt.plot(xvals, yvals) > plt.yscale(yscale) > #YTICKS = [1, 10] > #plt.yticks(YTICKS, YTICKS) # locs, labels > ax = plt.gca() > #print ax.get_xticklabels()[0].get_text() > print ",".join([a.get_label() for a in ax.get_yticklabels()]) > plt.savefig(filename + '.pdf') > > > if __name__ == '__main__': > for yscale in YSCALES: > plot('linegraph-' + yscale, yscale) > > > > Does anyone know a clean way to get Type 1 fonts with log axes? > > Thanks, > Brandon > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_sfd2d_oct > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Brandon H. <bra...@st...> - 2012-10-30 03:13:25
|
Hi,
I'm trying to use Matplotlib graphs as part of a camera-ready
submission, and the publishing house requires the use of Type 1 fonts
only.
I'm finding that the PDF backend happily outputs Type-1 fonts for
simple graphs with linear Y axes, but outputs Type-3 fonts for
logarithmic Y axes.
Using a logarithmic yscale incurs the use of mathtext, which seems to
use Type 3 fonts, presumably because of the default use of exponential
notation. I can use an ugly hack to get around this - using
pyplot.yticks() to force the axis ticks to not use exponents - but
this would require moving the plot region to accommodate large labels
(like 10 ^ 6) or writing the axes as 10, 100, 1K, etc. so they fit.
There's a minimum working example below, which I've tested with the
matplotlib master branch as of today, as well as 1.1.1, which produces
the same behavior, so I don't know that this is a bug, probably just
unexpected behavior.
#!/usr/bin/env python
# Simple program to test for type 1 fonts.
# Generate a line graph w/linear and log Y axes.
from matplotlib import rc, rcParams
#rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
# These lines are needed to get type-1 results:
# http://nerdjusttyped.blogspot.com/2010/07/type-1-fonts-and-matplotlib-figures.html
rcParams['ps.useafm'] = True
rcParams['pdf.use14corefonts'] = True
rcParams['text.usetex'] = False
import matplotlib.pyplot as plt
YSCALES = ['linear', 'log']
def plot(filename, yscale):
plt.figure(1)
xvals = range(1, 2)
yvals = xvals
plt.plot(xvals, yvals)
plt.yscale(yscale)
#YTICKS = [1, 10]
#plt.yticks(YTICKS, YTICKS) # locs, labels
ax = plt.gca()
#print ax.get_xticklabels()[0].get_text()
print ",".join([a.get_label() for a in ax.get_yticklabels()])
plt.savefig(filename + '.pdf')
if __name__ == '__main__':
for yscale in YSCALES:
plot('linegraph-' + yscale, yscale)
Does anyone know a clean way to get Type 1 fonts with log axes?
Thanks,
Brandon
|
|
From: Mike K. <mc...@gm...> - 2012-10-30 00:00:18
|
On 10/29/12 1:08 PM, Jody Klymak wrote: > > On Oct 28, 2012, at 17:47 PM, Eric Firing <ef...@ha...> wrote: >> >> cb = colorbar() >> cb.solids.set_rasterized(True) > > > Great! Though I think it'd have taken me a while to figure that one out! I gotta agree. Is this (and the solids object) documented anywhere? M |
|
From: Jody K. <jk...@uv...> - 2012-10-29 17:08:49
|
On Oct 28, 2012, at 17:47 PM, Eric Firing <ef...@ha...> wrote: > > cb = colorbar() > cb.solids.set_rasterized(True) Great! Though I think it'd have taken me a while to figure that one out! Thanks, Jody -- Jody Klymak http://web.uvic.ca/~jklymak/ |
|
From: Daryl H. <ak...@gm...> - 2012-10-29 14:50:21
|
Hi, I've been attempting to get basemap to clip a contourf display. I have not had any luck! Attached is a self contained example. Could somebody kindly point out what I am doing wrong!?! If I remove the zorder settings, I get no data plotted! The goal is to clip my contourf plots by political boundaries. I am using a simple rectangle at the moment for illustration. thanks, daryl |
|
From: Eric F. <ef...@ha...> - 2012-10-29 01:19:25
|
On 2012/10/26 6:00 PM, Jody Klymak wrote:
>
> Hi all,
>
> So I figured out the magic of "rasterized=True", which is *really*
> helpful!
>
> However, the colorbar doesn't seem to accept rasterized=True, so
> there are little lines every facet (zoom on the attached pdf). Is
> there another way to get the colorbar colors rasterized?
Try:
cb = colorbar()
cb.solids.set_rasterized(True)
Incidentally, the lines in the pdf are an artifact of most pdf viewers,
not a bug in the pdf file. It is possible that there is some way to
construct the pdf files such that this does not happen, without
introducing other artifacts, but we have never found one.
Eric
>
> Thanks Jody
> x = linspace(0,1,1000)
> X = outer(x,x)
> pcolormesh(X,cmap=get_cmap('RdBu_r',lut=32),rasterized=True)
> colorbar()
> savefig('Test.pdf',dpi=50)
>
>
>
>
> --
> Jody Klymak
> http://web.uvic.ca/~jklymak/
>
>
>
>
>
> ------------------------------------------------------------------------------
> WINDOWS 8 is here.
> Millions of people. Your app in 30 days.
> Visit The Windows 8 Center at Sourceforge for all your go to resources.
> http://windows8center.sourceforge.net/
> join-generation-app-and-make-money-coding-fast/
>
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: Benjamin R. <ben...@ou...> - 2012-10-28 00:05:29
|
On Saturday, October 27, 2012, Andreas Hilboll wrote: > Hi, maybe matplotlib is capable of doing this: > > I have two gridded datasets, A and B, for say Europe. Now I want to plot > a 3d surface with the z-values given by dataset A. The surface should be > colored using a given color palette and the values from dataset B. > > Any ideas on how to do this are greatly appreciated =) > > Cheers, Andreas. > > Sorry, I have been bogged down with work with the impending "frankenstorm", and I would expect Jeff to be as well. Hybrid 3d transforms has been a goal of mine, but there are various limitations that I have yet to have time to address. So, there isn't any nice ways to do what you want. Now for the dirty ways. Theoretically, you could still create an Axes3d object, and have the Basemap object calculate all of the coordinate transforms, and plot that data at the appropriate z coordinates. There are also various methods in axes3d to transform normal artists into 3d artists, so you could capture the output of drawcounties(), convert it into a 3d object. If you get this working, please let us know and share examples! We would love to see them! Ben Root |
|
From: Ethan G. <eth...@gm...> - 2012-10-28 00:00:39
|
Hi Andreas, Someone else, please correct me if I'm wrong, but I think the only way to do this is to provide your own "facecolors" map. Pick your preferred color map and apply it to dataset B, then now use mplot3d plot_surface(X,Y,Z_A,facecolors=B_colors). Assuming you are running inside pylab or have done similar imports, the following example should work ------------------------------------------- import mpl_toolkits.mplot3d.axes3d x=arange(10) y=arange(10) x,y=meshgrid(x,y) za=sin(np.deg2rad(x))+20*cos(np.deg2rad(y)) zb=x*25 colors=cm.jet(zb) ax = gca(projection='3d') surf = ax.plot_surface(x,y,za,rstride=1,cstride=1,facecolors=colors) draw() #I'm not sure why the draw command is necessary… anyone? ------------------------------------------- Note, plot_surface will apply shading by default, you can turn it off and just use your supplied colors using the shade=False keyword arg ethan On Oct 27, 2012, at 2:09 AM, Andreas Hilboll wrote: > Hi, maybe matplotlib is capable of doing this: > > I have two gridded datasets, A and B, for say Europe. Now I want to plot > a 3d surface with the z-values given by dataset A. The surface should be > colored using a given color palette and the values from dataset B. > > Any ideas on how to do this are greatly appreciated =) > > Cheers, Andreas. > > ------------------------------------------------------------------------------ > WINDOWS 8 is here. > Millions of people. Your app in 30 days. > Visit The Windows 8 Center at Sourceforge for all your go to resources. > http://windows8center.sourceforge.net/ > join-generation-app-and-make-money-coding-fast/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |