Re: [Matplotlib-users] Make clear figure used in the powerpoint slides?

2014-04-21 Thread Juergen Hasch

No Powerpoint version I know supports SVG (or any vector graphics format useful 
in this case) and Matplotlib does not
export WMF graphics anymore. So the easiest way is to use PNGs, if you can live 
with raster graphics.

Alternatively, if you need vector graphics, you can export the Matplotlib plot 
as SVG and convert it to WMF or EMF using
Inkscape. This can be done in the command line like this:

c:\Program Files\Inkscape-0.48\inkscape.exe --without-gui 
--export-emf=output.emf input.svg


  Juergen


Am 21.04.2014 13:06, schrieb Neal Becker:
 Make sure to save into a vector graphic format so it can be resized.  Try pdf 
 or 
 svg (don't know if M$ supports svg though)
 
 Paul Hobson wrote:
 
 Sorry hit send by accident?

 What parameters are you passing to `savefig`?

 For a presentation, I would save as a .png file, a higher resolution and a
 transparent background. e.g.:

 fig.savefig('myfig.png', dpi=600, bbox_inches='ticht', transparent=True)


 On Sun, Apr 20, 2014 at 10:24 PM, Paul Hobson
 pmhob...@gmail.com wrote:

 What parameters are you passing to `savefig`?


 On Sat, Apr 19, 2014 at 1:13 PM, Chao YUE
 chaoyue...@gmail.com wrote:

 Dear all,

 Did anyone try to make plots using matplotlib, and then put the figure in
 the powerpoint for presentation? Currently I am using the ipython notebook
 --pylab mode to make the plots, and then save them to *jpg format. But when
 I put it into the powerpoint, it does not look nice as I see on the screen
 (a little bit blurred). You can really not notice it if you don't examine
 carefully. But I really want to make high quality slides. So does anyone
 have the same problem? could it be related with the figure format or
 backend (GTKAgg) currently I am uisng? thanks a lot in advance.

 Cheers,

 Chao

 --
 please visit:
 http://www.globalcarbonatlas.org/


 ***
 Chao YUE
 Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
 UMR 1572 CEA-CNRS-UVSQ
 Batiment 712 - Pe 119
 91191 GIF Sur YVETTE Cedex
 Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16


 



 --
 Learn Graph Databases - Download FREE O'Reilly Book
 Graph Databases is the definitive new guide to graph databases and their
 applications. Written by three acclaimed leaders in the field,
 this first edition is now available. Download your free book today!
 http://p.sf.net/sfu/NeoTech
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



 
 
 
 --
 Start Your Social Network Today - Download eXo Platform
 Build your Enterprise Intranet with eXo Platform Software
 Java Based Open Source Intranet - Social, Extensible, Cloud Ready
 Get Started Now And Turn Your Intranet Into A Collaboration Platform
 http://p.sf.net/sfu/ExoPlatform
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 


--
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Make clear figure used in the powerpoint slides?

2014-04-21 Thread Juergen Hasch

Mac is kind of my blind spot, thanks for pointing out that EPS is a viable 
format there.

Windows does not handle the PS part of EPS for screen display. You will only 
see a preview image, and only if it was
embedded into the EPS. Printing is be fine though, if you have a PS printer.

  Juergen

Am 21.04.2014 15:38, schrieb Benjamin Root:
 While SVG isn't supported, EPS is... sort of.  Be very careful going between 
 windows and mac versions of Powerpoint.
 While they both support EPS, they seem to do it differently and I have had to 
 make emergency fixes to presentations
 while at conferences because they were using Windows and I only had access to 
 Linux and Macs at home.
 
 Cheers!
 Ben Root
 
 
 On Mon, Apr 21, 2014 at 7:34 AM, Juergen Hasch pyt...@elbonia.de 
 mailto:pyt...@elbonia.de wrote:
 
 
 No Powerpoint version I know supports SVG (or any vector graphics format 
 useful in this case) and Matplotlib does not
 export WMF graphics anymore. So the easiest way is to use PNGs, if you 
 can live with raster graphics.
 
 Alternatively, if you need vector graphics, you can export the Matplotlib 
 plot as SVG and convert it to WMF or EMF using
 Inkscape. This can be done in the command line like this:
 
 c:\Program Files\Inkscape-0.48\inkscape.exe --without-gui 
 --export-emf=output.emf input.svg
 
 
   Juergen
 
 
 Am 21.04.2014 13 tel:21.04.2014%2013:06, schrieb Neal Becker:
  Make sure to save into a vector graphic format so it can be resized.  
 Try pdf or
  svg (don't know if M$ supports svg though)
 
  Paul Hobson wrote:
 
  Sorry hit send by accident?
 
  What parameters are you passing to `savefig`?
 
  For a presentation, I would save as a .png file, a higher resolution 
 and a
  transparent background. e.g.:
 
  fig.savefig('myfig.png', dpi=600, bbox_inches='ticht', 
 transparent=True)
 
 
  On Sun, Apr 20, 2014 at 10:24 PM, Paul Hobson
  pmhob...@gmail.com mailto:pmhob...@gmail.com wrote:
 
  What parameters are you passing to `savefig`?
 
 
  On Sat, Apr 19, 2014 at 1:13 PM, Chao YUE
  chaoyue...@gmail.com mailto:chaoyue...@gmail.com wrote:
 
  Dear all,
 
  Did anyone try to make plots using matplotlib, and then put the 
 figure in
  the powerpoint for presentation? Currently I am using the ipython 
 notebook
  --pylab mode to make the plots, and then save them to *jpg format. 
 But when
  I put it into the powerpoint, it does not look nice as I see on the 
 screen
  (a little bit blurred). You can really not notice it if you don't 
 examine
  carefully. But I really want to make high quality slides. So does 
 anyone
  have the same problem? could it be related with the figure format or
  backend (GTKAgg) currently I am uisng? thanks a lot in advance.
 
  Cheers,
 
  Chao
 
  --
  please visit:
  http://www.globalcarbonatlas.org/
 
 
  
 ***
  Chao YUE
  Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL)
  UMR 1572 CEA-CNRS-UVSQ
  Batiment 712 - Pe 119
  91191 GIF Sur YVETTE Cedex
  Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16
 
 
  
 
 
 
 
  
 --
  Learn Graph Databases - Download FREE O'Reilly Book
  Graph Databases is the definitive new guide to graph databases and 
 their
  applications. Written by three acclaimed leaders in the field,
  this first edition is now available. Download your free book today!
  http://p.sf.net/sfu/NeoTech
  ___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.net 
 mailto:Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
 
 
 
 
 
  
 --
  Start Your Social Network Today - Download eXo Platform
  Build your Enterprise Intranet with eXo Platform Software
  Java Based Open Source Intranet - Social, Extensible, Cloud Ready
  Get Started Now And Turn Your Intranet Into A Collaboration Platform
  http://p.sf.net/sfu/ExoPlatform
  ___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.net 
 mailto:Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
 
 
 
 --
 Start Your Social Network Today - Download eXo Platform
 Build your Enterprise Intranet with eXo

Re: [Matplotlib-users] nicely formatted exponential in title

2013-11-20 Thread Juergen Hasch
Have you tried latex_float() as suggested here ?
http://stackoverflow.com/questions/13490292/format-number-using-latex-notation-in-python

def latex_float(f):
 float_str = {0:.2g}.format(f)
 if e in float_str:
 base, exponent = float_str.split(e)
 return r{0} \times 10^{{{1}}}.format(base, int(exponent))
 else:
 return float_str

title (r'$\omega=%s$' % latex_float(omega))

Am 20.11.2013 19:00, schrieb Neal Becker:
 I tried:

 plt.title (r'$\omega=%s$' % omega), where omega=-1e-5.  The title says:

 omega=-1e-05

 with the 'e' in italics, and the whole thing generally ugly.

 What I'd like to see is what TeX would do for $1 \times 10^{5}$.

 I know mpl already can nicely format numbers for axis.  Can I somehow use that
 mechanism to nicely format numbers in my title (or other places)?


 --
 Shape the Mobile Experience: Free Subscription
 Software experts and developers: Be at the forefront of tech innovation.
 Intel(R) Software Adrenaline delivers strategic insight and game-changing
 conversations that shape the rapidly evolving mobile landscape. Sign up now.
 http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problems with sans-serif fonts and tick labels with TeX

2013-05-03 Thread Juergen Hasch

 The solution I use when I want all sans-serif out of TeX is to use the 
 cmbright package, which can be turned on by adding:

 rc('text.latex', preamble=r'\usepackage{cmbright}')

 That may require installing the cmbright LaTeX package if you don't already 
 have it.

I am using the sfmath package for this purpose.

There is a nice comparision of the different approaches to get sans-serif math 
fonts at the bottom of the sfmath page: 
http://dtrx.de/od/tex/sfmath.html



--
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with 2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problem with importing LaTeX package amsmath and $\text{}$

2013-03-31 Thread Juergen Hasch
Am 31.03.2013 08:50, schrieb Pawel Chojnacki:
 Thank you very much - hovewer, your solution isn't enough. Adding your lines 
 generate:


The problem is this:

 RuntimeError: LaTeX was not able to process the following string:
 u''
 Here is the full report generated by LaTeX:


Latex doesn't like the empty string. This is caused by the '\n' in your title.
Can you replace your original line:
py.title(u'Wyniki eksperymentu pomiaru gęstości ciała 
stałego\n',size='large',family='serif')
with the new one, as in the example I sent you:
py.title(u'Wyniki eksperymentu pomiaru gęstości ciała 
stałego',size='large',family='serif')


--
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete 
for recognition, cash, and the chance to get your game on Steam. 
$5K grand prize plus 10 genre and skill prizes. Submit your demo 
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problem with importing LaTeX package amsmath and $\text{}$

2013-03-30 Thread Juergen Hasch
Am 30.03.2013 16:29, schrieb Pawel Chojnacki:
 Please pardon me, but what object is math.usetex attribute of? I can't find 
 it in the documentation.

 http://matplotlib.org/users/usetex.html Mentions only text.usetex.



You need to set
mpl.rcParams['text.usetex'] = True

For text you need unicode, for latex raw encoding.
To have text and latex in one line, use
xlabel(u'Häallo '+r'$\varphi$'+ 'r')

Works for me, at least.


--
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete 
for recognition, cash, and the chance to get your game on Steam. 
$5K grand prize plus 10 genre and skill prizes. Submit your demo 
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] XKCD style graphs?

2012-10-11 Thread Juergen Hasch
Am 05.10.2012 11:13, schrieb Matthias BUSSONNIER:

 Le 4 oct. 2012 à 23:09, Juergen Hasch a écrit :

 Here is my take on it as an IPython notebook, based on Damon's code:
 http://nbviewer.ipython.org/3835181/

 I took the engineering approach and filtered the random function instead of 
 doing some fft/ifft magic.
 Also, X and Y of the functions are affected now, giving them a more 
 natural look in the slopes.

Juergen

 If anyone have time to make some examples and a right side thumbnail
 I can make it as featured notebook in the front page of nbviewer.

 You can even make a direct PR agains nbviewer and I would then just have
 to merge and deploy.

 To be fair, notebook should also give some explanation of the code,
 link to this discussion, maybe show one original xkcd graph.

 Please take your time, and if there is several submission,
 we'll sort out how to choose the best(s).

I automated things a little more, and learned a few things about matplotlib on 
the way.
Here is the result:
http://nbviewer.ipython.org/3847459/

With xkcd-style.py here:
https://gist.github.com/3874297



--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Control the position of a figure window

2012-10-04 Thread Juergen Hasch
If you like to use qt4 as backend, you can also do it like this:

import sys
from PySide import QtGui
import numpy as np
from matplotlib.figure import Figure

from matplotlib.backends.backend_qt4agg \
import FigureCanvasQTAgg as FigureCanvas

fig = Figure()
axes = fig.add_subplot(111)
x = np.arange(0.0, 3.0, 0.01)
y = np.cos(2*np.pi*x)
axes.plot(x, y)

# show plot in Qt FigureCanvas
qApp = QtGui.QApplication(sys.argv)
fc=FigureCanvas(fig)
fc.setGeometry(2000, 100, 500, 500)
fc.show()

# a second plot
fc1=FigureCanvas(fig)
fc1.setGeometry(500, 100, 500, 500)
fc1.show()

sys.exit(qApp.exec_())


This works for me on windows with two screens.

Juergen


Am 03.10.2012 20:26, schrieb Gökhan Sever:
 I was after a similar issue once, and asked this question at SO:

 http://stackoverflow.com/questions/7802366/matplotlib-window-layout-questions

 Manual positioning is fine sometimes if I want to really place windows
 side-by-side for comparison purposes. However it would be nicer if mpl were
 to remember positions of figures so that it would place the new figures
 exactly the same place where they were before closed.

 Actually, I have similar complaint for other windows opened in my Fedora 16
 (Gnome 3.2) system. Say for instance I start a gvim instance, then move its
 window to my second monitor, but closing and re-opening it, the window's
 position is restored to the first monitor. Same thing is for evince,
 sometimes it opens pdf's on the first monitor, sometimes on the second,
 randomly position at least for my observation. I don't know where to look
 for a solution; in each specific program, or windows manager should handle
 / remember positions of windows on screens.

 On Tue, Oct 2, 2012 at 9:38 PM, Jianbao Tao jianbao@gmail.com wrote:

 Hi,

 Is it possible to specify the position of a figure window when one is
 created? This will be a killing feature if one wants to put the figure
 window at the right place in the screen automatically. It is annoying if
 ones has to drag a new figure to a comfortable place in the screen every
 time a new figure is created.

 Jianbao


 --
 Don't let slow site performance ruin your business. Deploy New Relic APM
 Deploy New Relic app performance management and know exactly
 what is happening inside your Ruby, Python, PHP, Java, and .NET app
 Try New Relic at no cost today and get our sweet Data Nerd shirt too!
 http://p.sf.net/sfu/newrelic-dev2dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users






 --
 Don't let slow site performance ruin your business. Deploy New Relic APM
 Deploy New Relic app performance management and know exactly
 what is happening inside your Ruby, Python, PHP, Java, and .NET app
 Try New Relic at no cost today and get our sweet Data Nerd shirt too!
 http://p.sf.net/sfu/newrelic-dev2dev



 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] XKCD style graphs?

2012-10-04 Thread Juergen Hasch
Here is my take on it as an IPython notebook, based on Damon's code:
http://nbviewer.ipython.org/3835181/

I took the engineering approach and filtered the random function instead of 
doing some fft/ifft magic.
Also, X and Y of the functions are affected now, giving them a more natural 
look in the slopes.

   Juergen


Am 04.10.2012 18:09, schrieb Pierre Haessig:
 Le 04/10/2012 16:35, Pierre Haessig a écrit :
 So I think this code indeed resamples the rastered plot image on a
 shaken coordinate grid. I kind of understand that the noise on
 coordinates is spatially smoothed by a 10px Gaussian Point Spread
 Function (if I understand correctly...)
 I've implemented this processing in a tiny image_shake script.
 https://gist.github.com/3834536
 A nice occasion to learn how to use some scipy image processing functions...

 I've attached the before/after images because I didn't manage to put
 them in the Gist (it's not a plot image but gives the idea of line shaking).

 Now, I think it's unfortunately outside the frame of Fernando's
 challenge, because this script uses zero matplotlib methods!!

 Best,
 Pierre


--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users