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
(14) |
2
(3) |
3
|
4
|
5
|
6
(6) |
7
(8) |
8
(5) |
9
|
10
|
11
|
12
(7) |
13
(1) |
14
|
15
(2) |
16
(5) |
17
(8) |
18
|
19
(1) |
20
(2) |
21
(3) |
22
(1) |
23
(3) |
24
(1) |
25
|
26
|
27
|
28
|
29
(5) |
30
(3) |
31
|
From: Paul H. <pmh...@gm...> - 2014-05-07 15:32:33
|
How did you install matplotlib? I've had success using anaconda on cheap $7/month web servers before http://continuum.io/downloads On Wed, May 7, 2014 at 7:20 AM, Paul Tremblay <pau...@gm...>wrote: > I am using matplotllib as part of web server. matplotlib causes my server > to crash with this error: > > File > "/apollo/env/Ssdf/lib/python2.7/site-packages/matplotlib/__init__.py", line > 597, in _get_configdir > return _get_config_or_cache_dir(_get_xdg_config_dir()) > File > "/apollo/env/Ssdf/lib/python2.7/site-packages/matplotlib/__init__.py", line > 534, in _get_xdg_config_dir > return os.environ.get('XDG_CONFIG_HOME', os.path.join(get_home(), > '.config')) > File > "/apollo/env/Ssdf/bin/../../../package/local_1/Linux-2.6c2.5-x86_64/Python27/Python27-487.0-0/lib/python2.7/posixpath.py", > line 77, in join > elif path == '' or path.endswith('/'): > <type 'exceptions.AttributeError'>: 'NoneType' object has no attribute > 'endswith' > > I have no home directory on my server (and probably don't have the > permissions to create one). What is the correct way to fix this problem? > > Thanks! > > Paul > > > > ------------------------------------------------------------------------------ > Is your legacy SCM system holding you back? Join Perforce May 7 to find > out: > • 3 signs your SCM is hindering your productivity > • Requirements for releasing software faster > • Expert tips and advice for migrating your SCM now > http://p.sf.net/sfu/perforce > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: Paul T. <pau...@gm...> - 2014-05-07 14:20:12
|
I am using matplotllib as part of web server. matplotlib causes my server to crash with this error: File "/apollo/env/Ssdf/lib/python2.7/site-packages/matplotlib/__init__.py", line 597, in _get_configdir return _get_config_or_cache_dir(_get_xdg_config_dir()) File "/apollo/env/Ssdf/lib/python2.7/site-packages/matplotlib/__init__.py", line 534, in _get_xdg_config_dir return os.environ.get('XDG_CONFIG_HOME', os.path.join(get_home(), '.config')) File "/apollo/env/Ssdf/bin/../../../package/local_1/Linux-2.6c2.5-x86_64/Python27/Python27-487.0-0/lib/python2.7/posixpath.py", line 77, in join elif path == '' or path.endswith('/'): <type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'endswith' I have no home directory on my server (and probably don't have the permissions to create one). What is the correct way to fix this problem? Thanks! Paul |
From: Eric F. <ef...@ha...> - 2014-05-07 13:09:32
|
On 2014/05/07 2:34 AM, Neal Becker wrote: > Neal Becker wrote: > >> I tried the simple example, but all examples I try choke on savefig >> ('blah.pdf') This is fedora20 linux, with pretty modern, complete texlive. >> >> I tried rm'ing tex-cache >> >> ---------------- example.py >> # -*- coding: utf-8 -*- >> >> import matplotlib as mpl >> mpl.use("pgf") >> pgf_with_rc_fonts = { >> "font.family": "serif", >> "font.serif": [], # use latex default serif font >> "font.sans-serif": ["DejaVu Sans"], # use a specific sans-serif font >> } >> mpl.rcParams.update(pgf_with_rc_fonts) >> >> import matplotlib.pyplot as plt >> plt.figure(figsize=(4.5,2.5)) >> plt.plot(range(5)) >> plt.text(0.5, 3., "serif") >> plt.text(0.5, 2., "monospace", family="monospace") >> plt.text(2.5, 2., "sans-serif", family="sans-serif") >> plt.text(2.5, 1., "comic sans", family="Comic Sans MS") >> plt.xlabel(u"µ is not $\\mu$") >> plt.tight_layout(.5) >> ---------------------- >> >> python testpgf.py >> /usr/lib64/python2.7/site-packages/matplotlib/__init__.py:758: UserWarning: >> Found matplotlib configuration in ~/.matplotlib/. To conform with the XDG base >> directory standard, this configuration location has been deprecated on Linux, >> and the new location is now '/home/nbecker/.config'/matplotlib/. Please move >> your configuration there to ensure that matplotlib will continue to find it in >> the future. >> _get_xdg_config_dir()) >> Traceback (most recent call last): >> File "testpgf.py", line 20, in <module> >> plt.tight_layout(.5) >> File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 1255, >> in >> tight_layout >> fig.tight_layout(pad=pad, h_pad=h_pad, w_pad=w_pad, rect=rect) >> File "/usr/lib64/python2.7/site-packages/matplotlib/figure.py", line 1600, >> in >> tight_layout >> renderer = get_renderer(self) >> File "/usr/lib64/python2.7/site-packages/matplotlib/tight_layout.py", line >> 222, in get_renderer >> renderer = canvas.get_renderer() >> File >> "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pgf.py", >> line 925, in get_renderer >> return RendererPgf(self.figure, None, dummy=True) >> File >> "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pgf.py", >> line 409, in __init__ >> self.latexManager = LatexManagerFactory.get_latex_manager() >> File >> "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pgf.py", >> line 223, in get_latex_manager >> new_inst = LatexManager() >> File >> "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pgf.py", >> line 305, in __init__ >> cwd=self.tmpdir) >> File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__ >> errread, errwrite) >> File "/usr/lib64/python2.7/subprocess.py", line 1308, in _execute_child >> raise child_exception >> OSError: [Errno 2] No such file or directory >> > Figured it out. problem is xelatex was not installed. Too bad the traceback > can't be more clear on this. This sounds like something that can be fixed quite easily in mpl, and that if not fixed is likely to trip up other people. Would you turn this into a github issue, please? Or, a PR? Thank you. Eric > > > > ------------------------------------------------------------------------------ > Is your legacy SCM system holding you back? Join Perforce May 7 to find out: > • 3 signs your SCM is hindering your productivity > • Requirements for releasing software faster > • Expert tips and advice for migrating your SCM now > http://p.sf.net/sfu/perforce > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Neal B. <ndb...@gm...> - 2014-05-07 12:35:12
|
Neal Becker wrote: > I tried the simple example, but all examples I try choke on savefig > ('blah.pdf') This is fedora20 linux, with pretty modern, complete texlive. > > I tried rm'ing tex-cache > > ---------------- example.py > # -*- coding: utf-8 -*- > > import matplotlib as mpl > mpl.use("pgf") > pgf_with_rc_fonts = { > "font.family": "serif", > "font.serif": [], # use latex default serif font > "font.sans-serif": ["DejaVu Sans"], # use a specific sans-serif font > } > mpl.rcParams.update(pgf_with_rc_fonts) > > import matplotlib.pyplot as plt > plt.figure(figsize=(4.5,2.5)) > plt.plot(range(5)) > plt.text(0.5, 3., "serif") > plt.text(0.5, 2., "monospace", family="monospace") > plt.text(2.5, 2., "sans-serif", family="sans-serif") > plt.text(2.5, 1., "comic sans", family="Comic Sans MS") > plt.xlabel(u"µ is not $\\mu$") > plt.tight_layout(.5) > ---------------------- > > python testpgf.py > /usr/lib64/python2.7/site-packages/matplotlib/__init__.py:758: UserWarning: > Found matplotlib configuration in ~/.matplotlib/. To conform with the XDG base > directory standard, this configuration location has been deprecated on Linux, > and the new location is now '/home/nbecker/.config'/matplotlib/. Please move > your configuration there to ensure that matplotlib will continue to find it in > the future. > _get_xdg_config_dir()) > Traceback (most recent call last): > File "testpgf.py", line 20, in <module> > plt.tight_layout(.5) > File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 1255, > in > tight_layout > fig.tight_layout(pad=pad, h_pad=h_pad, w_pad=w_pad, rect=rect) > File "/usr/lib64/python2.7/site-packages/matplotlib/figure.py", line 1600, > in > tight_layout > renderer = get_renderer(self) > File "/usr/lib64/python2.7/site-packages/matplotlib/tight_layout.py", line > 222, in get_renderer > renderer = canvas.get_renderer() > File > "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pgf.py", > line 925, in get_renderer > return RendererPgf(self.figure, None, dummy=True) > File > "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pgf.py", > line 409, in __init__ > self.latexManager = LatexManagerFactory.get_latex_manager() > File > "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pgf.py", > line 223, in get_latex_manager > new_inst = LatexManager() > File > "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pgf.py", > line 305, in __init__ > cwd=self.tmpdir) > File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__ > errread, errwrite) > File "/usr/lib64/python2.7/subprocess.py", line 1308, in _execute_child > raise child_exception > OSError: [Errno 2] No such file or directory > Figured it out. problem is xelatex was not installed. Too bad the traceback can't be more clear on this. |
From: Skip M. <sk...@po...> - 2014-05-07 01:23:17
|
> I'm trying to use the webagg backend for the first time, and seem to > be bumping into a common problem - nothing appears. I tried this at home on my Mac. Tornado was already installed, so I updated it to 3.2.1, and ran a Matplotlib app I have which allows me to set the backend on the command line. I get the exact same behavior as at work on my Linux desktop. I get a page at 127.0.0:8988 with a "Figure 1" link. Clicking that takes me to 127.0.0.1:8988/1, which is a blank page. Chrome is my default web browser on both Linux and the Mac. I manually visited the page from both Firefox and Safari, clicked the link, and... nothing. The same behavior as on Chrome. Then I had the bright idea to look at the JavaScript console. It shows this error message: Uncaught SyntaxError: Unexpected token & Clicking that error took me to this line: var fig = new figure('1', websocket_url_prefix); Are those entities supposed to be ''? What bit of code generates that JavaScript? Skip |
From: Neal B. <ndb...@gm...> - 2014-05-06 20:09:13
|
I tried the simple example, but all examples I try choke on savefig ('blah.pdf') This is fedora20 linux, with pretty modern, complete texlive. I tried rm'ing tex-cache ---------------- example.py # -*- coding: utf-8 -*- import matplotlib as mpl mpl.use("pgf") pgf_with_rc_fonts = { "font.family": "serif", "font.serif": [], # use latex default serif font "font.sans-serif": ["DejaVu Sans"], # use a specific sans-serif font } mpl.rcParams.update(pgf_with_rc_fonts) import matplotlib.pyplot as plt plt.figure(figsize=(4.5,2.5)) plt.plot(range(5)) plt.text(0.5, 3., "serif") plt.text(0.5, 2., "monospace", family="monospace") plt.text(2.5, 2., "sans-serif", family="sans-serif") plt.text(2.5, 1., "comic sans", family="Comic Sans MS") plt.xlabel(u"µ is not $\\mu$") plt.tight_layout(.5) ---------------------- python testpgf.py /usr/lib64/python2.7/site-packages/matplotlib/__init__.py:758: UserWarning: Found matplotlib configuration in ~/.matplotlib/. To conform with the XDG base directory standard, this configuration location has been deprecated on Linux, and the new location is now '/home/nbecker/.config'/matplotlib/. Please move your configuration there to ensure that matplotlib will continue to find it in the future. _get_xdg_config_dir()) Traceback (most recent call last): File "testpgf.py", line 20, in <module> plt.tight_layout(.5) File "/usr/lib64/python2.7/site-packages/matplotlib/pyplot.py", line 1255, in tight_layout fig.tight_layout(pad=pad, h_pad=h_pad, w_pad=w_pad, rect=rect) File "/usr/lib64/python2.7/site-packages/matplotlib/figure.py", line 1600, in tight_layout renderer = get_renderer(self) File "/usr/lib64/python2.7/site-packages/matplotlib/tight_layout.py", line 222, in get_renderer renderer = canvas.get_renderer() File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pgf.py", line 925, in get_renderer return RendererPgf(self.figure, None, dummy=True) File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pgf.py", line 409, in __init__ self.latexManager = LatexManagerFactory.get_latex_manager() File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pgf.py", line 223, in get_latex_manager new_inst = LatexManager() File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pgf.py", line 305, in __init__ cwd=self.tmpdir) File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__ errread, errwrite) File "/usr/lib64/python2.7/subprocess.py", line 1308, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory |
From: Marc P. <ma...@nu...> - 2014-05-06 18:05:59
|
Hi Skip, Something like that is probably what I will implement. I want the user to be able to change scale on the fly, so it means keeping 2 copies of the data. Not a big deal, but I just don't want to build something that already exists. cheers, Marc Marc Pelletier, P. Geo. Nutana Geophysics Saskatoon, SK tel: (306) 931-6853 cell: (306) 260-6022 On 06/05/2014 11:43 AM, Skip Montanaro wrote: > On Tue, May 6, 2014 at 12:10 PM, Marc Pelletier > <ma...@nu...> wrote: >> Is there a simple way to accomplish this? > Do some modulo arithmetic on your Y values and lie (in your tick > labels) about the actual numeric values plotted on the Y axis? > > Skip |
From: Skip M. <sk...@po...> - 2014-05-06 17:43:58
|
On Tue, May 6, 2014 at 12:10 PM, Marc Pelletier <ma...@nu...> wrote: > > Is there a simple way to accomplish this? Do some modulo arithmetic on your Y values and lie (in your tick labels) about the actual numeric values plotted on the Y axis? Skip |
From: Marc P. <ma...@nu...> - 2014-05-06 17:30:37
|
Hello, I'm using the RO.StripChartWdg module to plot real time data. The data can vary quite a lot and rather than autoscale I want to set a vertical scale and have it wrap. This is what I mean by wrapping.. when the value scrolls out of the extents of the window it reappears on the opposite side. Ideally I would like to place a connecting bar between them, but its not essential There are lots of ways to accomplish this, but before I set out I want to be sure I'm not reinventing the wheel. Is there a simple way to accomplish this? cheers, Marc Pelletier |
From: Skip M. <sk...@po...> - 2014-05-06 15:54:15
|
I'm trying to use the webagg backend for the first time, and seem to be bumping into a common problem - nothing appears. The first time I tried, I got a complaint that tornado was missing, so I installed it. After that, I get to try plotting. Here's my example: >>> import matplotlib >>> matplotlib.use('webagg') >>> import matplotlib.pyplot as plt >>> plt.plot(range(10)) [<matplotlib.lines.Line2D object at 0x2f56690>] >>> plt.show() Created new window in existing browser session. Press Ctrl+C to stop server ^CServer stopped When I execute plt.show(), a new tab opens in my browser (Chrome, on Linux) with this URL: http://127.0.0.1:8988. That page has a single link (text: "Figure 1"). If I click that link, I get this URL: http://127.0.0.1:8988/1, but nothing appears. The page source contains a bunch of JavaScript references. For instance: <script src="/https/sourceforge.net/_static/jquery/js/jquery-1.7.1.min.js"></script> <script src="/https/sourceforge.net/_static/jquery/js/jquery-ui.min.js"></script> <script src="/https/sourceforge.net/_static/mpl.js"></script> <script src="/https/sourceforge.net/1/mpl_interface.js"></script> I see those JavaScript files at appropriate places in the .../backends/web_backend directory. What am I missing? Thx, Skip |
From: hanudude <han...@gm...> - 2014-05-06 06:25:48
|
Hi,I plotted some data in my figure canvas and now I want to save the figure to pdf and in A4 size PDF. So I did the following: def handlePdfButton(self): from matplotlib.backends.backend_pdf import PdfPages fileName = "sample.pdf" pdf = PdfPages(fileName) self.fig.set_size_inches(8.267,11.692) # to make it A4 sizes pdf.savefig(self.fig) pdf.close() Because I do self.fig.set_size_inches(8.267,11.692) the application window figure is also resized, I do not want this to happen. I need only A4 size pdf, so how do I resize the application figure? Or please suggest if there is any other way to save pdf in A4 size.I do not want the figure to be resized after saving to PDF.Please share your views. Thanks for your help in advance.Sample application code to test: import sysimport numpy as npfrom matplotlib.figure import Figureimport matplotlibmatplotlib.use("Qt4Agg")matplotlib.rcParams['backend.qt4']='PySide'from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas, NavigationToolbar2QTAgg as NavigationToolbarfrom matplotlib.figure import Figureimport PySidefrom PySide import QtGui, QtCoreclass MyApp(QtGui.QMainWindow): def __init__(self, parent=None): QtGui.QMainWindow.__init__(self, parent) self.widget = QtGui.QWidget() self.fig = Figure((5.0, 4.0), dpi=100) self.canvas = FigureCanvas(self.fig) self.toolbar = NavigationToolbar(self.canvas, self) self.PdfButton = QtGui.QPushButton("PDF") self.PdfButton.clicked.connect(self.handlePdfButton) vbox = QtGui.QVBoxLayout() vbox.addWidget(self.canvas) # the matplotlib canvas vbox.addWidget(self.toolbar) vbox.addWidget(self.PdfButton) self.widget.setLayout(vbox) self.setCentralWidget(self.widget) self.axes = self.fig.add_subplot(111) X = np.linspace(-np.pi, np.pi, 256, endpoint=True) C, S = np.cos(X), np.sin(X) self.axes.plot(X, C, linewidth=1.0, linestyle="-", label="cosine") self.axes.plot(X, S, linewidth=1.0, linestyle="-", label="sine") self.axes.legend() self.canvas.draw() def handlePdfButton(self): from matplotlib.backends.backend_pdf import PdfPages fileName = "sample.pdf" pdf = PdfPages(fileName) self.fig.set_size_inches(8.267,11.692) pdf.savefig(self.fig) #self.fig.set_size_inches(8.267,11.692) #self.fig.canvas.resize(20,20) pdf.close() #self.canvas.draw()def main(): app = QtGui.QApplication(sys.argv) form = MyApp() form.show() app.exec_()if __name__ == "__main__": main() -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Resize-the-fig-canvas-after-pdf-savefig-tp43358.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: <cl...@br...> - 2014-05-02 17:05:29
|
Dear colleagues, I had a similar issues with a large plot and several thousands of elements printed under Linux and Qt4Agg back-end. At the PDF render I got some vector overlay and distortion of markers in the drawing, so I've changed the plotting output into a two step process, generating first a high resolution ".png" file and the using the Python image library to compress it into a much smaller .jpeg image output, which produces a browser friendly file or input source for Adobe .pdf editors like OpenOffice. Source: import Image # size for jpg and png output (16000 x 12000 pixel) w = 80 h = 60 # dpi_resolution = 400 fig.set_size_inches(w,h) DPI = fig.get_dpi() print "DPI:", DPI Size = fig.get_size_inches() print "Size in Inches", Size myformats = plt.gcf().canvas.get_supported_filetypes() print "Supported formats are: " + str(myformats) mybackend = plt.get_backend() print "Backend used is: " + str(mybackend) # save screen copy fig.savefig('myplot.png', format='png', dpi= (dpi_resolution)) # JPEG compression with quality of 10 myimage = Image.open('myplot.png') myimage = myimage.resize((16000, 12000), Image.ANTIALIAS) #quality = 10% .. very high compression with few blurs quality_val = 10 myimage.save('myplot.jpg', 'JPEG', quality=quality_val) The visual result looks acceptable with no distortion. This process gives some control about compression and quality. Hope this is useful. Regards, Claude Claude Falbriard Certified IT Specialist L2 - Middleware AMS Hortolândia / SP - Brazil phone: +55 13 9 9760 0453 cell: +55 13 9 8117 3316 e-mail: cl...@br... From: Jouni K. Seppänen <jk...@ik...> To: mat...@li..., Date: 02/05/2014 12:55 Subject: Re: [Matplotlib-users] Millions of data points saved to pdf nertskull <ner...@gm...> writes: > If I change that line the "if True:" then I get MUCH better results. > But I also get enormous file sizes. That's interesting! It means that your pdf viewing program (which one, by the way? Adobe Reader or some alternative?) is slow at compositing a large number of prerendered markers, or perhaps it just renders each of them again and again instead of prerendering, and does so more slowly than if they were part of the same path. > I've taken a subset of 10 of my 750 graphs. > > Those 10, before changing the backend, would make file sizes about about > 290KiB. After changing the backend, if I use plot(x, y, '-') I still > get a file size about 290KiB. > > But after changing the backend, if I use plot(x, y, '.') for my markers, > my file size is no 21+ MB. Just for 10 of my graphs. I'm afraid making > all 750 in the same pdf may be impossible at those size. Does using ',' (comma) instead of '.' (full stop) as the marker help? I think the '.' marker is a circle, just at a small size, while the ',' marker is just two very short lines in the pdf backend. If the ',' marker produces an acceptable file size but its shape is not good enough, we could experiment with creating a marker of intermediate complexity. One thing that I never thought about much is the precision in the numbers the pdf backend outputs in the file. It seems that they are being output with a fixed precision of ten digits after the decimal point, which is probably overkill. There is currently no way to change this except by editing the source code - the critical line is r = ("%.10f" % obj).encode('ascii') where 10 is the number of digits used. The same precision is used for all floating-point numbers, including various transformation matrices, so I can't offer a simple rule for how large deviations you will cause by reducing the precision - you could experiment by making one figure with the existing code and another with '%.3f', and see if the latter looks good enough at the kind of zoom levels you are going to use (and if it really reduces the file size much - there's a compression layer on top of the ASCII representation). That reminds me: one thing that could have an effect is the pdf.compression setting, which defaults to 6 but you can set it to 9 to make the compressed size a little bit smaller, at the expense of spending more time when writing the file. That's not going to be a major difference, though. > Is there anyway to have reasonable pdf sizes as well as this improved > performance for keeping them in vector format? Like others have recommended, rendering huge clouds of single points is a problematic task. I think it's an entirely valid thing to ask for, but it's not likely that there will be a perfect solution, and some other way of visualizing the data may be needed. Bokeh (suggested by Benjamin Root) looks like something that could fit your needs better than a pdf file in a viewer. -- Jouni K. Seppänen http://www.iki.fi/jks ------------------------------------------------------------------------------ "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE Instantly run your Selenium tests across 300+ browser/OS combos. Get unparalleled scalability from the best Selenium testing platform available. Simple to use. Nothing to install. Get started now for free." http://p.sf.net/sfu/SauceLabs _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Jouni K. S. <jk...@ik...> - 2014-05-02 15:54:23
|
nertskull <ner...@gm...> writes: > If I change that line the "if True:" then I get MUCH better results. > But I also get enormous file sizes. That's interesting! It means that your pdf viewing program (which one, by the way? Adobe Reader or some alternative?) is slow at compositing a large number of prerendered markers, or perhaps it just renders each of them again and again instead of prerendering, and does so more slowly than if they were part of the same path. > I've taken a subset of 10 of my 750 graphs. > > Those 10, before changing the backend, would make file sizes about about > 290KiB. After changing the backend, if I use plot(x, y, '-') I still > get a file size about 290KiB. > > But after changing the backend, if I use plot(x, y, '.') for my markers, > my file size is no 21+ MB. Just for 10 of my graphs. I'm afraid making > all 750 in the same pdf may be impossible at those size. Does using ',' (comma) instead of '.' (full stop) as the marker help? I think the '.' marker is a circle, just at a small size, while the ',' marker is just two very short lines in the pdf backend. If the ',' marker produces an acceptable file size but its shape is not good enough, we could experiment with creating a marker of intermediate complexity. One thing that I never thought about much is the precision in the numbers the pdf backend outputs in the file. It seems that they are being output with a fixed precision of ten digits after the decimal point, which is probably overkill. There is currently no way to change this except by editing the source code - the critical line is r = ("%.10f" % obj).encode('ascii') where 10 is the number of digits used. The same precision is used for all floating-point numbers, including various transformation matrices, so I can't offer a simple rule for how large deviations you will cause by reducing the precision - you could experiment by making one figure with the existing code and another with '%.3f', and see if the latter looks good enough at the kind of zoom levels you are going to use (and if it really reduces the file size much - there's a compression layer on top of the ASCII representation). That reminds me: one thing that could have an effect is the pdf.compression setting, which defaults to 6 but you can set it to 9 to make the compressed size a little bit smaller, at the expense of spending more time when writing the file. That's not going to be a major difference, though. > Is there anyway to have reasonable pdf sizes as well as this improved > performance for keeping them in vector format? Like others have recommended, rendering huge clouds of single points is a problematic task. I think it's an entirely valid thing to ask for, but it's not likely that there will be a perfect solution, and some other way of visualizing the data may be needed. Bokeh (suggested by Benjamin Root) looks like something that could fit your needs better than a pdf file in a viewer. -- Jouni K. Seppänen http://www.iki.fi/jks |
From: Daniele N. <da...@gr...> - 2014-05-02 12:25:45
|
On 01/05/2014 19:50, nertskull wrote: > Is there anyway to have reasonable pdf sizes as well as this improved > performance for keeping them in vector format? As others tried to explain to you, plotting that many points in a plot does not make any sense. The only thing that makes sense is to down-sample your data to a manageable size. Depending on which features of your data you are interested in, there are different methods for doing that. PS: which viewer are you using to render the PDF? I believe different renders may have substantially different performances in rendering such PDFs... Cheers, Daniele |
From: nertskull <ner...@gm...> - 2014-05-01 17:50:44
|
That definitely helps. Here's what I did. First. Yeah, the results are totally acceptable if I do '-' as my line/marker. The pdf renders and loads just fine. If I do 'o' or even ',' as my marker, then the pdf is horrendously slow. I'm talking minutes to render a page. So, I tried your idea of altering the backend If I change that line the "if True:" then I get MUCH better results. But I also get enormous file sizes. I've taken a subset of 10 of my 750 graphs. Those 10, before changing the backend, would make file sizes about about 290KiB. After changing the backend, if I use plot(x, y, '-') I still get a file size about 290KiB. But after changing the backend, if I use plot(x, y, '.') for my markers, my file size is no 21+ MB. Just for 10 of my graphs. I'm afraid making all 750 in the same pdf may be impossible at those size. BUT, at least now I can render those 10 in vector format. Before it took the pdf minutes to load a page. Now it only takes maybe 15-20 seconds to load a page of 10 graphs. So that definitely helped. Thanks! Is there anyway to do this even better? At this rate I'd have to split my pdf file into multiple chunks, which really isn't ideal to have to send people 70 pdf files. Is there anyway to have reasonable pdf sizes as well as this improved performance for keeping them in vector format? Thanks again. On 05/01/2014 01:19 PM, Jouni K. Seppänen [via matplotlib] wrote: > nertskull <[hidden email] > </user/SendEmail.jtp?type=node&node=43348&i=0>> writes: > > > The problem, is the pdf is unbearably slow when plotting as a > scatter plot > > or as a line with markers. > > > > If I make a regular line plot, with no markers, just a single line, > it is > > plotted and the pdf is fine. But then it connects my points which I > don't > > want. > > Others have commented on the volume of data, but that paragraph makes > me curious: are you saying that the results are acceptable if you do > something like > > plot(x, y, '-') > > but not if you do > > plot(x, y, 'o') or plot(x, y, '-o')? > > The amount of data in the pdf file should be within a constant factor in > all cases, but the '-' case there are only moveto and lineto commands, > while the two other cases render markers as something called an XObject, > which is repeated a lot of times on the page. I wonder if the overhead > from using an XObject is making the rendering application slow. > > Does it help at all to use a simpler marker, e.g. plot(x, y, ',')? One > change you could try if you're feeling adventurous is the following > function in lib/matplotlib/backends/backend_pdf.py: > > def draw_markers(self, gc, marker_path, marker_trans, path, trans, > rgbFace=None): > # For simple paths or small numbers of markers, don't bother > # making an XObject > if len(path) * len(marker_path) <= 10: > RendererBase.draw_markers(self, gc, marker_path, > marker_trans, > path, trans, rgbFace) > return > # ... > > The comment is not quite right: only if the path is short *and* the > number of markers is small does the XObject code get skipped. You could > just change the if statemt to "if True:" and rerun your code (possibly > with the ',' marker style). If that helps, it's evidence that we need to > revisit the condition for using XObjects for markers. > > -- > Jouni K. Seppänen > http://www.iki.fi/jks > > > ------------------------------------------------------------------------------ > > "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE > Instantly run your Selenium tests across 300+ browser/OS combos. Get > unparalleled scalability from the best Selenium testing platform > available. > Simple to use. Nothing to install. Get started now for free." > http://p.sf.net/sfu/SauceLabs > _______________________________________________ > Matplotlib-users mailing list > [hidden email] </user/SendEmail.jtp?type=node&node=43348&i=1> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > ------------------------------------------------------------------------ > If you reply to this email, your message will be added to the > discussion below: > http://matplotlib.1069221.n5.nabble.com/Millions-of-data-points-saved-to-pdf-tp43338p43348.html > > To unsubscribe from Millions of data points saved to pdf, click here > <http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=43338&code=bmVydHNrdWxsQGdtYWlsLmNvbXw0MzMzOHwtMTQ3Nzk2OTQ5Nw==>. > NAML > <http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Millions-of-data-points-saved-to-pdf-tp43338p43349.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Jouni K. S. <jk...@ik...> - 2014-05-01 17:19:03
|
nertskull <ner...@gm...> writes: > The problem, is the pdf is unbearably slow when plotting as a scatter plot > or as a line with markers. > > If I make a regular line plot, with no markers, just a single line, it is > plotted and the pdf is fine. But then it connects my points which I don't > want. Others have commented on the volume of data, but that paragraph makes me curious: are you saying that the results are acceptable if you do something like plot(x, y, '-') but not if you do plot(x, y, 'o') or plot(x, y, '-o')? The amount of data in the pdf file should be within a constant factor in all cases, but the '-' case there are only moveto and lineto commands, while the two other cases render markers as something called an XObject, which is repeated a lot of times on the page. I wonder if the overhead from using an XObject is making the rendering application slow. Does it help at all to use a simpler marker, e.g. plot(x, y, ',')? One change you could try if you're feeling adventurous is the following function in lib/matplotlib/backends/backend_pdf.py: def draw_markers(self, gc, marker_path, marker_trans, path, trans, rgbFace=None): # For simple paths or small numbers of markers, don't bother # making an XObject if len(path) * len(marker_path) <= 10: RendererBase.draw_markers(self, gc, marker_path, marker_trans, path, trans, rgbFace) return # ... The comment is not quite right: only if the path is short *and* the number of markers is small does the XObject code get skipped. You could just change the if statemt to "if True:" and rerun your code (possibly with the ',' marker style). If that helps, it's evidence that we need to revisit the condition for using XObjects for markers. -- Jouni K. Seppänen http://www.iki.fi/jks |
From: Benjamin R. <ben...@ou...> - 2014-05-01 15:43:35
|
""" The pyplot interface is generally preferred for non-interactive plotting (i.e., scripting). The pylab interface is convenient for interactive calculations and plotting, as it minimizes typing. Note that this is what you get if you use the ipython shell with the -pylab option, which imports everything from pylab and makes plotting fully interactive. """ Gotta remember to update this paragraph... the -pylab option has been long deprecated, and is supposedly about to be removed in an upcoming release of ipython. Ben Root On Thu, May 1, 2014 at 10:38 AM, Yuxiang Wang <yw...@vi...> wrote: > Hi Neal, > > I always followed what has been written here: > > > http://matplotlib.org/faq/usage_faq.html#matplotlib-pylab-and-pyplot-how-are-they-related > > And they said, > > ------------------ > Matplotlib, pylab, and pyplot: how are they related? > > Matplotlib is the whole package; pylab is a module in matplotlib that > gets installed alongside matplotlib; andmatplotlib.pyplot is a module > in matplotlib. > > Pyplot provides the state-machine interface to the underlying plotting > library in matplotlib. This means that figures and axes are implicitly > and automatically created to achieve the desired plot. For example, > calling plot from pyplot will automatically create the necessary > figure and axes to achieve the desired plot. Setting a title will then > automatically set that title to the current axes object: > > import matplotlib.pyplot as plt > > plt.plot(range(10), range(10)) > plt.title("Simple Plot") > plt.show() > > Pylab combines the pyplot functionality (for plotting) with the numpy > functionality (for mathematics and for working with arrays) in a > single namespace, making that namespace (or environment) even more > MATLAB-like. For example, one can call the sin and cos functions just > like you could in MATLAB, as well as having all the features of > pyplot. > > The pyplot interface is generally preferred for non-interactive > plotting (i.e., scripting). The pylab interface is convenient for > interactive calculations and plotting, as it minimizes typing. Note > that this is what you get if you use the ipython shell with the -pylab > option, which imports everything from pylab and makes plotting fully > interactive. > ------------------ > > > -Shawn > > On Thu, May 1, 2014 at 2:16 AM, Michiel de Hoon <mjl...@ya...> > wrote: > > 99.9% of the time I am using pyplot, as it usually does what I want > without me having to understand an api. > > I don't care so much if pyplot agrees with matlab or not, but it should > be something easy that new users can pick up quickly. > > > > Best, > > -Michiel > > > > -------------------------------------------- > > On Wed, 4/30/14, Neal Becker <ndb...@gm...> wrote: > > > > Subject: [Matplotlib-users] Which api to learn? > > To: mat...@li... > > Date: Wednesday, April 30, 2014, 7:49 AM > > > > I've never used matlab (and hope > > never to have to). But I've been using pyplot > > api for mpl for quite a while. > > > > Is there any good reason to move to the "native" mpl api and > > drop pyplot? I ask > > because as I understand, pyplot is intended as a matlab > > workalike, and since I > > never learned matlab I have no need for that crutch. > > OTOH, I'm quite used to > > the pyplot api at this point. > > > > > > > ------------------------------------------------------------------------------ > > "Accelerate Dev Cycles with Automated Cross-Browser Testing > > - For FREE > > Instantly run your Selenium tests across 300+ browser/OS > > combos. Get > > unparalleled scalability from the best Selenium testing > > platform available. > > Simple to use. Nothing to install. Get started now for > > free." > > http://p.sf.net/sfu/SauceLabs > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > > > ------------------------------------------------------------------------------ > > "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE > > Instantly run your Selenium tests across 300+ browser/OS combos. Get > > unparalleled scalability from the best Selenium testing platform > available. > > Simple to use. Nothing to install. Get started now for free." > > http://p.sf.net/sfu/SauceLabs > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > -- > Yuxiang "Shawn" Wang > Gerling Research Lab > University of Virginia > yw...@vi... > +1 (434) 284-0836 > https://sites.google.com/a/virginia.edu/yw5aj/ > > > ------------------------------------------------------------------------------ > "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE > Instantly run your Selenium tests across 300+ browser/OS combos. Get > unparalleled scalability from the best Selenium testing platform available. > Simple to use. Nothing to install. Get started now for free." > http://p.sf.net/sfu/SauceLabs > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Yuxiang W. <yw...@vi...> - 2014-05-01 14:38:31
|
Hi Neal, I always followed what has been written here: http://matplotlib.org/faq/usage_faq.html#matplotlib-pylab-and-pyplot-how-are-they-related And they said, ------------------ Matplotlib, pylab, and pyplot: how are they related? Matplotlib is the whole package; pylab is a module in matplotlib that gets installed alongside matplotlib; andmatplotlib.pyplot is a module in matplotlib. Pyplot provides the state-machine interface to the underlying plotting library in matplotlib. This means that figures and axes are implicitly and automatically created to achieve the desired plot. For example, calling plot from pyplot will automatically create the necessary figure and axes to achieve the desired plot. Setting a title will then automatically set that title to the current axes object: import matplotlib.pyplot as plt plt.plot(range(10), range(10)) plt.title("Simple Plot") plt.show() Pylab combines the pyplot functionality (for plotting) with the numpy functionality (for mathematics and for working with arrays) in a single namespace, making that namespace (or environment) even more MATLAB-like. For example, one can call the sin and cos functions just like you could in MATLAB, as well as having all the features of pyplot. The pyplot interface is generally preferred for non-interactive plotting (i.e., scripting). The pylab interface is convenient for interactive calculations and plotting, as it minimizes typing. Note that this is what you get if you use the ipython shell with the -pylab option, which imports everything from pylab and makes plotting fully interactive. ------------------ -Shawn On Thu, May 1, 2014 at 2:16 AM, Michiel de Hoon <mjl...@ya...> wrote: > 99.9% of the time I am using pyplot, as it usually does what I want without me having to understand an api. > I don't care so much if pyplot agrees with matlab or not, but it should be something easy that new users can pick up quickly. > > Best, > -Michiel > > -------------------------------------------- > On Wed, 4/30/14, Neal Becker <ndb...@gm...> wrote: > > Subject: [Matplotlib-users] Which api to learn? > To: mat...@li... > Date: Wednesday, April 30, 2014, 7:49 AM > > I've never used matlab (and hope > never to have to). But I've been using pyplot > api for mpl for quite a while. > > Is there any good reason to move to the "native" mpl api and > drop pyplot? I ask > because as I understand, pyplot is intended as a matlab > workalike, and since I > never learned matlab I have no need for that crutch. > OTOH, I'm quite used to > the pyplot api at this point. > > > ------------------------------------------------------------------------------ > "Accelerate Dev Cycles with Automated Cross-Browser Testing > - For FREE > Instantly run your Selenium tests across 300+ browser/OS > combos. Get > unparalleled scalability from the best Selenium testing > platform available. > Simple to use. Nothing to install. Get started now for > free." > http://p.sf.net/sfu/SauceLabs > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > ------------------------------------------------------------------------------ > "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE > Instantly run your Selenium tests across 300+ browser/OS combos. Get > unparalleled scalability from the best Selenium testing platform available. > Simple to use. Nothing to install. Get started now for free." > http://p.sf.net/sfu/SauceLabs > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Yuxiang "Shawn" Wang Gerling Research Lab University of Virginia yw...@vi... +1 (434) 284-0836 https://sites.google.com/a/virginia.edu/yw5aj/ |
From: Benjamin R. <ben...@ou...> - 2014-05-01 13:35:49
|
This makes me wonder if you would be better served with something like bokeh: http://bokeh.pydata.org/ Cheers! Ben Root On Thu, May 1, 2014 at 9:28 AM, nertskull <ner...@gm...> wrote: > No we definitely aren't really interested in the gaps. Gaps are just where > we were unable to collect the data. > > I don't know if we can attach pictures to this thread or not, but I'm going > to try. > > The attached is roughly what I want, but with all 750 as vectors. > > I want to see the 'movement' of the line, but I need the gaps to remain, so > I know where they are. > > The problem with plotting a reduced data set, is I lose some of the very > small sections of line. I'll play around with that idea, but we want to be > able to zoom in on a vector file, and see the tiny areas of less than > 10points that would be lost if we plot a reduced data set. > > But what it sounds like, is it is unlikely this will work in vector > graphics > form. Its just too much to do without reducing the dataset. > > <http://matplotlib.1069221.n5.nabble.com/file/n43344/figure_1.png> > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/Millions-of-data-points-saved-to-pdf-tp43338p43344.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE > Instantly run your Selenium tests across 300+ browser/OS combos. Get > unparalleled scalability from the best Selenium testing platform available. > Simple to use. Nothing to install. Get started now for free." > http://p.sf.net/sfu/SauceLabs > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: nertskull <ner...@gm...> - 2014-05-01 13:28:17
|
No we definitely aren't really interested in the gaps. Gaps are just where we were unable to collect the data. I don't know if we can attach pictures to this thread or not, but I'm going to try. The attached is roughly what I want, but with all 750 as vectors. I want to see the 'movement' of the line, but I need the gaps to remain, so I know where they are. The problem with plotting a reduced data set, is I lose some of the very small sections of line. I'll play around with that idea, but we want to be able to zoom in on a vector file, and see the tiny areas of less than 10points that would be lost if we plot a reduced data set. But what it sounds like, is it is unlikely this will work in vector graphics form. Its just too much to do without reducing the dataset. <http://matplotlib.1069221.n5.nabble.com/file/n43344/figure_1.png> -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Millions-of-data-points-saved-to-pdf-tp43338p43344.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Dominik K. <dk...@as...> - 2014-05-01 13:22:18
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, when reading the number of points you have in each plot, I have to ask why you need so many (plotted) data points. If you plot e.g. every 10th or 50th data point, you reduce the number of points by a factor of 10 (or 50). This should make the PDF smaller and faster and even if you zoom into each plot, you should be able to see enough details (of course, if there are one or two outliers you might not see them). And probably you are not able to distinguish between two data points if they are too close to each other so you probably don't need every data point. Cheers, Dominik On 05/01/2014 02:09 PM, nertskull wrote: > I am trying to create a multipage pdf of about 750 different > graphs. > > Each graph has around 5,000 - 15,000 data points, giving me roughly > 7 million points across the pdf. I make it in a large pdf with a > page length of about 20 inches, and then plot about 10 graphs to a > page. So I end up with basically 75 pages in my pdf. I'm > basically trying to graph a line of XY data points. > > The problem, is the pdf is unbearably slow when plotting as a > scatter plot or as a line with markers. > > If I make a regular line plot, with no markers, just a single line, > it is plotted and the pdf is fine. But then it connects my points > which I don't want. > > I assume this is all because its making the pdf in vector format. > And when I convert it to single lines, I only have ~750 line > vectors. But when I try to scatter plot, or line plot with > markers, I end up with millions of vectors. > > I've tried the 'rasterized=True' and that definitely works. But > the quality is really bad. I need to be able to zoom in close on > the pdf and still see rough resolution of the points. > > For clarity, I don't actually need to see each individual points. > The graphs have two lines on them, and I just need to be able to > distinguish between the two lines. The two lines are just made up > of thousands of points each. > > Is there anyway to keep scalable vectors and do this? Or will I > just be forced to go to a rasterized image file in order to load > the pdf in a reasonable time. > > Thanks. > > > > -- View this message in context: > http://matplotlib.1069221.n5.nabble.com/Millions-of-data-points-saved-to-pdf-tp43338.html > > Sent from the matplotlib - users mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > > "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE > Instantly run your Selenium tests across 300+ browser/OS combos. > Get unparalleled scalability from the best Selenium testing > platform available. Simple to use. Nothing to install. Get started > now for free." http://p.sf.net/sfu/SauceLabs > _______________________________________________ Matplotlib-users > mailing list Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > - -- Dominik Klaes Deputy student representative of the AIfA Argelander-Institut für Astronomie Room 2.027a Auf dem Hügel 71 53121 Bonn Telefon: 0228/73-5773 E-Mail: dk...@as... Homepage: http://www.astro.uni-bonn.de/~dklaes/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJTYjxlAAoJEG4xBfJ3OX2tck4QALZ4raj6ZHW50Ie2uj31dC7n q7LynLhBCfYr8Hs/m8wad/VfNStNqdoyJta683YF4ev6qskUY6lvh3qzYRNZdYMk 8yzT2CmhrWss+jEQYyrfKjrjSZbWMtCRaNHdrF/Ne6Je7VaPE/y6+4PXmkKNNeKU bCdRdyUsUb+cjQPXgIn0bN9AFqNDOcVpMkkkzxfHU2n0kGGOymVRpOLRqQbSFR5X AsyawYmia08RRr312dNja27BJcvXA9JHJ+qk0r7UPCOZow2GZGb6BlCu+eE/xtBt j/r9Ym5KUgSD0q35veT34BLoMuD/L3Q7RujCxkToKezTdNGbRZh/8EkRKbu5Zc48 SnZAkmcAO8GTXqdBaD32l67iOjSCK1qqXLv8/Sb+0OOhZ3gMdF/6PbxvBM3m7U0g zthwBYWBkJrZUuBRyi3fzYs5olvlQDW6RWPnB4tA5acrOmrHAhSqp5I4nk+ln/mZ s41R+uG2sx5+F3aJGMLEL0lNpRtQbWUIPQ7RHJ48TVHhrG3oB/41Li4FOcYvboKr 8B5XIygw8eNULja7Q7Coz2T/uFg42pMyRMMMDz92eLhOxlmk8k0bWqAqUp4dj85l Hodz94PwYvloWV6tagSHVAYiUtkWhkyHOYBSH1oPSfB4Tpsh8aiGCk5oIZn92Kty kswsXBVzAe4npHOfl05Y =9Tfy -----END PGP SIGNATURE----- |
From: Shahar S. K. <ka...@po...> - 2014-05-01 13:08:44
|
What do you consider a gap?Perhaps if you know that you can find those in your data and if you really want to visualize the gaps, plot those instead of the data. — Sent from Mailbox On Thu, May 1, 2014 at 2:41 PM, Alan G Isaac <ala...@gm...> wrote: > Suppose each data point is only 1 point (1/72 ") in diameter. > A solid line across a 20" page is less than 1500 points. > You're using a fraction of a page per graph and trying to > plot 5,000-15,000 points per graph. This is pointless (pun > intended) for visual display, especially since you do not > care about the individual points. What happens if you > decimate the points? Is the result acceptable? > Perhaps you could do even better than that, given your > posted description. Fit a line to the points, and only > plot the fitted line. Or use something like `hexbin`. > Alan Isaac > ------------------------------------------------------------------------------ > "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE > Instantly run your Selenium tests across 300+ browser/OS combos. Get > unparalleled scalability from the best Selenium testing platform available. > Simple to use. Nothing to install. Get started now for free." > http://p.sf.net/sfu/SauceLabs > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Shahar S. K. <ka...@po...> - 2014-05-01 12:48:54
|
How about different line styles or colors instead of markers?— Sent from Mailbox On Thu, May 1, 2014 at 2:10 PM, nertskull <ner...@gm...> wrote: > I am trying to create a multipage pdf of about 750 different graphs. > Each graph has around 5,000 - 15,000 data points, giving me roughly 7 > million points across the pdf. I make it in a large pdf with a page length > of about 20 inches, and then plot about 10 graphs to a page. So I end up > with basically 75 pages in my pdf. I'm basically trying to graph a line of > XY data points. > The problem, is the pdf is unbearably slow when plotting as a scatter plot > or as a line with markers. > If I make a regular line plot, with no markers, just a single line, it is > plotted and the pdf is fine. But then it connects my points which I don't > want. > I assume this is all because its making the pdf in vector format. And when > I convert it to single lines, I only have ~750 line vectors. But when I try > to scatter plot, or line plot with markers, I end up with millions of > vectors. > I've tried the 'rasterized=True' and that definitely works. But the quality > is really bad. I need to be able to zoom in close on the pdf and still see > rough resolution of the points. > For clarity, I don't actually need to see each individual points. The > graphs have two lines on them, and I just need to be able to distinguish > between the two lines. The two lines are just made up of thousands of > points each. > Is there anyway to keep scalable vectors and do this? Or will I just be > forced to go to a rasterized image file in order to load the pdf in a > reasonable time. > Thanks. > -- > View this message in context: http://matplotlib.1069221.n5.nabble.com/Millions-of-data-points-saved-to-pdf-tp43338.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > ------------------------------------------------------------------------------ > "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE > Instantly run your Selenium tests across 300+ browser/OS combos. Get > unparalleled scalability from the best Selenium testing platform available. > Simple to use. Nothing to install. Get started now for free." > http://p.sf.net/sfu/SauceLabs > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Alan G I. <ala...@gm...> - 2014-05-01 12:41:43
|
On 5/1/2014 6:47 AM, Björn Opitz wrote: > How would you create a figure as in > "fig = plt.figure()", but without pyplot? http://econpy.googlecode.com/svn/trunk/software4econ.xhtml#mpl-hints hth, Alan Isaac |
From: Alan G I. <ala...@gm...> - 2014-05-01 12:41:11
|
Suppose each data point is only 1 point (1/72 ") in diameter. A solid line across a 20" page is less than 1500 points. You're using a fraction of a page per graph and trying to plot 5,000-15,000 points per graph. This is pointless (pun intended) for visual display, especially since you do not care about the individual points. What happens if you decimate the points? Is the result acceptable? Perhaps you could do even better than that, given your posted description. Fit a line to the points, and only plot the fitted line. Or use something like `hexbin`. Alan Isaac |