Re: [Matplotlib-users] Failing to install matplotlib with python 3

2016-06-16 Thread Eric Firing

Alan,

This mailing list is obsolete; please use matplotlib-us...@python.org.

Your traceback looks vaguely familiar as something that has come up 
before, but I don't have any more recollection than that.  Suggestions:


1) Install your python environment the easy way via anaconda or 
miniconda: https://www.continuum.io/downloads


2) If you are *sure* you don't want to do it that way, make sure you 
have the most recent version of pip.


3) Likewise, install the most recent matplotlib.  See attached message.

Eric

On 2016/06/16 6:07 AM, Alan wrote:

Hi there,

I am not the admin so I have installed my own python 3.5.1 and I am
using pip3 to install all modules I need. I got all but matplotlib :-(

pip3 install -U matplotlib

  Collecting matplotlib
  Using cached matplotlib-1.5.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
  File "", line 1, in 
  File "/tmp/pip-build-6eka4_fr/matplotlib/setup.py", line 167, in

result = package.check()
  File "/tmp/pip-build-6eka4_fr/matplotlib/setupext.py", line 980,
in check
min_version='1.2', version=version)
  File "/tmp/pip-build-6eka4_fr/matplotlib/setupext.py", line 459,
in _check_for_pkg_config
if (not is_min_version(version, min_version)):
  File "/tmp/pip-build-6eka4_fr/matplotlib/setupext.py", line 179,
in is_min_version
return found_version >= expected_version
  File "/sw/arch/Test2/lib/python3.5/distutils/version.py", line 70,
in __ge__
c = self._cmp(other)
  File "/sw/arch/Test2/lib/python3.5/distutils/version.py", line
337, in _cmp
if self.version < other.version:
TypeError: unorderable types: str() < int()


Edit setup.cfg to change the build options

BUILDING MATPLOTLIB
matplotlib: yes [1.5.1]
python: yes [3.5.1 (default, Jun 16 2016, 11:03:02)
 [GCC
4.4.7 20120313 (Red Hat 4.4.7-11)]]
  platform: yes [linux]

REQUIRED DEPENDENCIES AND EXTENSIONS
 numpy: yes [version 1.11.0]
  dateutil: yes [using dateutil version 2.5.3]
  pytz: yes [using pytz version 2016.4]
cycler: yes [using cycler version 0.10.0]
   tornado: yes [using tornado version 4.3]
 pyparsing: yes [using pyparsing version 2.1.5]
libagg: yes [pkg-config information for 'libagg'
could not
be found. Using local copy.]
  freetype: yes [version unknown]


Command "python setup.py egg_info" failed with error code 1 in
/tmp/pip-build-6eka4_fr/matplotlib/

What am I missing here please?

Thanks,

Alan

PS. btw, with python 2.7.11 all went fine.



--- Begin Message ---
Hi,

On Thu, May 26, 2016 at 7:44 PM, Thomas Caswell  wrote:
> Hey folks,
>
> I just tagged rc2.
>
> This includes a some-what aggressive backport of the reworking of how we
> link into Tk to decouple from the exact version of tk we are compiled
> against (https://github.com/matplotlib/matplotlib/pull/6442)
>
> As such, please try to build this on your your systems and verify that mpl
> builds and works correctly with the tkagg backend.
>
> A major motivation for including this in the 1.5.2 release is that we can
> now release wheels for all of the major platforms.  Much of the credit for
> this should go to the tireless Matthew Brett.
>
> The new rc (and the old one) should be available (assuming the CI passes)
> for conda via
>
>conda install -c conda-forge/channel/rc matplotlib

Y'all can test the new manylinux wheels with:

python -m pip install --upgrade pip  # upgrade to latest pip
pip install -f https://nipy.bic.berkeley.edu/manylinux --pre matplotlib

In particular, I'd love to know whether this works for you:

>>> import matplotlib
>>> matplotlib.use('tkagg')
>>> import matplotlib.pyplot as plt
>>> plt.plot(range(10))
>>> plt.show()

Cheers,

Matthew
___
Matplotlib-devel mailing list
matplotlib-de...@python.org
https://mail.python.org/mailman/listinfo/matplotlib-devel
--- End Message ---
--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://sdm.link/zohomanageengine___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How do I make a Mercator map larger

2016-01-05 Thread Eric Firing
On 2016/01/05 9:48 AM, Martin McGlensey wrote:
> Arnaldo,
>
> Thanks for the response. I figured it out. Figsize although the units
> are inches it does not correspond to inches on the display. I had to go
> up to 23 X 12 to get a large image on the display. If I want to fill the
> display what parameters should I use? I’m looking for a large map not a
> large frame size. Maybe I’m not understanding the functions of the
> various arguments used.

Rather than using a large size in inches, increase the value of the 
"dpi" kwarg to "figure()".  When it matches your actual screen dpi, the 
display on the screen should be correct in the specified dimensions in 
inches, *provided* those dimensions plus the margins (toolbar etc.) fit 
on your screen.  If they don't, then decrease the dpi (scaling the 
displayed figure down) until they do.

Eric

>
> Regards,
>
> Marty
>
> *From:*Arnaldo Russo [mailto:arnaldoru...@gmail.com]
> *Sent:* Monday, January 4, 2016 6:43 AM
> *To:* Martin McGlensey 
> *Cc:* matplotlib-users@lists.sourceforge.net
> *Subject:* Re: [Matplotlib-users] How do I make a Mercator map larger
>
> Hi Martin,
>
> Have you tried to save your figure and check if it does not enlarge your
> figure?
>
>  plt.savefig("mercator.png")
>
> Cheers,
>
> Arnaldo.
>
> ---
>
> Arnaldo D'Amaral Pereira Granja Russo
>
> Universidade do Estado de Santa Catarina - UDESC
>
> Pesquisador - Instituto Ambiental Boto Flipper
>
> institutobotoflipper.org
>
> 2016-01-03 20:20 GMT-02:00 Martin McGlensey  >:
>
> Hello,
>
> I’m a new user to both python and basemap. I’ve got my map working
> OK, but would like to make it larger on the display. I’ve tried the
> height and width parameters in the map definition (m=basemap(…) and
> plt.figure(figuresize=(x,y)). Neither appear to have any effect on
> the size of the map.
>
> Is there an easy way to convert map coordinates to inches?
>
> Thanks,
>
> Marty
>
>
> 
> --
>
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> 
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
> --
>
>
>
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>


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


Re: [Matplotlib-users] TypeError: can't multiply sequence by non-int of type 'float'

2015-09-28 Thread Eric Firing
On 2015/09/28 5:43 AM, Benjamin Root wrote:
> Confirmed using a fairly recent matplotlib checkout. Could you file a
> bug report? This is going to need some investigating.

Line3D.set_3d_properties is not doing anything to turn zs into an 
ndarray; in fact, when zs is a scalar, it is turning it into a list.  I 
suspect this is the place to make it an array.  Probably better here 
than anywhere farther down.  It also looks to me like Line3D.__init__ 
should be using self.set_3d_properties.

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


Re: [Matplotlib-users] Misleading BoundaryNorm error

2015-07-31 Thread Eric Firing
Thank you!  We are always happy to have new contributors!

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


Re: [Matplotlib-users] Misleading BoundaryNorm error

2015-07-30 Thread Eric Firing
Forcing the scalar to be a 1-element array would still leave the API
inconsistent with what you show for Normalize.  One solution is to
flag a scalar at the start, and then de-reference at the end.  Would
you like to submit a PR to take care of this?

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


Re: [Matplotlib-users] Matplotlib differences MacOSXAgg and others

2015-07-15 Thread Eric Firing
It is not clear to me that 4202 would fix it, and I think 4202 has a 
basic problem of its own.

John, if you haven't already done so, please escalate this to a github 
issue.

Eric

On 2015/07/15 4:58 AM, Thomas Caswell wrote:
 The PR to fix this is still open
 (https://github.com/matplotlib/matplotlib/pull/4202).

 Tom

 On Wed, Jul 15, 2015 at 10:29 AM John Coppens j...@jcoppens.com
 mailto:j...@jcoppens.com wrote:

 Hello again,

 I've posted these two issues in separate mails, as I suspect they're
 actually different problems.

 This error is particular to the default version of MacOSX's matplotlib
 version 1.4.3:

 When doing a simple plot:

 import matplotlib.pyplot as plt

 def test_plot():
  x = range(11)
  y = [x0**2 for x0 in x]

  plt.plot(x, y, 'o:', fillstyle='none', label = 1, ms = 10)
  plt.legend()
  plt.show()

 def main(args):
  test_plot()
  return 0

 if __name__ == '__main__':
  import sys
  sys.exit(main(sys.argv))

 Much of the data is available on this thread on stackoverflow:

 
 http://stackoverflow.com/questions/31408928/how-can-i-plot-hollowed-symbols-connected-with-dotted-lines-in-one-go/31410105?noredirect=1#comment50794519_31410105

 The gist is that a dotted line ('o:') works correctly
 on my system (Linux Slackware/matplotlib 1.3.1 and 1.4.3), on C.C.Yang's
 Linux Mint, but not on his MacOSX (on which the _circle symbols_ are
 also
 dotted).

 It does work if he defines TkAgg or GtkAgg (even though he does not have
 Gtk installed on his Mac)

 Any suggestions to solve this?

 Is there a problem in the MacOSXAgg backend?

 John

 
 --
 Don't Limit Your Business. Reach for the Cloud.
 GigeNET's Cloud Solutions provide you with the tools and support that
 you need to offload your IT needs and focus on growing your business.
 Configured For All Businesses. Start Your Cloud Today.
 https://www.gigenetcloud.com/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 mailto:Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



 --
 Don't Limit Your Business. Reach for the Cloud.
 GigeNET's Cloud Solutions provide you with the tools and support that
 you need to offload your IT needs and focus on growing your business.
 Configured For All Businesses. Start Your Cloud Today.
 https://www.gigenetcloud.com/



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



--
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] TypeError: Dimensions of C (645, 536) are incompatible with X (538) and/or Y (646); see help(pcolormesh)

2015-06-30 Thread Eric Firing
On 2015/06/30 6:41 AM, Benjamin Root wrote:
 It looks like your X data is one element larger than it needs to be. I
 know pcolor() accepts grids that are (N+1,M+1), and I *think* pcolormesh
 does the same. It will also accept grids that are (N,M) as well, but
 will drop the last row and collumn.

Yes, pcolormesh and pcolor use the same argument parsing and checking. 
They actually *want* N+1, M+1; the *acceptance* of N, M is a matlab-ism 
that is convenient for quick looks, but is also a potential source of error.

The OP has an X dimension of M+2, which indicates an error earlier in 
the OP's code.

Eric

--
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] backend_webagg for streaming plot updates: examples?

2015-06-24 Thread Eric Firing
On 2015/06/23 10:39 AM, Eric Firing wrote:
 I would like to be able to publish plots that are updated as data are
 received by the server.  I don't actually want any of the toolbar
 interactivity--I just want the updated plot to appear in the browser
 automatically.  I suspect this can all be done quite easily using the
 webagg backend, but I have not yet figured it out by looking at the
 embedding_in_webagg.py example and the backend_webagg* code.  I expect
 that stripping out the toolbar is straightforward, but what I don't
 understand is how to achieve the dynamic updates, preferably without
 using the animation framework, which I think would add unnecessary
 complexity.

 Are there any other examples floating around that would help?

 Thanks.

 Eric

To answer my own question, in case anyone else is interested, here is a 
block of code that can be substituted for the corresponding elements of 
the embedding_in_webagg.py example.  The whole block goes at the bottom.

-
def create_figure():
 fig = Figure()
 ax = fig.add_subplot(1,1,1)
 ax.set_xlim(0, 1)
 ax.set_ylim(0, 1)
 line, = ax.plot([], [], 'r-')
 return fig, line

if __name__ == __main__:
 figure, line = create_figure()
 application = MyApplication(figure)

 http_server = tornado.httpserver.HTTPServer(application)
 http_server.listen(8080)

 print(http://127.0.0.1:8080/;)
 print(Press Ctrl+C to quit)

 def update2():
 line.set_data(np.random.rand(2, 25))
 figure.canvas.draw_idle()

 io_loop = tornado.ioloop.IOLoop.instance()
 cb = tornado.ioloop.PeriodicCallback(update2, 1000)
 cb.start()

 io_loop.start()
--

Instead of the using the PeriodicCallback I will probably be using 
ZMQStream.on_recv() to register a callback on a socket, but that doesn't 
change the basic structure.

Eric



--
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical  virtual servers, alerts via email  sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] backend_webagg for streaming plot updates: examples?

2015-06-23 Thread Eric Firing
I would like to be able to publish plots that are updated as data are 
received by the server.  I don't actually want any of the toolbar 
interactivity--I just want the updated plot to appear in the browser 
automatically.  I suspect this can all be done quite easily using the 
webagg backend, but I have not yet figured it out by looking at the 
embedding_in_webagg.py example and the backend_webagg* code.  I expect 
that stripping out the toolbar is straightforward, but what I don't 
understand is how to achieve the dynamic updates, preferably without 
using the animation framework, which I think would add unnecessary 
complexity.

Are there any other examples floating around that would help?

Thanks.

Eric

--
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical  virtual servers, alerts via email  sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problem on Basemap gshhs data and the associated is_land function

2015-06-19 Thread Eric Firing
On 2015/06/10 4:24 AM, Jiali Ma wrote:
 Thanks for reading my mail.
 In basemap toolkit of matplotlib, I found the  Coastline data used is from
 the GSHHS (http://www.soest.hawaii.edu/wessel/gshhs/gshhs.html).But I found
 it barely satisfying to use.

Are you specifying a sufficiently high resolution and using the 
drawrivers() method?

I think that trying to put your own data into a form to be used as a 
direct substitute for the built-in data would be very difficult, but you 
can always plot things directly on the map.

Eric



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


Re: [Matplotlib-users] [matplotlib-devel] pyplot functions: do you rely on the hold kwarg?

2015-06-07 Thread Eric Firing
On 2015/06/07 12:05 PM, Nathaniel Smith wrote:
 On Sun, Jun 7, 2015 at 2:37 PM, Eric Firing efir...@hawaii.edu wrote:
 Matplotlib's pyplot retains quite a few vestiges from its original
 Matlab-workalike heritage; we would like to gradually eliminate those
 that no longer make sense.  One such candidate is the hold kwarg that
 every pyplot function has, with a True default.  I don't think it
 serves any useful purpose now, and getting rid of it would allow
 considerable simplification to the code and, to a lesser extent, the
 documentation.  The default behavior would not change, only the ability
 to change that behavior via either the rcParams['axes.hold'] parameter
 or the hold kwarg in a pyplot function call.

 If you routinely use 'hold=False' and believe that removing it would be
 a mistake, please let us know.

 I do actually use it with some regularity interactively, though I'm
 not particularly attached to it. Is there some equivalent though, like
 plt.whatever(..., hold=False)
 can become
 plt.clear(); plt.whatever(...)

It's exactly equivalent to:
plt.cla(); plt.whatever(...)

 ? The semantics would be that the current figure remains the current
 figure, but is reset so that the next operation starts from scratch. I
 notice that plt.clear() does not exist, but maybe it has another
 spelling :-).

There are two types of clear:
plt.clf()  # clear the current Figure
plt.cla()  # clear the current Axes

Eric


 (Basically the use case here is getting something like the
 edit-and-rerun-a-cell workflow, but when using a classic interactive
 REPL rather than the ipython notebook -- so I have a specific plot
 window up on my screen at a size and place where I can see it, and
 maybe some other plots in other windows in the background somewhere,
 and I want to quickly display different things into that window.)

 -n



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


[Matplotlib-users] pyplot functions: do you rely on the hold kwarg?

2015-06-07 Thread Eric Firing
Matplotlib's pyplot retains quite a few vestiges from its original 
Matlab-workalike heritage; we would like to gradually eliminate those 
that no longer make sense.  One such candidate is the hold kwarg that 
every pyplot function has, with a True default.  I don't think it 
serves any useful purpose now, and getting rid of it would allow 
considerable simplification to the code and, to a lesser extent, the 
documentation.  The default behavior would not change, only the ability 
to change that behavior via either the rcParams['axes.hold'] parameter 
or the hold kwarg in a pyplot function call.

If you routinely use 'hold=False' and believe that removing it would be 
a mistake, please let us know.

Thanks.

Eric

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


Re: [Matplotlib-users] Fwd: [matplotlib-devel] RFC: candidates for a new default colormap

2015-06-05 Thread Eric Firing
On 2015/06/05 6:15 AM, Joe Kington wrote:
 Hopefully I will have some time today to play around with the D
 option. I want to see if I can shift the curve a bit to include more
 yellows and orange so that it can have a mix of cool and warm colors.



 I was thinking the same thing earlier.  Here's my attempt:

Joe,

Thank you--that's an interesting option.  It reminds me of the middle 
half of cubehelix in the Miscellaneous set:

http://matplotlib.org/examples/color/colormaps_reference.html

Cubehelix is also generated by an algorithm.

Your blu_grn_pink2 looks worth adding to the mpl collection.

Eric


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


Re: [Matplotlib-users] [matplotlib-devel] RFC: candidates for a new default colormap

2015-06-05 Thread Eric Firing
On 2015/06/05 8:17 AM, Sourish Basu wrote:
 Very often the zero of an anomaly is not at the center of the extrema,
 and requires creating a custom diverging colormap anyway (see attached
 example).

Reminder: in matplotlib, color mapping is done with the combination of a 
colormap and a norm.  This allows one to design a norm to handle the 
mapping, including any nonlinearity or difference between the handling 
of positive and negative values.  This is more general than customizing 
a colormap; once you have a norm to suit your purpose, you can use it 
with any colormap.

Maybe this is actually what you are already doing, but I wanted to point 
it out here in case some readers are not familiar with this 
colormap+norm strategy.

Eric

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


Re: [Matplotlib-users] [matplotlib-devel] RFC: candidates for a new default colormap

2015-06-05 Thread Eric Firing
On 2015/06/05 11:13 AM, Jody Klymak wrote:
 Though I was hazily aware of norms, I’d not really seen that before.
 I particularly like the example
 athttp://matplotlib.org/examples/pylab_examples/pcolor_log.html

 This seems useful enough that a section under “User Guide:Advanced
 Guide” would be really helpful.  An example that displays all the
 canned norms, and maybe how to make a custom norm.  I only found the
 pcolor_log example by searching for colors.lognorm, which I only knew
 about from your comment above.  There a few hits on stackexchange,
 but those are for specific instances and hard to find by random.

 I could help do this, but it’d take a while to actually learn how to
 use the norms.

Jody,

Contributions to the documentation would be very welcome.

Eric

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


[Matplotlib-users] Fwd: [matplotlib-devel] RFC: candidates for a new default colormap

2015-06-04 Thread Eric Firing
I am forwarding a message from Nathaniel Smith which is the start of a 
long thread on matplotlib-devel
http://news.gmane.org/gmane.comp.python.matplotlib.devel
related to changes that are in the works for matplotlib, and that are 
therefore of interest to matplotlib users.  Specifically, we will be 
updating the default color cycle for line plots, and the default 
colormap for image-type plots, including contourf and pcolormesh.  The 
most important part of Nathaniel's message is the link:

 https://bids.github.io/colormap/

which has been updated since his first message below.

Note that we are looking for a new *default* colormap--the one that will 
be used if you have not specified an alternative in your matplotlibrc 
file, your function keyword arguments, or anywhere else.  It does not in 
any way limit your ability to specify a colormap that you prefer for a 
particular application, or as your own default.  Rather, it should be a 
good all-around choice, that works reasonably well in a variety of 
applications, and that most people will find *comfortable* as well as 
functional.  It will become part of matplotlib's look; it should 
attract rather than repel prospective and new users.  We have some 
consensus about some of the other criteria, and these are coded into the 
tool that Nathaniel and Stéfan have developed for generating colormaps. 
  So far, 4 alternatives generated with this tool have been proposed at 
the link above; more might be added.

Eric

 Forwarded Message 
Subject: [matplotlib-devel] RFC: candidates for a new default colormap
Date: Tue, 2 Jun 2015 18:46:21 -0700
From: Nathaniel Smith n...@pobox.com
To: matplotlib-de...@lists.sourceforge.net 
matplotlib-de...@lists.sourceforge.net

Hi all,

As was hinted at in a previous thread, Stéfan van der Walt and I have
been using some Fancy Color Technology to attempt to design a new
colormap intended to become matplotlib's new default. (Down with jet!)

Unfortunately, while our Fancy Color Technology includes a
computational model of perceptual distance, it does not include a
computational model of aesthetics. So this is where you come in.

We've put up three reasonable candidates at:
 https://bids.github.io/colormap/
(along with some well-known colormaps for comparison), and we'd like
your feedback.

They are all optimal on all of the objective criteria we know how to
measure. What we need judgements on is which one you like best, both
aesthetically and as a way of visualizing data. (There are some sample
plots to look at there, plus you can download them and play with them
on your own data if you want.)

We especially value input from anyone with anomalous color vision.
There are some simulations there, but computational models are
inherently limited here. (It's difficult to ask someone with
colorblindness does this look to you, the same way this other picture
looks to me?)

-n

-- 
Nathaniel J. Smith -- http://vorpus.org

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



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


Re: [Matplotlib-users] problem: AttributeError: 'float' object has no attribute 'trace'

2015-06-03 Thread Eric Firing
On 2015/06/03 8:03 AM, Juan Wu wrote:
 Hi, List experts,

 Any one can help for this error solution? I googled but did not find
 this report.

 Thanks in adance...

 matplotlib.figure.Figure at 0x1afe8f50
 Traceback (most recent call last):

File ipython-input-38-7909dff7bc28, line 5, in module
  hddm.analyze.plot_posterior_nodes([float(v_Neutral), float(v_Win),
 float(v_Loss)])

File C:\Anaconda\lib\site-packages\kabuki\analyze.py, line 34, in
 plot_posterior_nodes
  lb = min([min(node.trace()[:]) for node in nodes])

 AttributeError: 'float' object has no attribute 'trace'

This error is not coming from matplotlib at all.  plot_posterior_nodes 
is not our function.

Eric



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


Re: [Matplotlib-users] Runtime Error on Solaris - Error Closing Dupe File Handle

2015-05-28 Thread Eric Firing
On 2015/05/28 3:13 AM, Bryan Williams wrote:
 I have gcc on the box. I also installed the C compiler for Solaris (cc),
 but I couldn't seem to find an option to switch it so that it uses cc
 rather than gcc.

Maybe you can do this with an environment variable?

export CC=/usr/bin/cc

It does look like there is a problem with scrambled environments.  The 
redefinition warning looks potentially troublesome; and the error looks 
like a conflict between two versions of the standard C library.

 From man swab on Solaris:

NAME
  swab - swap bytes

SYNOPSIS
  #include stdlib.h

  void swab(const char *src, char *dest, ssize_t nbytes);

   XPG4, SUS, SUSv2, SUSv3
  #include unistd.h

  void swab(const void *restrict  src,  void  *restrict  dest,
  ssize_t nbytes);

I think you want the second version, consistently, but something is also 
hitting the first version.

Maybe XPG4 or one of the other 4 options needs to be defined when each 
library is compiled with /usr/bin/cc?  I think the stdlib declaration is 
old; the unistd version is more modern.

That's all very vague, I know.  Obviously, I don't actually know how to 
solve the problem.

Eric



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


Re: [Matplotlib-users] Confused about rgb_to_hsv and hsv_to_rgb

2015-05-23 Thread Eric Firing
On 2015/05/22 9:33 AM, Matteo Niccoli wrote:
 The second method suggested by titusjan replaces value in hsv space with
 intensity as suggested. Eric you will notce I did include  the line
 img_array = plt.get_cmap('cubehelix')(data_n) and yet the colormapping is
 not working.

I don't understand your conclusion that the colormapping is not working. 
  I don't see anything wrong with any of these plots.  The two 
algorithms appear to be doing exactly what they are supposed to do.

Eric

--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Confused about rgb_to_hsv and hsv_to_rgb

2015-05-21 Thread Eric Firing
On 2015/05/21 5:50 AM, Matteo Niccoli wrote:
 I posted a question on stackoverflow about creating with making my own
 shading effect (I want to use horizontal gradient for the shading).
 http://stackoverflow.com/questions/30310002/issue-creating-map-shading-in-matplotlib-imshow-by-setting-opacity-to-data-gradi


 Unfortunately I cannot share the data because I am using it for a
 manuscripts, but my notebook with full code listing and plots, here:
 http://nbviewer.ipython.org/urls/dl.dropbox.com/s/2pfhla9rn66lsbv/surface_shading.ipynb/%3Fdl%3D0

 The shading using gradient is implemented in two ways as suggested in the
 answer. What I do not understand is why the last plot comes out with a
 rainbow-like colors, when I did specify cubehelix as colormap.

 hsv = cl.rgb_to_hsv(img_array[:, :, :3])
 hsv[:, :, 2] = tdx_n
 rgb = cl.hsv_to_rgb(hsv)
 plt.imshow(rgb[4:-3,4:-3], cmap='cubehelix')
 plt.show()


 Am I doing something wrong or is this unexpected behavior; is there a
 workaround?

Colormapping occurs only when you give imshow a 2-D array of numbers to 
be mapped; when you feed it a 3-D array of RGB values, it simply shows 
those colors.  For colormapping to occur, it must be done on a 2-D array 
as a step leading up to the generation of your img_array.

Eric


 Thanks
 Matteo



--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Confused about rgb_to_hsv and hsv_to_rgb

2015-05-21 Thread Eric Firing
On 2015/05/21 11:28 AM, Matteo Niccoli wrote:
 OK, I understand.


 Could you suggest a way to reduce that 3D array to a 2D array and plot it
 with a specific colormap, while preserving the shading?

It looks like you will get what you want by following the titusjan's 
advice in his reply.  If you are not seeing a shaded version of 
cubehelix, then the only thing I can imagine is that you inadvertently 
omitted the second line in his example:

  img_array = plt.get_cmap('cubehelix')(data_n)

This is doing the colormapping at the start, generating the 3D array 
that you modify to apply your shading algorithm.

Eric


--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [matplotlib-devel] Easy problem working with dev library

2015-05-16 Thread Eric Firing
On 2015/05/16 3:20 PM, Paul Hobson wrote:

 On Saturday, May 16, 2015 at 14:58, Neil Girdhar mistersh...@gmail.com
 mailto:mistersh...@gmail.com, wrote:

 Thanks, and if I want to revert my system to its old matplotlib?

 ​
 ​
 ​Assuming you cloned the repo from git, just checkout any revision you want.

But you have to rerun the pip install -e . or setup.py develop so 
that the extension code will be rebuilt if there were any extension code 
changes between revisions.

 ​
 If didn't clone from git, just reinstall matplotlib anyway you want.

It's not as simple as that, unfortunately, because different 
installation methods put things in different places.  For example, if 
you are on linux, the package manager will install the /usr tree while 
setup etc will install in the /usr/local tree.

The usual advice for getting around such problems is to use a fresh 
virtualenv (or conda environment if you are using Anaconda) for your 
development.  Alternatively you can use a user install to a location of 
your choice and then add that to your PYTHONPATH when you want to work 
in development mode, and remove it when you want to run with whatever 
python environment you had before.

Eric





 ​-Paul.




 On Sat, May 16, 2015 at 5:52 PM, Paul Hobson pmhob...@gmail.com
 mailto:pmhob...@gmail.com wrote:

 After you've setup your development environment with all of the
 MPL dependencies, navigate to the MPL source directory and
 install it with:

 $ python setup.py develop

 or

 $ pip install -e .

 That'll create a link in site-packages (or whatever that
 directory is) to the source directory. After you make changes to
 the source code, you'll either need to use the imp module to
 reload MPL and the submodule you changed. I typically find it
 easier to just restart my python interpreter.
 -Paul

 On Sat, May 16, 2015 at 1:45 PM, Neil Girdhar
 mistersh...@gmail.com mailto:mistersh...@gmail.com wrote:

 How do I set it up so that I can import my local matplotlib
 dev copy?

 I tried making a sym-link to matplotlib/lib/matplotlib, but
 it's giving me errors:

  import matplotlib.transforms as mtransforms
 AttributeError: 'module' object has no attribute 'transforms'

 Thanks,

 Neil

 
 --
 One dashboard for servers and applications across
 Physical-Virtual-Cloud
 Widest out-of-the-box monitoring support with 50+ applications
 Performance metrics, stats and reports that give you
 Actionable Insights
 Deep dive visibility with transaction tracing using APM Insight.
 http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
 ___
 Matplotlib-devel mailing list
 matplotlib-de...@lists.sourceforge.net
 mailto:matplotlib-de...@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-devel





 --
 One dashboard for servers and applications across Physical-Virtual-Cloud
 Widest out-of-the-box monitoring support with 50+ applications
 Performance metrics, stats and reports that give you Actionable Insights
 Deep dive visibility with transaction tracing using APM Insight.
 http://ad.doubleclick.net/ddm/clk/290420510;117567292;y



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



--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Good line plot color cycle for colorblind readers?

2015-05-15 Thread Eric Firing
On 2015/05/15 11:41 AM, Nathan Goldbaum wrote:
 Hi all,

 This is a bit of a case of lazy mailing list, but I'm hoping there might
 be some experts here who can point me in the right direction.

 Does anyone know of a good resource to pull a color cycle for line plots
 that are good for color-blind readers?  I'm currently writing a paper
 that includes a number of plots that include multiple line plots in the
 same axes, and it would be nice if I'm not alienating a significant
 fraction of my readers with a poor color choice.

You might want to cycle line types and/or thicknesses along with colors. 
  You could also check out the seaborn line color palettes.

http://stanford.edu/~mwaskom/software/seaborn/

Eric


 Thanks very much for your help!

 -Nathan


 --
 One dashboard for servers and applications across Physical-Virtual-Cloud
 Widest out-of-the-box monitoring support with 50+ applications
 Performance metrics, stats and reports that give you Actionable Insights
 Deep dive visibility with transaction tracing using APM Insight.
 http://ad.doubleclick.net/ddm/clk/290420510;117567292;y



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



--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Visulization of orthogonal grid

2015-05-06 Thread Eric Firing
On 2015/05/05 6:03 PM, GoogleWind wrote:
 Dear all,

 Matplotlib currently support the visuliaztion of triangular mesh and
 square-cell map. Is there any solutions to support the visulization of
 orthogonal grid as follows,
 http://matplotlib.1069221.n5.nabble.com/file/n45473/%E6%8D%95%E8%8E%B7.png

Does pcolormesh do what you need?
http://matplotlib.org/examples/pylab_examples/quadmesh_demo.html
http://matplotlib.org/api/pyplot_api.html?highlight=pcolormesh#matplotlib.pyplot.pcolormesh

Eric


 Thanks in advances for your hints.

 Best regards,
 Jiacong Huang
 ---
 Nanjing Institute of Geography  Limnology
 Chinese Academy of Sciences
 73 East Beijing Road, Nanjing 210008, China
 Tel./Fax: +86-25-86882127
 Homepage: http://www.escience.cn/people/elake/index.html




 --
 View this message in context: 
 http://matplotlib.1069221.n5.nabble.com/Visulization-of-orthogonal-grid-tp45473.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.

 --
 One dashboard for servers and applications across Physical-Virtual-Cloud
 Widest out-of-the-box monitoring support with 50+ applications
 Performance metrics, stats and reports that give you Actionable Insights
 Deep dive visibility with transaction tracing using APM Insight.
 http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] I need to force the rounding of x axis limits

2015-04-12 Thread Eric Firing
On 2015/04/05 11:19 PM, giacomo boffi wrote:
 INTRO
 =

 please consider the following code (I'm trying to draw a timeline)

 1 from matplotlib import pyplot, patches
 2 fig = pyplot.figure()
 3 ax = fig.add_subplot('111')
 4 ax.add_patch(patches.Rectangle((1933,0.25), 73, 0.5))
 5 pyplot.show()

 that gives me a plot with the x axis that goes from 0.0 to 1.0,
 now consider

...
 5 ax.set_xlim((1933,1933+73))
 6 pyplot.show()

 this gives me an x axis that goes _exactly_ from 1933 to 2006,
 eventually drawing a line superposed to the lower spine

...
 5 ax.plot((1933,1933+73),(0,0))
 6 pyplot.show()

 gives me what I really want, that is an x axis running from 1930 to
 2010, with the limits automatically rounded by matplotlib...

 (I noted that the extra line forces a rounding also for the y axis
 limits, but that's not a problem...)

 QUESTION
 

 I want matplotlib to round the limits of the x axis automatically,
 when given explicitly the lower and upper limits of the data, how to?

I think the initial problem is that ax.add_patch() is not triggering the 
autoscaling that you are looking for; the higher-level plot() function 
does so.  After your call to ax.add_patch(), try adding 
ax.autoscale_view().

Eric



 Thank you in advance



--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] sharex with one figure aspect = 1.0

2015-04-08 Thread Eric Firing
On 2015/04/08 11:15 AM, Jody Klymak wrote:
 Hi Eric,

 import matplotlib.pyplot as plt
 fig, axes = plt.subplots(nrows=2,sharex=True)
 axes[0].set_aspect(1.)
 axes[0].plot(np.arange(10),np.arange(10))
 axes[0].set_ylim([0,24])
 axes[0].set_xlim([0,12])
 axes[1].plot(np.arange(10),np.arange(10)*2.)
 plt.show()

 does not work as I'd expect.  axes[0]'s ylim gets changed so that the
 line is no longer viewable (= 10-14).  In my opinion, the two calls
 should work the same, except in the second case, axes[1]'s xlim
 should be 0-12.


 If you leave out the set_ylim call, it works.  Given that you have
 specified set_ylim[0, 24], how is mpl supposed to know what ylim range
 you really want, when the axis constraint means it can only plot a
 small part of the specified range?

 It doesn't for me:

 import matplotlib.pyplot as plt
 fig, axes = plt.subplots(nrows=2,sharex=True)
 axes[0].set_aspect(1.)
 axes[0].plot(np.arange(10),np.arange(10))
 axes[1].plot(np.arange(10),np.arange(10)*2.)
 plt.show()

 still curtails the y limit in axes[0], in my case from ~2.9 to ~6.1 (see
 attached).

Jody, you told it you want x to go from 0 to 12, and have an aspect 
ratio of 1.  It is doing exactly that.  Are you expecting it to override 
your xlim specification?


 Basically, you have set up conflicting constraints, and mpl failed
 to resolve the conflict the way you think it should have.  Maybe that
 could be improved, but I warn you, it's a tricky business.  Squeeze in
 one place and things pop out somewhere else.

 I'm not clear what the conflicting constraints are.  There seems to be
 an unspoken one that sharex=True means the physical size of the axes
 must be the same. That constraint doesn't exist if sharex=False, and
 set_aspect() works as expected.  I'm questioning the unspoken
 constraint, and questioning why set_aspect() (or looking at the code
 apply_aspect()) needs to know about shared axes at all.  No doubt there
 is a use case I'm missing...

Yes, sharex=True means the x-axis is identical.  It's shared.  That's 
just what it means, and what it has always meant.  That's what it is 
for--to lock together the x axes of two or more Axes.


 I *can* see the issue if we think setting aspect ratios should *not*
 change the size of the axes, because changing the aspect ratio changes
 the data limits and then you have a problem checking all the shared axes
 to see which one has the largest data limits.  Its particularly
 problematic because I think that apply_aspect() is only called at
 draw()-time.  That seems a hard problem, but I'm not sure what the use
 case is for it, so I have trouble wrapping my head around it.

The use case for what--calling apply_aspect at draw time?  That's the 
only time it knows everything it needs to know in the general case, when 
there might be pan/zoom/reshape events.

Eric


 Thanks,   Jody

 --
 Jody Klymak
 http://web.uvic.ca/~jklymak/







 --
 BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
 Develop your own process in accordance with the BPMN 2 standard
 Learn Process modeling best practices with Bonita BPM through live exercises
 http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
 source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF



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



--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] sharex with one figure aspect = 1.0

2015-04-08 Thread Eric Firing
On 2015/04/08 7:04 AM, Jody Klymak wrote:
 Following up on this, I’d like to complain about set_aspect()…

 If I do:

 import matplotlib.pyplot as plt
 fig, axes = plt.subplots(nrows=2,sharex=True)
 axes[0].set_ylim(0,1.)
 axes[0].set_aspect(1.)
 plt.show()

 the x-axis goes from 0. to 1., but axes[0]’s y-axis goes from 0.32 to
 0.67.  Swapping the order of the y_lim call doesn’t help.  This is very
 un-intuitive, as I’d expect set_ylim() to set what data I see no matter
 what else is happening w/ the plot.

 I see that
 axes[0].set_aspect(1.,adjustable=‘box-forced’)
 will give the desired behaviour, but I really think it should be the
 default, not adjustable=‘datalim'.  I had no idea set_aspect() had this
 parameter until today, and have had several cursing matches with
 set_aspect as it kept changing my explicitly set data limits. set_ylim()
 should set the y limits.

 Just my opinion.  Maybe there is a reason for the default, but I really
 think the data view should be prioritized over the shape of the axis.

Jody,

I'm the guilty party for most of how set_aspect works.  I developed it a 
long time ago. Yes, there was a reason--still is, I'm 99% sure--but I 
don't remember everything, and don't want to take the time now to 
reconstruct the whole rationale.  When I was developing the behavior, I 
was paying a lot of attention to what happens under various scenarios of 
resizing and reshaping the window, and turning options on and off. 
There are some basic conflicts that arise when shared axes are combined 
with fixed aspect ratios, autoscaling, and gui-driven reshaping. 
Sometimes 'box-forced' does what people want, maybe more often than not; 
but I'm pretty sure it can lead to trouble, which is the reason it is 
not the default.

Eric


 Thanks,   Jody



--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] sharex with one figure aspect = 1.0

2015-04-08 Thread Eric Firing
On 2015/04/08 7:04 AM, Jody Klymak wrote:
 Maybe there is a reason for the default, but I really think the data
 view should be prioritized over the shape of the axis.

I forgot to include: I was trying to make everything sane (and 
reversible) under zoom and pan as well as reshaping and resizing.

--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] sharex with one figure aspect = 1.0

2015-04-08 Thread Eric Firing
On 2015/04/08 8:43 AM, Jody Klymak wrote:
 Hi Eric,

 On 8 Apr 2015, at  11:02 AM, Eric Firing efir...@hawaii.edu wrote:

 I'm the guilty party for most of how set_aspect works.  I developed it a
 long time ago. Yes, there was a reason--still is, I'm 99% sure--but I
 don't remember everything, and don't want to take the time now to
 reconstruct the whole rationale.  When I was developing the behavior, I
 was paying a lot of attention to what happens under various scenarios of
 resizing and reshaping the window, and turning options on and off.
 There are some basic conflicts that arise when shared axes are combined
 with fixed aspect ratios, autoscaling, and gui-driven reshaping.
 Sometimes 'box-forced' does what people want, maybe more often than not;
 but I'm pretty sure it can lead to trouble, which is the reason it is
 not the default.

 OK, first my apologies:

 import matplotlib.pyplot as plt
 fig, axes = plt.subplots(nrows=2)
 axes[0].set_aspect(1.)
 axes[0].plot(np.arange(10),np.arange(10))
 axes[0].set_ylim([0,24])
 axes[0].set_xlim([0,12])
 axes[1].plot(np.arange(10),np.arange(10)*2.)
 plt.show()

 Works as I'd expect.  axes[0] gets shrunk in the x dimension to make the 
 aspect ratio 1.

 However:

 import matplotlib.pyplot as plt
 fig, axes = plt.subplots(nrows=2,sharex=True)
 axes[0].set_aspect(1.)
 axes[0].plot(np.arange(10),np.arange(10))
 axes[0].set_ylim([0,24])
 axes[0].set_xlim([0,12])
 axes[1].plot(np.arange(10),np.arange(10)*2.)
 plt.show()

 does not work as I'd expect.  axes[0]'s ylim gets changed so that the line is 
 no longer viewable (= 10-14).  In my opinion, the two calls should work the 
 same, except in the second case, axes[1]'s xlim should be 0-12.


If you leave out the set_ylim call, it works.  Given that you have 
specified set_ylim[0, 24], how is mpl supposed to know what ylim range 
you really want, when the axis constraint means it can only plot a small 
part of the specified range?  Basically, you have set up conflicting 
constraints, and mpl failed to resolve the conflict the way you think it 
should have.  Maybe that could be improved, but I warn you, it's a 
tricky business.  Squeeze in one place and things pop out somewhere else.

Eric

 Even worse, if I use the same aspect ratio in axes[1], they *both* do not 
 show all the data:

 axes[0].set_aspect(1.)

 It appears here that with sharex=True the shape of the axis no longer becomes 
 mutable when set_aspect() is used, whereas if sharex=False set_aspect() can 
 change the axis shape. I don't see any reason for sharex to foist this 
 behaviour onto set_aspect().

 I guess the workaround is don't use sharex=True, but I actually think this is 
 a bug.

 Thanks,   Jody

 --
 Jody Klymak
 http://web.uvic.ca/~jklymak/







--
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15utm_medium=emailutm_campaign=VA_SF
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Wind barb plot for a single station data

2015-03-25 Thread Eric Firing
On 2015/03/25 7:08 AM, Foehn wrote:
 Hello all,

 the routine barbs(x,y,u,v) in basemap plots a regular 2-dimensional
 vector field for a geographic projection.

 What I want is a barb-routine that plots single station wind data (and
 not fields!) at their approriate lat,lon or x,y-position like in a
 station plot on a synoptic weather-chart. I googled and searched a
 while, but I could not find a solution within basemap for that.

There is no requirement that the arguments be on a grid; x, y, u, and v 
can simply be 1-D arrays with the desired locations and values.

basemap's barbs is a mapping wrapper around matplotlib's Axes.barbs() 
method, so you can use either one depending on whether you want to plot 
on a map projection or on some other x,y coordinates.

Eric


 Can you help me?


 Thanks, Foehn

 --
 Dive into the World of Parallel Programming The Go Parallel Website, sponsored
 by Intel and developed in partnership with Slashdot Media, is your hub for all
 things parallel software development, from weekly thought leadership blogs to
 news, videos, case studies, tutorials and more. Take a look and join the
 conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Plotting style

2015-03-10 Thread Eric Firing
On 2015/03/09 8:14 PM, Marin GILLES wrote:
 Hi,
 As suggested in PR 2702
 https://github.com/matplotlib/matplotlib/pull/2702, I have been trying
 to tell |scatter| to |get_current_color_cycle| for the facecolor. I
 guess I can use |axes.get_color()|to get the current color in the color
 cycle.
 However, I was not able to try this, as when I try to import pyplot I
 get an |ImportError: No module named _path|. It seems to be library
 related, but I’m not quite sure how I can solve this…

It sounds like your installation is broken; _path is an extension module 
compiled from C++, and central to matplotlib's functionality.

In what environment are you working?  Did this failure arise after you 
modified code and then executed python setup.py install or something 
of that sort?

Eric

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Plotting style

2015-03-10 Thread Eric Firing
On 2015/03/09 8:56 PM, Marin GILLES wrote:
 Actually, I just brute loaded mpl for source... I am not really used to it.
 So I guess I'll have to make a virtual env and install mpl in it?

You have to build and install it somewhere, where it will be found when 
you try to import it; whether you use a virtual env is up to you.  I 
managed for years without using virtual envs. Recently I've found them 
quite helpful, but a bit tricky and confusing at times.

Eric

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Plotting style

2015-03-05 Thread Eric Firing
On 2015/03/05 6:11 AM, Marin GILLES wrote:
 Hello everyone,
 After working a bit on the styles, I noticed that some parameters could
 not be modified using an rc or style file (for example, turning off the
 right, left, up or down axis). I kind of saw how to do it using the
 |Axis.spine.set_visible()| method, but it would be better to be able to
 change it in the rc.
 So I was wondering if there would be a way to add rcParameters using a
 method with an external file, or if I would have to change this in the
 mpl source?
 Maybe a method that would add rcParameters on demand…
 Thanks

Marin,

The sort of capability you are describing here is not possible with the 
present architecture.

Eric

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problems with pyplot and cm in Matplotlib ver. 1.4.3

2015-02-21 Thread Eric Firing
On 2015/02/21 5:32 PM, Starfighter wrote:
 Per request my question is being resubmitted here.

 I'm attempting to generate contour and a color map in Matplotlib ver. 1.4.3
 on a MacBook Pro under Mac OS X ver. 10.10.2 in Python 2.7.3 with the
 Anaconda environment.

 A zip file has been attached to this note. Two sub-directories,
 mathplotlib_1.4.3 and mathplotlib_1.1.1rc are included.

 mathplotlib_1.4.3 contains the python script that generates the contour and
 color map plots, jpeg files showing the resultant plots and the input data.

 mathplotlib_1.1.1rc contains the screen snaps (jpeg files) showing the
 correct contour and color map plots generated by the same python script and
 input data under Linux2 using Python 2.7.3 and Matplotlib 1.1.1rc.

 The questions I have include:
 1. What are the differences between Matplotlib vers. 1.1.1rc and 1.4.3?

Well, you just found one of them.  You should be able to find most 
substantial changes in http://matplotlib.org/users/whats_new.html.

 2. What is going on where?

The plt.axis('scaled') call is freezing the xlim and ylim at values 
resulting from a call to nonsingular, which is handling the fact that 
when you call axis(), nothing has been plotted and there is no 
information about what you want the limits to be.  In addition, 'scaled' 
is one of the axis options that turns off autoscaling.  It has always 
been intended to be called *after* plotting with autoscaling on, or 
otherwise setting the xlim and ylim to the desired values.  I don't know 
why it worked for you in 1.1.1rc; I think it was long before this that 
it had the behavior of turning off autoscaling, but I haven't checked.

 3. How can I fix this problem?

Put the plt.axis('scaled') line after your pcolor or plot line.

As a side note, in general pcolormesh will yield the same result as 
pcolor, but *much* faster, so it is recommended in most cases.

Eric


 Please advise.




 mathplotlib_issues.zip
 http://matplotlib.1069221.n5.nabble.com/file/n45004/mathplotlib_issues.zip



 --
 View this message in context: 
 http://matplotlib.1069221.n5.nabble.com/Problems-with-pyplot-and-cm-in-Matplotlib-ver-1-4-3-tp45002p45004.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.

 --
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and Dashboards
 with Interactivity, Sharing, Native Excel Exports, App Integration  more
 Get technology previously reserved for billion-dollar corporations, FREE
 http://pubads.g.doubleclick.net/gampad/clk?id=190641631iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] axes.get_position() inaccurate until after savefig()?

2015-02-18 Thread Eric Firing
On 2015/02/18 7:51 AM, Ryan Nelson wrote:
 I don't have an answer to your question exactly. But I'll just say that
 this does make sense. The aspect-corrected axes (after show) is a subset
 of what you originally asked for, i.e. the bottom is higher, and the
 height is smaller. My guess is that this is not calculated until the
 final rendering on save on some computational effort. Otherwise, these
 values might need to be recalculated every time you add e.g. a colorbar.
 There is certainly a way to trick the plot into rendering, but I
 wonder if you could post a small (maybe two axes) version that
 demonstrates the effect your trying to accomplish. Perhaps someone might
 have a simpler/more robust solution.

There is an Axes method called apply_aspect() that is called by the 
Axes.draw() method.  Normally there is no need to call it before that, 
but I think you could do so.

I think the problem, though, is that until the figure is rendered to a 
real device or saved in a file, its dimensions in inches are not known, 
and apply_aspect needs that information.

Try including the figsize_inches kwarg when you make the figure, and 
then see if calling apply_aspect makes the position settle down to its 
final value.

Eric


 Ryan

 On Wed, Feb 18, 2015 at 4:27 AM, gdm jgabor.as...@gmail.com
 mailto:jgabor.as...@gmail.com wrote:

 New matplotlib user here.  Sometimes I like to make figures with
 multiple
 axes, and have lines that cross multiple axes.  I've run in to
 problems with
 coordinates when doing this.  One such problem is that
 axes.get_position()
 seems to return incorrect coordinates for an axes with a fixed
 aspect ratio.
 However, after calling pyplot.show()  (or fig.savefig()), it returns the
 correct coordinates.

 Here is some example code:
 #
 import numpy
 import matplotlib.pyplot as plt

 # make up some data
 x = numpy.arange(10)
 y = numpy.sin(x)
 y2 = numpy.cos(x)

 # generate the figure
 fig = plt.figure()

 # setup the first axes
 ax1 = fig.add_subplot(121)
 plt.plot(x,y)

 # setup the second axes with axis ratio
 ax2 = fig.add_subplot(122, aspect=6)
 plt.plot(x, y2)

 # Print out the axes position after various operations
 print aaa, ax2.get_position()

 plt.draw()
 print bbb, ax2.get_position()

 fig.canvas.draw()
 print ccc, ax2.get_position()

 plt.show(block=False)
 print yyy, ax2.get_position()
 ##

 Running this code produces the following output:
 aaa Bbox('array([[ 0.54772727,  0.1   ],\n   [ 0.9   ,  0.9
 ]])')
 bbb Bbox('array([[ 0.54772727,  0.1   ],\n   [ 0.9   ,  0.9
 ]])')
 ccc Bbox('array([[ 0.54772727,  0.1   ],\n   [ 0.9   ,  0.9
 ]])')
 yyy Bbox('array([[ 0.54772727,  0.18686869],\n   [ 0.9   ,
 0.81313131]])')

 P.S.: I think this might be related to an issue noted here:
 
 http://stackoverflow.com/questions/11900654/get-position-does-strange-things-when-using-a-colorbar





 --
 View this message in context:
 
 http://matplotlib.1069221.n5.nabble.com/axes-get-position-inaccurate-until-after-savefig-tp44954.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.

 
 --
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and Dashboards
 with Interactivity, Sharing, Native Excel Exports, App Integration 
 more
 Get technology previously reserved for billion-dollar corporations, FREE
 
 http://pubads.g.doubleclick.net/gampad/clk?id=190641631iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 mailto:Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




 --
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and Dashboards
 with Interactivity, Sharing, Native Excel Exports, App Integration  more
 Get technology previously reserved for billion-dollar corporations, FREE
 http://pubads.g.doubleclick.net/gampad/clk?id=190641631iu=/4140/ostg.clktrk



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



--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel 

Re: [Matplotlib-users] quiverkey() doesn't plot the reference vector?

2015-02-18 Thread Eric Firing
On 2015/02/18 9:52 AM, njs wrote:
 Hi All,

 I'm having issues with quiver, and quiverkey() although, I have never
 experienced these issues in the past.  I attached an image to this post that
 demonstrates that quiver_key() used to work for me, this image was generated
 on 17-Jul-2014.  However, if I run this exact same code (see below for the
 code), the quiver key reference on the top right does not get plotted, but
 the text will.  I haven't changed anything, but I think there have been some
 package updates between then and now.  For what it's worth, I've tried many
 different ways to generate the quiverkey() and haven't had any luck.  Has
 anyone else experienced similar issues?

That's alarming!  I can reproduce the problem even with the standard mpl 
example--the arrow is missing in 5 out of the 6 plots.  I will file a 
github issue.  Thanks for the report.

Eric


 Thanks for any insights!

 Working quiverkey():
 http://matplotlib.1069221.n5.nabble.com/file/n44968/qkey.png

 quiverkey() doesn't work anymore...:
 http://matplotlib.1069221.n5.nabble.com/file/n44968/qkey_1.png

 Code:

  fig = plt.figure(figsize=(12,12))
  map = Basemap(projection = 'cyl', llcrnrlat = -30, urcrnrlat = 90, \
  llcrnrlon = 0, urcrnrlon = 360, resolution = 'c')
  [x,y] = N.meshgrid(lons,lats)
  [x,y] = map(x,y)
  [xulr,yulr] = N.meshgrid(lons1,lats1)
  [xulr,yulr] = map(xulr,yulr)
  clevs = N.arange(-50,51,5)
  cs = map.contourf(x,y,hgt500aComp[lag,:,:],cmap='RdBu_r',
  levels = clevs)
  cs1 = map.contour(x,y,hgt500Comp[lag,:,:],N.arange(1110,1230,6), \
  colors='purple',linewidth=100,linestyle = 'dashed')
  cs1 = map.contour(x,y,hgt500aComp[lag,:,:],levels = clevs,
  colors = 'black')

 colors=[(244,2,255),(36,26,232),(255,255,255),(8,232,61),(224,255,0)]
  cmap = mF.make_cmap(colors, position=None, bit=True)
  clevs = N.arange(-30,30.025,.025)
  cs2 = map.contourf(xulr,yulr,olrComp[lag,:,:],cmap=cmap,
  levels = clevs)
  Q = map.quiver(x[::2,::2],y[::2,::2],u850Comp[lag,::2,::2],
  v850Comp[lag,::2,::2],width = 0.002,scale = 50)
  map.drawcoastlines(linewidth = 1)
  map.drawcountries(linewidth = 0.5)
  map.fillcontinents(zorder = 0)
  map.drawmeridians(N.arange(0,360,30))
  map.drawparallels(N.arange(-90,90,30))
  title = plt.title('Lag: {0} | Transition Cases | n =
 {1}'.format(lag-30,len(cases)))
  title.set_fontweight('bold')
  axt = fig.add_axes([.15,.35,.3,.01])
  cbar = plt.colorbar(cs,cax = axt,orientation = 'horizontal')
  cbar.set_label('500-hPa Anomaly (m)')
  cbar.set_ticks(N.arange(-50,51,25))
  cs1.clabel(fmt = '%d')
  axt = fig.add_axes([.58,.35,.3,.01])
  cbar2 = plt.colorbar(cs2,cax = axt,orientation = 'horizontal')
  cbar2.set_label(r'OLR Anomaly ($W m^{-2}$)')
  cbar2.set_ticks(N.arange(-30,31,10))
  qk = plt.quiverkey(Q,0.95,1.05,1.0,r'1 $m s^{-1}$',labelpos='E')



 --
 View this message in context: 
 http://matplotlib.1069221.n5.nabble.com/quiverkey-doesn-t-plot-the-reference-vector-tp44968.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.

 --
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and Dashboards
 with Interactivity, Sharing, Native Excel Exports, App Integration  more
 Get technology previously reserved for billion-dollar corporations, FREE
 http://pubads.g.doubleclick.net/gampad/clk?id=190641631iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] what are the new features of nbagg?

2015-02-18 Thread Eric Firing
On 2015/02/18 2:31 PM, Thomas Caswell wrote:
 Recent means IPython  2.4.

Did you mean 2.2?  It works on 2.3.

Eric


 For 3.0

 %matplotlib notebook

   will also work.

 Tom

 On Wed Feb 18 2015 at 7:25:41 PM Eric Firing efir...@hawaii.edu
 mailto:efir...@hawaii.edu wrote:

 On 2015/02/18 6:44 AM, Emilia Petrisor wrote:
   Hi all,
  
   I looked for a link where I could find out what’s new in |matplotlib
   1.4.3|, but there is no one.
  
   Especially I’m interested in the new features of |nbagg backend|.
 All I
   know is what I read in an email here, namely that /The nbagg
 backend is
   looking great - some pretty swish new features/.
   Thanks,
  
   Emilia
  

 In a recent IPython, try starting up a notebook and using

 %matplotlib nbagg

 You will find that the embedded plot is fully interactive, complete with
 a cursor readout and navigation buttons.  I think that's the new part.

 Eric



 
 --__--__--
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and Dashboards
 with Interactivity, Sharing, Native Excel Exports, App Integration 
 more
 Get technology previously reserved for billion-dollar corporations, FREE
 
 http://pubads.g.doubleclick.__net/gampad/clk?id=190641631__iu=/4140/ostg.clktrk
 
 http://pubads.g.doubleclick.net/gampad/clk?id=190641631iu=/4140/ostg.clktrk
 _
 Matplotlib-users mailing list
 Matplotlib-users@lists.__sourceforge.net
 mailto:Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/__lists/listinfo/matplotlib-__users
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] quiverkey() doesn't plot the reference vector?

2015-02-18 Thread Eric Firing
On 2015/02/18 2:00 PM, Thomas Caswell wrote:
 Is this just on master or with 1.4.x?

It's on 1.4.1 and 1.4.2, but not on 1.4.3 or master or 1.4.0.  Therefore 
I won't enter it as an issue.

I don't know what went wrong with this in those two bugfix releases.

Eric


 On Wed Feb 18 2015 at 6:00:26 PM Eric Firing efir...@hawaii.edu
 mailto:efir...@hawaii.edu wrote:

 On 2015/02/18 9:52 AM, njs wrote:
   Hi All,
  
   I'm having issues with quiver, and quiverkey() although, I have never
   experienced these issues in the past.  I attached an image to
 this post that
   demonstrates that quiver_key() used to work for me, this image
 was generated
   on 17-Jul-2014.  However, if I run this exact same code (see
 below for the
   code), the quiver key reference on the top right does not get
 plotted, but
   the text will.  I haven't changed anything, but I think there
 have been some
   package updates between then and now.  For what it's worth, I've
 tried many
   different ways to generate the quiverkey() and haven't had any
 luck.  Has
   anyone else experienced similar issues?

 That's alarming!  I can reproduce the problem even with the standard mpl
 example--the arrow is missing in 5 out of the 6 plots.  I will file a
 github issue.  Thanks for the report.

 Eric

  
   Thanks for any insights!
  
   Working quiverkey():
   http://matplotlib.1069221.n5.__nabble.com/file/n44968/qkey.__png
 http://matplotlib.1069221.n5.nabble.com/file/n44968/qkey.png
  
   quiverkey() doesn't work anymore...:
  
 http://matplotlib.1069221.n5.__nabble.com/file/n44968/qkey_1.__png
 http://matplotlib.1069221.n5.nabble.com/file/n44968/qkey_1.png
  
   Code:
  
fig = plt.figure(figsize=(12,12))
map = Basemap(projection = 'cyl', llcrnrlat = -30,
 urcrnrlat = 90, \
llcrnrlon = 0, urcrnrlon = 360, resolution =
 'c')
[x,y] = N.meshgrid(lons,lats)
[x,y] = map(x,y)
[xulr,yulr] = N.meshgrid(lons1,lats1)
[xulr,yulr] = map(xulr,yulr)
clevs = N.arange(-50,51,5)
cs = map.contourf(x,y,hgt500aComp[__lag,:,:],cmap='RdBu_r',
levels = clevs)
cs1 =
 map.contour(x,y,hgt500Comp[__lag,:,:],N.arange(1110,1230,6)__, \
  
 colors='purple',linewidth=100,__linestyle = 'dashed')
cs1 = map.contour(x,y,hgt500aComp[__lag,:,:],levels = clevs,
colors = 'black')
  
  
 colors=[(244,2,255),(36,26,__232),(255,255,255),(8,232,61),__(224,255,0)]
cmap = mF.make_cmap(colors, position=None, bit=True)
clevs = N.arange(-30,30.025,.025)
cs2 = map.contourf(xulr,yulr,__olrComp[lag,:,:],cmap=cmap,
levels = clevs)
Q =
 map.quiver(x[::2,::2],y[::2,::__2],u850Comp[lag,::2,::2],
v850Comp[lag,::2,::2],width = 0.002,scale = 50)
map.drawcoastlines(linewidth = 1)
map.drawcountries(linewidth = 0.5)
map.fillcontinents(zorder = 0)
map.drawmeridians(N.arange(0,__360,30))
map.drawparallels(N.arange(-__90,90,30))
title = plt.title('Lag: {0} | Transition Cases | n =
   {1}'.format(lag-30,len(cases))__)
title.set_fontweight('bold')
axt = fig.add_axes([.15,.35,.3,.01])
cbar = plt.colorbar(cs,cax = axt,orientation = 'horizontal')
cbar.set_label('500-hPa Anomaly (m)')
cbar.set_ticks(N.arange(-50,__51,25))
cs1.clabel(fmt = '%d')
axt = fig.add_axes([.58,.35,.3,.01])
cbar2 = plt.colorbar(cs2,cax = axt,orientation =
 'horizontal')
cbar2.set_label(r'OLR Anomaly ($W m^{-2}$)')
cbar2.set_ticks(N.arange(-30,__31,10))
qk = plt.quiverkey(Q,0.95,1.05,1.0,__r'1 $m
 s^{-1}$',labelpos='E')
  
  
  
   --
   View this message in context:
 
 http://matplotlib.1069221.n5.__nabble.com/quiverkey-doesn-t-__plot-the-reference-vector-__tp44968.html
 
 http://matplotlib.1069221.n5.nabble.com/quiverkey-doesn-t-plot-the-reference-vector-tp44968.html
   Sent from the matplotlib - users mailing list archive at Nabble.com.
  
  
 
 --__--__--
   Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
   from Actuate! Instantly Supercharge Your Business Reports and
 Dashboards
   with Interactivity, Sharing, Native Excel Exports, App
 Integration  more
   Get technology previously reserved for billion-dollar
 corporations, FREE
  
 
 http

Re: [Matplotlib-users] what are the new features of nbagg?

2015-02-18 Thread Eric Firing
On 2015/02/18 6:44 AM, Emilia Petrisor wrote:
 Hi all,

 I looked for a link where I could find out what’s new in |matplotlib
 1.4.3|, but there is no one.

 Especially I’m interested in the new features of |nbagg backend|. All I
 know is what I read in an email here, namely that /The nbagg backend is
 looking great - some pretty swish new features/.
 Thanks,

 Emilia


In a recent IPython, try starting up a notebook and using

%matplotlib nbagg

You will find that the embedded plot is fully interactive, complete with 
a cursor readout and navigation buttons.  I think that's the new part.

Eric



--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Trouble getting colormap set_under and set_over to work with PolyCollection

2015-02-17 Thread Eric Firing
On 2015/02/17 12:24 PM, Luke Lee wrote:
 It's been suggested to on the above tracker to use imshow.  However, that
 doesn't address the issue I'm having using PolyCollection.

I don't think this has anything to do with PolyCollection versus Image, 
and I was not suggesting that you use imshow.  What I am suggesting is 
that you take my example and make the minimal changes required to 
convert it back to using your PolyCollection; or go the other way. I 
think the key point is the call to the colorbar method.

Eric

--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] MultipleLocator and MaxNLocator

2015-02-14 Thread Eric Firing
On 2015/02/14 7:33 AM, Tommy Carstensen wrote:
 Thanks again Ryan. That's exactly what I want to achieve; i.e. remove
 the tick at 0 and only keep 5 and 10. Your solution works, but it's a
 bit of hack to use magic constants. I could however get those values
 from the xlim.

 Eric, I would describe the desired tick placement algorithm as
 removing the first tick on the axis. It can be achieved like this:
 ax1.xaxis.set_major_locator(MaxNLocator(prune='lower'))

Aha! The problem is that the MaxNLocator is the only one with the prune 
kwarg.  It could be added to the MultipleLocator.  For now, though, you 
can make your own specialized Locator, hardwired to omit the first tick, 
like this:

from matplotlib.ticker import MultipleLocator

class TrimmedMultipleLocator(MultipleLocator):
 def tick_values(self, vmin, vmax):
 return MultipleLocator.tick_values(self, vmin, vmax)[1:]

then just use

ax1.xaxis.set_major_locator(TrimmedMultipleLocator(5))

I haven't tested it--but give it a try.  What it is doing is making a 
subclass of MultipleLocator, and altering only the one little bit of its 
behavior that you want to modify.  Everything else is automatically 
inherited from the base class, MultipleLocator.

Eric



 But that then overrides this:
 ax1.xaxis.set_major_locator(MultipleLocator(5))

 On Sat, Feb 14, 2015 at 5:27 PM, Ryan Nelson rnelsonc...@gmail.com wrote:
 Tommy, (Sorry for the doubleup. I just realized I forgot to hit reply-all.)

 Do you want to remove the tick at 0 and only have 5,10, etc.? Could you just
 do something like this instead:

 import matplotlib.pyplot as plt
 from matplotlib.ticker import MultipleLocator
 fig = plt.figure()
 ax1 = fig.add_subplot(111)
 ax1.set_xticks(range(5,11,5))
 ax1.plot(range(11))
 plt.show()

 Ryan


 On Sat, Feb 14, 2015 at 10:47 AM, Tommy Carstensen
 tommy.carsten...@gmail.com wrote:

 Thanks for you answer Eric. I had to get some sleep before trying out
 things. I currently have the code below, but it does not remove the
 zero value tick. It removes the tick at 5 and 10 however.

 import matplotlib.pyplot as plt
 from matplotlib.ticker import MultipleLocator
 fig = plt.figure()
 ax1 = fig.add_subplot(111)
 ax1.xaxis.set_major_locator(MultipleLocator(5))
 xticks = ax1.xaxis.get_major_ticks()
 #xticks[0].label1.set_visible(False)
 #xticks[-1].label1.set_visible(False)
 ax1.set_xticks(ax1.get_xticks()[1:-1])
 ax1.plot(list(range(11)))
 plt.show()

 On Sat, Feb 14, 2015 at 2:01 AM, Eric Firing efir...@hawaii.edu wrote:
 On 2015/02/13 3:29 PM, Tommy Carstensen wrote:
 Is it possible to combine MultipleLocator and MaxNLocator? One seems
 to erase the effect of the other.

 They are for different situations.  MultipleLocator is for when you know
 what you want your tick interval to be; MaxNLocator is for when you
 don't know that, but you do know roughly how many ticks you want, and
 what sort of numerical intervals are acceptable.

 Eric



 --
 Dive into the World of Parallel Programming. The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is
 your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take
 a
 look and join the conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


 --
 Dive into the World of Parallel Programming. The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is
 your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



 --
 Dive into the World of Parallel Programming. The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
Dive into the World of Parallel Programming. The Go Parallel

Re: [Matplotlib-users] MultipleLocator and MaxNLocator

2015-02-14 Thread Eric Firing
On 2015/02/14 5:47 AM, Tommy Carstensen wrote:
 Thanks for you answer Eric. I had to get some sleep before trying out
 things. I currently have the code below, but it does not remove the
 zero value tick. It removes the tick at 5 and 10 however.

What is the effect you are trying to achieve?  How would you describe 
the desired tick placement algorithm?

Eric


 import matplotlib.pyplot as plt
 from matplotlib.ticker import MultipleLocator
 fig = plt.figure()
 ax1 = fig.add_subplot(111)
 ax1.xaxis.set_major_locator(MultipleLocator(5))
 xticks = ax1.xaxis.get_major_ticks()
 #xticks[0].label1.set_visible(False)
 #xticks[-1].label1.set_visible(False)
 ax1.set_xticks(ax1.get_xticks()[1:-1])
 ax1.plot(list(range(11)))
 plt.show()

 On Sat, Feb 14, 2015 at 2:01 AM, Eric Firing efir...@hawaii.edu wrote:
 On 2015/02/13 3:29 PM, Tommy Carstensen wrote:
 Is it possible to combine MultipleLocator and MaxNLocator? One seems
 to erase the effect of the other.

 They are for different situations.  MultipleLocator is for when you know
 what you want your tick interval to be; MaxNLocator is for when you
 don't know that, but you do know roughly how many ticks you want, and
 what sort of numerical intervals are acceptable.

 Eric


 --
 Dive into the World of Parallel Programming. The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] MultipleLocator and MaxNLocator

2015-02-14 Thread Eric Firing

On 2015/02/14 8:45 AM, Tommy Carstensen wrote:

Erik, that doesn't seem to work either. I tried this:

import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator
class TrimmedMultipleLocator(MultipleLocator):
  def tick_values(self, vmin, vmax):
  return MultipleLocator.tick_values(self, vmin, vmax)[2:]
fig = plt.figure()
ax1 = fig.add_subplot(111)
ax1.xaxis.set_major_locator(TrimmedMultipleLocator(5))
#xticks[0].label1.set_visible(False)
#xticks[-1].label1.set_visible(False)
#ax1.set_xticks(ax1.xaxis.get_major_ticks()[1:-1])
ax1.plot(list(range(21)))
plt.show()


Are you sure?  I tried it, and it works for me.  See attached script and 
output.


Eric



test_loc.pdf
Description: Adobe PDF document
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator

class TrimmedMultipleLocator(MultipleLocator):
 def tick_values(self, vmin, vmax):
 return MultipleLocator.tick_values(self, vmin, vmax)[2:]

fig, ax1 = plt.subplots()
ax1.xaxis.set_major_locator(TrimmedMultipleLocator(5))
ax1.plot(list(range(21)))

fig.savefig('test_loc.pdf')
--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] MultipleLocator and MaxNLocator

2015-02-14 Thread Eric Firing
On 2015/02/14 9:15 AM, Tommy Carstensen wrote:
 Eric, it works if I do:
   return MultipleLocator.tick_values(self, vmin, vmax)[2:]

 But not if I do as first suggested by you:
   return MultipleLocator.tick_values(self, vmin, vmax)[1:]


Are you using my test script but getting a different result?  If not, 
what is the difference in your test script?

 I don't understand this behaviour. It should be [1:]. I'll just set
 the ticks manually. Seems to be the easiest thing. It would be
 awesome, if MPL had the same behaviour as gnuplot, which allows me to
 simply do:
 set xtics start, incr

def xtics(ax, start, incr):
 stop = ax.dataLim.x1 + 0.01 * incr
 ax.xaxis.set_ticks(np.arange(start, stop, incr))


Now invoke that function *after* all your plot calls, so that the 
dataLim bounding box includes all the data in your plot.

Eric

--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] MultipleLocator and MaxNLocator

2015-02-13 Thread Eric Firing
On 2015/02/13 3:29 PM, Tommy Carstensen wrote:
 Is it possible to combine MultipleLocator and MaxNLocator? One seems
 to erase the effect of the other.

They are for different situations.  MultipleLocator is for when you know 
what you want your tick interval to be; MaxNLocator is for when you 
don't know that, but you do know roughly how many ticks you want, and 
what sort of numerical intervals are acceptable.

Eric


--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Bug in matplotlib 1.4.2

2015-02-09 Thread Eric Firing
On 2015/02/09 8:19 AM, Thomas Caswell wrote:
 Can you test with 1.4.3rc1?  I believe this has been fixed.

Oops!  Of course--I never use ',', and I was forgetting that it *is* 
just one pixel.

Eric


 On Mon Feb 09 2015 at 1:07:28 PM Alex Böhnert alex.boehn...@gmail.com
 mailto:alex.boehn...@gmail.com wrote:

 Dear all,

 when plotting scattered data with the , marker, the data points do
 not show up either on screen (Qt4Agg backend) or in saved bitmap
 images (tested with png); they do show up if the plot is exported as
 pdf.

 Example code (run in ipython --pylab for simplicity):

 import numpy as np
 a = np.random.standard_normal(500)
 b = np.random.standard_normal(500)
 plot(a,b,',')
 savefig(testplot.png)
 savefig(testplot.pdf)

 Expected result: Scatter plot of random data points, both on screen
 and in saved files.

 Actual result: Empty-looking plot both on screen and in png, but
 plot as expected in pdf.

 System info: Arch linux, Kernel 3.17.6 (and 3.18.6), matplotlib
 version 1.4.2, Python 3.4.2, IPython 2.3.1., numpy version 1.9.1,
 Qt4Agg backend.

 Related: I posted this to the arch-bugtracker
 (https://bugs.archlinux.org/task/43392) and asked on stack overflow
 whether anyone else saw this
 
 (http://stackoverflow.com/questions/28112916/python-matplotlib-does-not-display-data-points-bug-or-something-else).
 Apparently, the same thing happens in Ubuntu, too.

 Hope this is the right place to report this.

 Cheers,
 Alex

 P.S.: I sent the same mail to the list a few weeks ago without
 registering, but it was never posted, nor replied to. It might be a
 good idea not to suggest at
 http://matplotlib.org/faq/troubleshooting_faq.html#getting-help that
 just sending a mail to the list will achieve anything...
 
 --__--__--
 Dive into the World of Parallel Programming. The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media,
 is your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more.
 Take a
 look and join the conversation now.
 http://goparallel.sourceforge.__net/
 
 http://goparallel.sourceforge.net/_
 Matplotlib-users mailing list
 Matplotlib-users@lists.__sourceforge.net
 mailto:Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/__lists/listinfo/matplotlib-__users
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



 --
 Dive into the World of Parallel Programming. The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net/



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



--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Bug in matplotlib 1.4.2

2015-02-09 Thread Eric Firing
On 2015/02/09 8:19 AM, Thomas Caswell wrote:
 Can you test with 1.4.3rc1?  I believe this has been fixed.

I don't think so.  I can reproduce it on master.  Regardless of the ms 
kwarg, I see only a pixel.

Eric


 On Mon Feb 09 2015 at 1:07:28 PM Alex Böhnert alex.boehn...@gmail.com
 mailto:alex.boehn...@gmail.com wrote:

 Dear all,

 when plotting scattered data with the , marker, the data points do
 not show up either on screen (Qt4Agg backend) or in saved bitmap
 images (tested with png); they do show up if the plot is exported as
 pdf.

 Example code (run in ipython --pylab for simplicity):

 import numpy as np
 a = np.random.standard_normal(500)
 b = np.random.standard_normal(500)
 plot(a,b,',')
 savefig(testplot.png)
 savefig(testplot.pdf)

 Expected result: Scatter plot of random data points, both on screen
 and in saved files.

 Actual result: Empty-looking plot both on screen and in png, but
 plot as expected in pdf.

 System info: Arch linux, Kernel 3.17.6 (and 3.18.6), matplotlib
 version 1.4.2, Python 3.4.2, IPython 2.3.1., numpy version 1.9.1,
 Qt4Agg backend.

 Related: I posted this to the arch-bugtracker
 (https://bugs.archlinux.org/task/43392) and asked on stack overflow
 whether anyone else saw this
 
 (http://stackoverflow.com/questions/28112916/python-matplotlib-does-not-display-data-points-bug-or-something-else).
 Apparently, the same thing happens in Ubuntu, too.

 Hope this is the right place to report this.

 Cheers,
 Alex

 P.S.: I sent the same mail to the list a few weeks ago without
 registering, but it was never posted, nor replied to. It might be a
 good idea not to suggest at
 http://matplotlib.org/faq/troubleshooting_faq.html#getting-help that
 just sending a mail to the list will achieve anything...
 
 --__--__--
 Dive into the World of Parallel Programming. The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media,
 is your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more.
 Take a
 look and join the conversation now.
 http://goparallel.sourceforge.__net/
 
 http://goparallel.sourceforge.net/_
 Matplotlib-users mailing list
 Matplotlib-users@lists.__sourceforge.net
 mailto:Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/__lists/listinfo/matplotlib-__users
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



 --
 Dive into the World of Parallel Programming. The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net/



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



--
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Plotting maps with matplotlib-basemap very slow

2015-01-24 Thread Eric Firing
On 2015/01/24 6:11 AM, Sappy85 wrote:
 I would like to draw very, very simple maps of only europe in matplotlib /
 basemap, which takes very much time (around 10 seconds!). This is just
 unreal!? Setting of resolution is only l (low).
 I need to plot hundreds of those maps every few hours. This would be
 impossible!!? :(

 Here is the very simple code:

 import matplotlib
 matplotlib.use('Agg')
 import matplotlib.pyplot as plt
 from mpl_toolkits.basemap import Basemap

 m = Basemap(projection='stere',lon_0=5,lat_0=90.0,rsphere=6371200.,\

 llcrnrlon=-25.0,urcrnrlon=72.0,llcrnrlat=26.0,urcrnrlat=65.0,resolution='l')


You can save a lot of time by pickling the Basemap instance at this 
point, saving it to a cache.  Then the next time, just pickle.load it 
from the cache.

Eric

 m.drawcoastlines(linewidth=0.2)
 m.drawcountries(linewidth=0.2)
 plt.savefig('/var/www/map.png')


 Hope you can help! :(

 Regards





 --
 View this message in context: 
 http://matplotlib.1069221.n5.nabble.com/Plotting-maps-with-matplotlib-basemap-very-slow-tp44755.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.

 --
 New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
 GigeNET is offering a free month of service with a new server in Ashburn.
 Choose from 2 high performing configs, both with 100TB of bandwidth.
 Higher redundancy.Lower latency.Increased capacity.Completely compliant.
 http://p.sf.net/sfu/gigenet
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib power spectral density (PSD) value discrepancy

2014-12-17 Thread Eric Firing
On 2014/12/17, 5:37 AM, Thomas Caswell wrote:
 What version of mpl are you using? These functions got a lot of work
 between 1.3 and 1.4.

Tom,

Sorry, I answered only in his parallel github issue. 
https://github.com/matplotlib/matplotlib/issues/3927.  I'm closing it 
now.  The upshot is that psd returns the power but plots it in db.

Eric


 I also suspects that there is a normalization issue going on with power
 vs power density.

 Tom

 On Tue, Dec 16, 2014, 22:28 xkryptor xkryp...@gmail.com
 mailto:xkryp...@gmail.com wrote:

 Hi all,

   I tried calculating the power spectral density using matplotlib
 mlab function psd (). I plotted using two methods:

   1. At first I plot it directly using plt.psd (red line in plot)
   2. Then I output the values from psd() to variables and plotting the
  variables (blue line in plot)

 The code I used:

 power, freqs = plt.psd(P * 10, len(P), Fs = 1 / dt, scale_by_freq=0)
 plt.psd(P * 10, len(P), 1 / dt, scale_by_freq=0)
 plt.plot(freqs, power)

 But the plots are different, I expected it to be coincident. From
 where does the discrepancy arise?

 Inline image 1
 
 --__--__--
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and Dashboards
 with Interactivity, Sharing, Native Excel Exports, App Integration 
 more
 Get technology previously reserved for billion-dollar corporations, FREE
 
 http://pubads.g.doubleclick.__net/gampad/clk?id=164703151__iu=/4140/ostg.clktrk
 
 http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk_
 Matplotlib-users mailing list
 Matplotlib-users@lists.__sourceforge.net
 mailto:Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/__lists/listinfo/matplotlib-__users
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



 --
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and Dashboards
 with Interactivity, Sharing, Native Excel Exports, App Integration  more
 Get technology previously reserved for billion-dollar corporations, FREE
 http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk



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



--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] how to prevent colorbar from taking space from axes

2014-12-12 Thread Eric Firing
On 2014/12/12, 5:11 AM, Slavin, Jonathan wrote:
 Hi Ben,

 Thanks for those tips.  I ended up giving a list of axes to the ax
 argument of colorbar as you suggested.  That took care of the
 misalignment of the top plots and bottom plots but then the colorbar
 extended the full vertical height of both rows of axes.  Fiddling with
 the shrink and anchor parameter values then got me what I wanted.  I'm
 sure that axis_grid1 could work as well, but my situation is
 sufficiently complicated that I don't want to spend the time fiddling
 with it at this point.

For the record, another way to handle this situation is to use subplot 
parameters to leave adequate room on the right, then use the 
Axes.add_axes() method to make an Axes for the colorbar, and provide it 
as a cax kwarg.

Eric


 Regards,
 Jon

 On Thu, Dec 11, 2014 at 2:30 PM, Benjamin Root ben.r...@ou.edu
 mailto:ben.r...@ou.edu wrote:

 If you have matplotlib v1.3 (maybe 1.2, I can't remember), you can
 pass a list of axes to the ax argument of colorbar, and it should
 steal space equally from all the specified axes.

 I am also particularly fond of using the mpl_toolkit axis_grid1,
 which provides you a nice way to preallocate space for colorbars in
 different ways:
 
 http://matplotlib.org/mpl_toolkits/axes_grid/users/overview.html?highlight=axes_grid1#axes-grid1

 I hope that helps!
 Ben Root


 On Thu, Dec 11, 2014 at 1:49 PM, Slavin, Jonathan
 jsla...@cfa.harvard.edu mailto:jsla...@cfa.harvard.edu wrote:

 Hi,

 I'm trying to make a plot with four panes (2x2).  The two on top
 are images, created with pcolormesh, while the ones on the
 bottom are line plots.  I'd like to the axes to line up -- which
 they do -- but when I add a colorbar to the top right, it steals
 space from the image plot.  I only need one colorbar since the
 two images are forced to have the same scaling.  Can anyone tell
 me how to insert the colorbar on the top right without it taking
 space from the top right image -- or force the space to be taken
 from the horizontal space of all the plots so the shapes are
 uniform?  I've tried several approaches including using
 make_axes_locatable from mpl_toolkits.axes_grid1 with no
 success.  I must admit that I don't really understand what
 make_axes_locatable does, so it may be entirely the wrong thing
 to use.  On the other hand, not using it, i.e. just using
 plt.colorbar or fig.colorbar seems to do essentially the same
 thing, steal space from the axes.  The basics of the plot are
 like this:

 x = np.arange(20.)
 xc = (x[:-1] + x[1:])/2.
 y = np.arange(15.)
 xx,yy = np.meshgrid(x,y)
 z1 = np.random.randn(14,19)
 z2 = np.random.randn(14,19)

 fig,ax = plt.subplots(2,2)
 pc = ax[0,0].pcolormesh(x,y,z1)
 ax[1,0].plot(xc,z1[0,:])
 ax[0,1].pcolormesh(x,y,z2)
 ax[1,1].plot(xc,z2[0,:])
 cb = plt.colorbar(pc, ax=ax[0,1])
 plt.show()

 Any help would be appreciated.

 Regards,
 Jon
 --
 
 Jonathan D. Slavin Harvard-Smithsonian CfA
 jsla...@cfa.harvard.edu mailto:jsla...@cfa.harvard.edu
 60 Garden Street, MS 83
 phone: (617) 496-7981 tel:%28617%29%20496-7981
 Cambridge, MA 02138-1516
 fax: (617) 496-7577 tel:%28617%29%20496-7577USA
 


 
 --
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and
 Dashboards
 with Interactivity, Sharing, Native Excel Exports, App
 Integration  more
 Get technology previously reserved for billion-dollar
 corporations, FREE
 
 http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 mailto:Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



 --
 
 Jonathan D. Slavin Harvard-Smithsonian CfA
 jsla...@cfa.harvard.edu mailto:jsla...@cfa.harvard.edu   60 Garden
 Street, MS 83
 phone: (617) 496-7981   Cambridge, MA 02138-1516
 fax: (617) 496-7577USA
 



 --
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 

Re: [Matplotlib-users] multiple plots on single axis

2014-11-27 Thread Eric Firing
On 2014/11/27, 4:55 AM, Bala subramanian wrote:
 Friends,

 I want to make multiple graphs on a single axes. As an example, i am
 pasting below an article where it has been shown.

 http://www.ncbi.nlm.nih.gov/pubmed/23403925

 My plot of interest is *Figure7B*, where multiple distribution are
 depicted in single plot. I want to make a similar one. Kindly give me
 some insights on how i can make it with mpl, if anyone have achieved
 making it with mpl.

Fig 7b is just a set of curves with sequential offsets in x, right?  A 
LineCollection can be nice for this.  See the last panel in 
http://matplotlib.org/examples/api/collections_demo.html.

Eric


 Thanks in advance,
 Bala


 --
 C. Balasubramanian



--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How to plot other than rectangular grid?

2014-11-21 Thread Eric Firing
On 2014/11/20, 7:11 PM, Maria Liukis wrote:
 Hello,

 I have a problem plotting data which is defined on a grid other than
 rectangular mesh, and would greatly appreciate any advise. My data is
 defined for 0.1degree grid for the state of California, and I don’t
 want to interpolate my data outside of the defined grid when plotting
 it. I used pcolormesh() function for rectangular area maps, but it
 only accepts rectangular grid and I was wondering if there is a
 simple solution to my problem.

Masha,

When you say your data is defined for a 0.1 degree grid, that makes it 
sound like it is on a quadrilateral grid, so there should be no problem 
with using pcolormesh.  Is it on 0.1 degree lon by 0.1 degree lat 
points, but only for points within California?  Then you can make a 
masked array with this grid for a rectangle in which the points outside 
California are masked, and the ones inside are set to your data values. 
  Your X and Y inputs to pcolormesh should be 2-D arrays with the 
boundary values rather than the centers.  It sounds like you would want 
to do all this via mpl_toolkits.basemap.Basemap so that you will end up 
with a properly proportioned and labeled map.

Maybe I am misinterpreting your description of your data, however.

Eric


 The only solution I could find was to use
 scipy.interpolate,griddata() to “map” my grid to a bounding
 rectangular grid (bounding rectangle around CA state), but that would
 also interpolate my data to grid cells outside of CA state, which I
 don’t want to do.

 Many thanks for any hints! Masha -- liu...@usc.edu




 --
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and Dashboards
 with Interactivity, Sharing, Native Excel Exports, App Integration  more
 Get technology previously reserved for billion-dollar corporations, FREE
 http://pubads.g.doubleclick.net/gampad/clk?id=157005751iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Single color transparent colormap

2014-11-20 Thread Eric Firing
On 2014/11/19, 1:03 PM, Benjamin Root wrote:
 What you are seeing is the fact that the adjacent cells share the same
 coordinates, so neighboring cells overlap by one pixel. This is only
 visible when alpha != 1. This is a tricky issue to solve, but I could
 have sworn we made some progress on that front by setting snap to
 False somewhere. There have been past discussions about it, for sure...

I don't think we ever made any progress; it seems like a problem with 
the renderer itself, agg in this case, and one that differs from one 
renderer to another (e.g., if the plot is saved as pdf and then rendered 
by different libraries).  Try turning off antialiasing.

Eric


 Ben Root

 On Wed, Nov 19, 2014 at 12:57 PM, Loïc Estève loic.est...@inria.fr
 mailto:loic.est...@inria.fr wrote:

 Thanks for the suggestions, I have tried the easiest one for now,
 namely pcolormesh, see attached plot. The alpha colormap look great
 but I can't seem to figure out how to prevent the edges of the cells
 from being visible. I tried using edgecolors='none' to no avail. I
 guess retrospectively that is similar to the lines we see in the
 colormap on the right.

 The snippet I am using:

 import numpy as np

 import matplotlib.pyplot as plt
 from matplotlib.colors import LinearSegmentedColormap

 import matplotlib

 matplotlib.rcParams['figure.__facecolor'] = 'white'

 cm_dict = {'red':  ((0.0, 1.0, 1.0),
  (1.0, 1.0, 1.0)),
 'green': ((0.0, 0.0, 0.0),
   (1.0, 0.0, 0.0)),
 'blue':  ((0.0, 0.0, 0.0),
   (1.0, 0.0, 0.0)),
 'alpha': ((0.0, 0.0, 0.0),
   (1.0, 1.0, 1.0))
}

 my_cm = LinearSegmentedColormap('my___cm', cm_dict)

 vals = np.tile(np.linspace(-1, 1, 30), (20, 1))

 fig = plt.figure()
 ax = plt.pcolormesh(vals, cmap=my_cm)
 plt.colorbar()
 plt.show()

 Cheers,
 Loïc




 --
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and Dashboards
 with Interactivity, Sharing, Native Excel Exports, App Integration  more
 Get technology previously reserved for billion-dollar corporations, FREE
 http://pubads.g.doubleclick.net/gampad/clk?id=157005751iu=/4140/ostg.clktrk



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



--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [matplotlib-devel] Development issue: Assign labels to colorbar extensions

2014-11-16 Thread Eric Firing
On 2014/11/16, 10:21 AM, j1 wrote:
 I have posted this in the user sub forum as well because i'm not sure that it
 is a user issue or development issue.
 Information about my problem and my code are here

 http://matplotlib.1069221.n5.nabble.com/Assign-labels-to-colorbar-extensions-user-or-development-issue-td44392.html
 http://matplotlib.1069221.n5.nabble.com/Assign-labels-to-colorbar-extensions-user-or-development-issue-td44392.html

 Is it possible to assign tick labels/values to extensions?

You would have to do it manually; you can put marks and text anywhere 
you want in a matplotlib figure, but there is no mechanism for adding 
ticks to the extensions.  That's simply not what they are for.  They are 
intended only to indicate a single color to which values outside the 
vmin-to-vmax range of the norm are assigned.


 If so, how can I do it

It looks like you might be able to achieve what you want *without* using 
extensions, by using a custom colormap and/or norm.  You would extend 
the actual contour levels to include the full range you want ticked and 
labeled, but you would use the colormap and/or norm to ensure those 
beyond a given range are mapped to the appropriate end color(s).

Eric



--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problem extending a custom colormap

2014-11-03 Thread Eric Firing
On 2014/11/03, 2:19 PM, Damien Irving wrote:
 I often like to define my own colormaps using hex strings, e.g.
 hex_list = ['#FFF295', '#FFD555', '#FF850B', '#D55000', '#D5',
 '#550040','#600080', '#80', '#D5', '#0B85FF', '#55AAFF', '#95CAFF']

 However, when I pass them to contourf and try to extend the colorbar...
 plt.contourf(x, y, data, colors=hex_list, extend='both')

 ... it always ends up that the color of the final segment on the
 extended ends of the colorbar is the same color as the extension segment
 (i.e. the bit in the little arrow). This happens even when hex_list is
 much longer than the actual number of segments required.

You need to use the levels kwarg to specify the contour interval 
boundaries, and then your list of colors needs to have a length equal to 
len(levels) + 1.  In other words, the number of colors listed in the 
colors kwarg needs to be *exactly* the number needed to fill between the 
  specified levels, plus one for each requested extend direction, if any.

plt.contourf(x, y, data, levels=[0, 1, 2],
  colors=['red', 'blue, 'brown', 'black'],
  extend='both')

That should give you blue and brown for 0-1 and 1-2; with red for 
data0, and black for data2.

Eric


 Has anyone else had this problem?



 --



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



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


Re: [Matplotlib-users] twinx cla problem

2014-10-10 Thread Eric Firing
On 2014/10/10, 4:45 AM, Duke, Charles wrote:
 With matplotlib 1.4.0 the cla() method for the twinx axes also clears
 the primary axes.  With matplotlib 1.3.1 the method only clears the
 twinx axes as expected.  I have a much longer program where the twinx
 axes must be cleared while retaining the primary axis plot.  I would
 prefer not to replot the entire graph each time the twinx axes change.
   You can see this by adding the cla method to the matplotlib web site
 example, two_scales.py, shown below.

 I have matplotlib installed via the anaconda package. Matplotlib 1.4.0
 is from anaconda 2.1.0.  Matplotlib 1.3.1 is from 1.9 versions of the
 anaconda package.

 Linux version:

 Linux gamow 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u3 x86_64 GNU/Linux

 Same cla() result on osX 10.9.4.

 Same result for backends Qt4Agg and TkAgg;  the cla() method cleared
 both axes.

 I also tried various other options such as setting ax2.hold(False) prior
 to replotting  ax2.  However, once again ax1 was cleared.  The ax2 clear
 commands seem to apply to the ax1 axis as well???  These options worked
 as expected  for the earlier matplotlib version, clearing only the ax2 axis.

 Here’s the code:  if you execute the code, you should see a blank figure
 with the cla() included and the usual two graphs without the cla() method.

 

 import numpy as np

 import matplotlib.pyplot as plt

 fig, ax1 = plt.subplots()

 t = np.arange(0.01, 10.0, 0.01)

 s1 = np.exp(t)

 ax1.plot(t, s1, 'b-')

 ax1.set_xlabel('time (s)')

 # Make the y-axis label and tick labels match the line color.

 ax1.set_ylabel('exp', color='b')

 for tl in ax1.get_yticklabels():

  tl.set_color('b')

 ax2 = ax1.twinx()

 s2 = np.sin(2*np.pi*t)

 ax2.plot(t, s2, 'r.')

 ax2.set_ylabel('sin', color='r')

 for tl in ax2.get_yticklabels():

  tl.set_color('r')

 # single line addition to the two_scales.py example

 # clears both ax2 and ax1 under matplotlib 1.4.0, clears only ax2 under
 matplotlib 1.3.1

 # obviously, same result with ax2.clear() method

 ax2.cla()

 plt.show()

 I would appreciate any help;  this looks like a bug in the latest
 version of matplotlib.


Charlie,

I agree--it does look like a regression in 1.4.  Would you post it as a 
github issue, please?

Thank you.

Eric


 I could not find any reference to this problem in earlier posts.

 Thanks,

 Charlie



 --
 Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
 Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
 Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
 Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
 http://pubads.g.doubleclick.net/gampad/clk?id=154622311iu=/4140/ostg.clktrk



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



--
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://p.sf.net/sfu/Zoho
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Antialiasing colorbars

2014-09-30 Thread Eric Firing
On 2014/09/30, 2:41 AM, Jesper Larsen wrote:
 Hi matplotlib users,

 Is it possible to disable antialiasing for a colorbar? If not directly
 is it the possible to postprocess the axes instance to se antialiasing
 for relevant elements?

The colorbar returns a Colorbar object, the solids attribute of which 
is a Quadmesh; so you should be able to execute

cbar.solids.set_antialiased(False)

to turn off antialiasing.  With a bit of testing, however, I am not 
seeing any difference, so I'm not sure what is going on, and I don't 
have time now to investigate.

Eric


 The reason I am asking is because I would like to produce a paletted png
 (using PIL) of the colorbar without the risk of removing any important
 colors in the process (in essence the output from matplotlib needs to
 have less than 256 colors for this to work).

 Best regards,
 Jesper


 --
 Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
 Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
 Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
 Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
 http://pubads.g.doubleclick.net/gampad/clk?id=154622311iu=/4140/ostg.clktrk



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



--
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plt.ion() doesn't enable interactive mode when ran as script on mac osx 10.8.5

2014-09-21 Thread Eric Firing
On 2014/09/21, 6:07 AM, Petar Bakalov wrote:
 Using python 2.7.5 and matplotlib 1.4.0 on mac OSX 10.8.5.

 The output of the following snippet:

 |import  matplotlib.pyplotas  plt
 plt.ion()
 print  Is interactive:?,  plt.isinteractive()
 |

 when ran from shell ($ python snippet.py) is:

 Is interactive? : 0

 i.e. interactive mode does not work.

 I think that this is not the expected behaviour. How can this be fixed?

This is under discussion here: 
https://github.com/matplotlib/matplotlib/issues/3505

Eric



 The same code produces

 Is interactive? : 1

 (i.e. works fine) when ran in an interactive python terminal on the same
 machine.

 I installed python using brew and matplotlib using pip.

 Best regards,
 Petar

 12.5.0 Darwin Kernel Version 12.5.0: Sun Sep 29 13:33:47 PDT 2013;
 root:xnu-2050.48.12~1/RELEASE_X86_64 x86_64


 --
 Slashdot TV.  Video for Nerds.  Stuff that Matters.
 http://pubads.g.doubleclick.net/gampad/clk?id=160591471iu=/4140/ostg.clktrk



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



--
Slashdot TV.  Video for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Region within contour -- 2D array

2014-08-28 Thread Eric Firing
On 2014/08/28, 3:02 AM, Matthew Czesarski wrote:
 Hi Matplotlib Users!



 I have some 2-d arrays, which i am displaying  with implot, and deriving
 contours for with contour.  Easy -  I'm just pulling them out of
 collections[0].get_paths() .

 However what's not easy is that I would like to recover a 1-0 or
 True-False array of the array values (pixels) that fall within the
 contours. Some line crossing algorithm/floodfill could do it, but I
 guess that matplotlib's fill() or contourf() must do this under the hood
 anyway. I've looked into the output both functions, but I don't see
 anything obvious..

 Does anybody know if there's an a way to pull out a such an array from
 matplotlib?   Any pointers are appreciated!

Make an array of (x, y) pairs from the X and Y you use in your call to 
contour, and then feed that array to the contains_points() method of 
your contour Path.  This will give you the desired Boolean array for any 
given Path; depending on what you want, you might need to combine arrays 
for more than one Path.

To get closed paths, I think you will want to use contourf, not contour.

Eric




 Cheers,
 Matt


 --
 Slashdot TV.
 Video for Nerds.  Stuff that matters.
 http://tv.slashdot.org/



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



--
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Basic matshow question

2014-07-30 Thread Eric Firing
On 2014/07/30, 7:26 AM, Benjamin Root wrote:
 There is no --pylab for that.

I don't know what development version you are using, but for 2.1.0, it 
is still there--and it does what needs to be done.

--
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Basic matshow question

2014-07-29 Thread Eric Firing
On 2014/07/29, 7:04 PM, JBB wrote:
 Hello,

 I am relatively new to Python, numpy, matplotlib, etc., with a
 reasonable amount of Matlab experience.

 I am trying to do some simple array visualizations before moving on to
 specific work.

 e.g. I have a 5x5x10 array and I'd like to see each 5x5 piece as a
 frame with a short pause in between.  I realize there are animation
 methods and such but I think the  code below ought to work and don't
 understand what I'm getting.

 Expect: A figure window with the first 5x5 piece of the array, a short
 pause, a new figure window overwriting the old one with the second 5x5
 piece, and so on. Equivalent code in Matlab does this.

 Result:  Figure window opens, nothing gets drawn in it, there's a pause,
 the window closes, and another window opens in the same location with
 nothing in it, and so on.

 If I refresh the kernel, create the 3D array, and manually show one
 slice, it works.  As soon as I run the loop, all I get from then on is
 blank windows whether I do it within a loop or type the matshow, show
 commands.

 This happens in iPython with and without the notebook interface.

 I'm trying to understand Matplotlib in some detail and am watching the
 SciPy2014 videos along with RTFM.
 https://www.youtube.com/watch?v=A2adyFMsut0 et.seq.

 So far, I've come up empty in figuring out what I'm doing wrong.

 I have Python 2.7.8/Anaconda 2.0.1

 Thanks,

 JBB
 = Test code

 import numpy as np
 from matplotlib.pylab import *
 import time as time

 # Create a 3D array of frames
 A = np.random.rand(5,5,10)

 #Turn on interactive mode
 ion()
 # Turn off interactive mode
 # ioff()

 # Attempt to show each frame with a short delay between frames
 for k in range(10):
   matshow(A[:,:,k])
   show()
   time.sleep(1)
   close()


First, at least initially for this sort of thing, run in ipython 
--pylab, and don't use any ion() or ioff().

Second, replace the show(); time.sleep(1) with pause(1).

I think that will do it.

Eric


 --
 Infragistics Professional
 Build stunning WinForms apps today!
 Reboot your WinForms applications with our WinForms controls.
 Build a bridge from your legacy apps to the future.
 http://pubads.g.doubleclick.net/gampad/clk?id=153845071iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] ImportError: No module named 'mpl_toolkits'

2014-07-13 Thread Eric Firing
On 2014/07/13, 12:05 AM, Tommy Carstensen wrote:
 To matplotlib-users,

 When I do this on Linux:
 from mpl_toolkits.basemap import Basemap

 Then I get this error:
 ImportError: No module named 'mpl_toolkits'

Sounds like it might be a problem with the particular versions of 
matplotlib and basemap; there was a change in the way we handle 
namespace packages like mpl_toolkits.


 I also ran apt-get, but I still get the error:
 sudo apt-get install python-mpltoolkits.basemap

 What am I doing wrong? I also tried to get it to work on Mac with no luck.

Lots of possibilities, so without looking to see exactly what is on each 
system (Linux and Mac), it is impossible to say what the problem is.

For both systems, one easy solution is to use Anaconda.  Basemap is not 
included in the basic installation, but can be added via conda install 
basemap.  Recommended.

Eric


 Thanks,
 Tommy

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



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


Re: [Matplotlib-users] refresh a matplotlib plot when reruning a script

2014-06-28 Thread Eric Firing
On 2014/06/27, 9:59 AM, zunbeltz wrote:
 I have a script that fetchs data from a database and plot using
 something similar to

 fig, (ax1, ax3) = plt.subplots(2, 1, sharex=False, sharey=False, num=fignum)
 ax1.errorbar(...)
 title(...)
 ax2 = ax1.twiny()
 ax4 = ax2.twiny()
 ...
 plt.legent()
 plt.draw()

 Then, I call this script with plt.ion() and I use plt.show(block=True);
 so the plot stays opened.

 Now, I want to rerun the script every second to get the updated data
 from the database. Is it posible to have the plot no blocking the script
 and being refresh?

You might find that plt.pause(1) is helpful.
See pylab_examples/animation_demo.py.

Also, it sounds like running via ipython, if possible, would make things 
easier for you; it takes care of all sorts of difficulties with 
interactivity.  And it's wonderfully helpful in other ways as well.


 I try to use block=False but this makes that the plot is not shown. I
 want to change my original script as little as possible. One posible
 idea I have is to pickle the plot (in the original script); and use
 another script that opens the pickled file every second.

That sounds overly complex and roundabout.  I'm sure that one or more of 
the suggestions above can lead to a simple solution.

Eric


 TIA

 Zunbeltz
 (posted unsuccessfully at stackoverflow)


 --
 Open source business process management suite built on Java and Eclipse
 Turn processes into business applications with Bonita BPM Community Edition
 Quickly connect people, data, and systems into organized workflows
 Winner of BOSSIE, CODIE, OW2 and Gartner awards
 http://p.sf.net/sfu/Bonitasoft
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How to make diagram x_label by time and x_lable can move automatic

2014-06-21 Thread Eric Firing
On 2014/06/21, 3:39 PM, 不坏阿峰 wrote:
 is there someone can help me ?

Posting a *simple*, self-contained example as a starting point would 
make it more likely that someone would understand your question.  Leave 
out everything that is irrelevant--I suspect all the gui and threading 
code is in that category.

Also, although it is not directly related to your question, please note 
that you are using a horrible mixture of backend invocations, and even 
if it works now, it will do you no good in the long run.

See the embedding examples: no matplotlib.use, no pylab, one and only 
one gui toolkit.

I also suspect the answer to your question is at least partly in one of 
the examples of plotting with dates; dates and times are handled 
together.  Here is one such example:

http://matplotlib.org/examples/pylab_examples/date_demo1.html

Eric

 many thanks


 2014-06-19 19:36 GMT+07:00 不坏阿峰 onlydeb...@gmail.com
 mailto:onlydeb...@gmail.com:

 Dear all

 could some expert can help me.
 I have modify from one demo. but i do not how to change the x_lable
 to time like H:M:S, and can move it.  i have try some way, but failed.

 hope some expert can do me a favor.
 thanks a lot

 ##
 # coding=utf-8
 import os
 import pprint
 import random, time
 import sys
 from PyQt4 import QtGui, QtCore
 from threading import *
 import time
 import datetime

 import matplotlib
 matplotlib.use('WXAgg')
 from matplotlib.figure import Figure
 from matplotlib.backends.backend_qt4agg import \
  FigureCanvasQTAgg as FigCanvas, \
  NavigationToolbar2QT as NavigationToolbar
 import numpy as np
 import pylab
 class DataGen(object):
   A silly class that generates pseudo-random data for
  display in the plot.
  
  def __init__(self, init=50):
  self.data = self.init = init
  def next(self):
  self._recalc_data()
  return self.data
  def _recalc_data(self):
  delta = random.uniform(-0.5, 0.5)
  r = random.random()
  if r  0.9:
  self.data += delta * 15
  elif r  0.8:
  # attraction to the initial value
  delta += (0.5 if self.init  self.data else -0.5)
  self.data += delta
  else:
  self.data += delta

 class myThing():
  class myThread(Thread):
  def __init__(self):
  Thread.__init__(self)
  self.running = True
  self.vec = [0]
  self.dg = DataGen()

  print Initializing myThread...

  def run(self):
  print Running myThread...
  while self.running:
  time.sleep(1)
  self.vec.append(self.dg.next())
  print Splat
  def getVec(self):
  return self.vec
  def stop(self):
  self.running = False
  def __init__(self):
  self.theThread = self.myThread()
  self.threadRunning = True
  print initializing myThing...
  self.theThread.start()
  def __del__(self):
  self.theThread.stop()
  def getVec(self):
  #print self.theThread.vec[:]
  return self.theThread.vec[:]
 class ApplicationWindow(QtGui.QMainWindow):
   The main window of the application
  
  def __init__(self):
  QtGui.QMainWindow.__init__(self)
  self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
  self.setWindowTitle('Demo: dynamic matplotlib graph')
  self.thing1 = myThing()
  self.thing2 = myThing()
  self.starttime =  int(time.time())


  self.create_menu()
  #self.create_status_bar()
  self.create_main_panel()
  self.redraw_timer = QtCore.QTimer(self)
  QtCore.QObject.connect(self.redraw_timer,
 QtCore.SIGNAL(timeout()), self.on_redraw_timer)
  self.redraw_timer.start(4000)
  def create_menu(self):
  menu_file = QtGui.QMenu(File, self)
  #menu_file.addAction(u'Save plot', self.on_save_plot,
  # QtCore.Qt.CTRL + QtCore.Qt.Key_S)
  menu_file.addSeparator()
  menu_file.addAction(u'Exit', self.on_exit,
   QtCore.Qt.CTRL + QtCore.Qt.Key_X)
  self.menuBar().addMenu(menu_file)
  def create_main_panel(self):
  self.panel = QtGui.QFrame(self)
  self.setCentralWidget(self.panel)
  self.init_plot()
  self.canvas = FigCanvas(self.fig)
  self.canvas.setMinimumHeight(150)
  #self.toolbar = 

Re: [Matplotlib-users] colors

2014-06-19 Thread Eric Firing
On 2014/06/18, 5:23 AM, Bruno Pace wrote:
 Ok, so using the norm=SymLogNorm I cannot distinguish the values that
 are exactly 0.0 from the really small ones, right? Would it be possible

Correct, the scale is linear for small values.

 to make use of the set_bad method without having to use masked arrays,
 just combining the SymLogNorm and the set_bad?

No, the mask is what identifies a point as bad.  If you want to 
distinguish zero from non-zero, no matter how small, then this is the 
way to do it.

zm = np.ma.masked_equal(z, 0, copy=False)

Now you have a masked array where the points that are exactly zero are 
masked.

The bad color won't show up on the colorbar, however.  There is no 
suitable place for it.  It can show only the range from vmin to vmax, 
and a set_over color for values greater than vmax, and a set_under 
color for values less than vmin.

Eric

--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing  Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Adding a colorbar --- how?

2014-06-15 Thread Eric Firing
On 2014/06/15, 12:17 PM, Virgil Stokes wrote:
 There are some rather nice and useful matplotlib examples for colormaps
 that are shown at:

 http://nbviewer.ipython.org/github/dpsanders/matplotlib-examples/blob/master/colorline.ipynb

 In*Example 1.  Sine wave colored by time (uses the defaults for
 colorline)*, how can one add a colorbar?

lc = colorline(x, y)
cbar = fig.colorbar(lc)

Eric




 --V


 --
 HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
 Find What Matters Most in Your Big Data with HPCC Systems
 Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
 Leverages Graph Analysis for Fast Processing  Easy Data Exploration
 http://p.sf.net/sfu/hpccsystems



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



--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing  Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Matplotlib brewer2mpl issue with plotting

2014-06-12 Thread Eric Firing
On 2014/06/12, 1:01 AM, Rachana Katkam wrote:
 Hi all,

 I am stuck with plotting that uses brewer2mpl.
 The following link describes my problem, please have a look at it:

 http://stackoverflow.com/questions/24181183/matplotlib-brewr2mpl-plotting-issue

The traceback doesn't match the code I find in mpl 1.3.1; I think you 
have hit a bug that has been fixed.  I recommend upgrading.  There have 
been a lot of improvements since 1.0.1.

As a workaround, you could try changing your call to plt.grid(...) to 
start with the positional argument True, so it would be

plt.grid(True, axis='y', color='white', linestyle='-', lw=1)

Eric


 Regards,
 Rachana K



 --
 HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
 Find What Matters Most in Your Big Data with HPCC Systems
 Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
 Leverages Graph Analysis for Fast Processing  Easy Data Exploration
 http://p.sf.net/sfu/hpccsystems



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



--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing  Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Upgrading matplotlib

2014-06-12 Thread Eric Firing
On 2014/06/12, 4:14 AM, Rachana Katkam wrote:
 Hi all,
 I have an issue in upgrading my matplotlib 1.0.1 to 1.3.1
 I am using Fedora, but the command:
 Yum update python-matplotlib is not working.
 My python version is 2.7, is that an issue?
 Is there any way for upgrading matplotlib?

Updating via a linux distro generally won't bring you a new version.

Two options:

1) Install it yourself independently, typically in /usr/local/, 
compiling from source.  This will involve making sure you have some 
build dependencies.  Simply using pip install matplotlib, or something 
very much like that, might work.

2) Get an entire independent python installation such as Anaconda from 
continuum.io.  This provides an easy way of keeping everything up to 
date.  This is what I recommend unless you really want to learn how to 
build and install software yourself, independently of installers like yum.

Eric


 Regards,
 Rachana K


 --
 HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
 Find What Matters Most in Your Big Data with HPCC Systems
 Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
 Leverages Graph Analysis for Fast Processing  Easy Data Exploration
 http://p.sf.net/sfu/hpccsystems



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



--
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing  Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] pick markers only but not the connecting line

2014-06-07 Thread Eric Firing
On 2014/06/07, 4:12 PM, C M wrote:
 I had been using a custom function (written originally by Jae-Joon and
 modified a little by me...quite a long time back now) that was working
 to allow point picking of markers, but *not* the line connecting them.
 However, I've now discovered with the help of this list that the
 function I am using has the disadvantage that if there are more than 100
 data points, I can't get the correct index for the picked marker (turned
 out not to be a mpl bug:
 https://github.com/matplotlib/matplotlib/issues/3124).

 So I can just use the default pick event, but then the user can pick
 anywhere on the connecting line, which is meaningless in this use--so I
 don't want them to be able to pick on the connecting line.

Why not just execute plot twice, once with the markers, with picking 
activated, and a second time with the line, with picking inactive (the 
default).

Eric


 My goal is to have a custom function that will serve *both* purposes:
 allow picking the markers only, not the line, of a set of data of any
 length while returning the correct index of that marker/data point.  But
 the code in the custom function is mostly above my head, was written for
 mpl 0.99 or so, and I don't know how to modify it to get both purposes
 achieved.

 I attach the current sample again, with the problematic custom picker
 function, contains_points().  Thanks for any suggestions or help.

 Che



 --
 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



--
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


Re: [Matplotlib-users] pick markers only but not the connecting line

2014-06-07 Thread Eric Firing
On 2014/06/07, 5:03 PM, C M wrote:



 On Sat, Jun 7, 2014 at 10:18 PM, Eric Firing efir...@hawaii.edu
 mailto:efir...@hawaii.edu wrote:

 On 2014/06/07, 4:12 PM, C M wrote:
   I had been using a custom function (written originally by
 Jae-Joon and
   modified a little by me...quite a long time back now) that was
 working
   to allow point picking of markers, but *not* the line connecting
 them.
   However, I've now discovered with the help of this list that the
   function I am using has the disadvantage that if there are more
 than 100
   data points, I can't get the correct index for the picked marker
 (turned
   out not to be a mpl bug:
   https://github.com/matplotlib/matplotlib/issues/3124).
  
   So I can just use the default pick event, but then the user can pick
   anywhere on the connecting line, which is meaningless in this
 use--so I
   don't want them to be able to pick on the connecting line.

 Why not just execute plot twice, once with the markers, with picking
 activated, and a second time with the line, with picking inactive (the
 default).

 Eric


 That is so simple, and I hadn't thought of it at all.  Thank you!  My
 only concerns would be for slowness of plotting if there are a lot of
 points and just code simplicity, and so if there could be some other way
 with a custom function for the picker that would do this, I would
 probably prefer that. But maybe neither of these are particularly
 important concerns.

I think you will find plotting two lines instead of one is not at all 
prohibitive with respect to speed; especially when you are zooming, so 
that the number of points being plotted is not so large.

As for simplicity, two calls to a standard function with almost the same 
arguments beats an arcane special-purpose function!

If you want to make your own picker, though, it looks like you could use 
a slight modification of Line2D.contains(); it would be just a matter of 
copying it and replacing this section

 # Check for collision
 if self._linestyle in ['None', None]:
 # If no line, return the nearby point(s)
 d = (xt - mouseevent.x) ** 2 + (yt - mouseevent.y) ** 2
 ind, = np.nonzero(np.less_equal(d, pixels ** 2))
 else:
 # If line, return the nearby segment(s)
 ind = segment_hits(mouseevent.x, mouseevent.y, xt, yt, 
pixels)


with the code in the first option--that is, without checking the 
_linestyle.  You would also need to remove the first two lines after the 
docstring.

Eric


 Che





 --
 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



--
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


Re: [Matplotlib-users] Undefined color model and inconsistencies between backends

2014-05-16 Thread Eric Firing
On 2014/05/16 4:41 PM, Michael Goerz wrote:
 Hi,

 While playing around for an afternoon with colors in matplotlib, I came
 across some inconsistencies. I was trying to define colors in sRGB (my
 understanding is that sRGB as a standardized color space is
 device-independent). Giving RGB values to matplotlib, I checked the
 output with a color picker -- Color Maker from the Mac App Store, set
 to the sRGB mode, but the built-in DigitalColor Meter gives the same
 result. It turns out that the colors I see in the output are not what I
 specified. This makes playing around with colors, a bit difficult:
 http://nbviewer.ipython.org/gist/goerz/9aab94f5322d5a457625
 As far as I can tell, Matplotlib does not specify in
 which color model in interprets RGB values (this should ideally be
 stated in the documentation). Also, the output in different backends
 (IPython notebook, and interactive GUI) gave different results. As a
 minimal example, consider the following:

Matplotlib doesn't interpret RGB values; that is left to the display 
device.  Matplotlib simply writes the RGB values in a file, unmodified, 
or sends them via a GUI backend to a display, also unmodified *by mpl*. 
  What you put in, is what it puts out.

Thanks for pointing out the DigitalColor Meter--I hadn't noticed it.

What I see with your example is that the MacOSX backend *display* is 
interpreting RGB as sRGB, and the qt4agg backend *display* is 
interpreting RGB as native values (based on matching with DigitalColor 
Meter).

I haven't tried this with inline plots in the notebook, but mpl is 
merely feeding RGB values to the browser, just as would occur when 
displaying a png, and it is up to the browser to decide how to convert 
them into pixel intensity.

I don't see that there is a bug here.

Eric


  import pylab
  import numpy as np
  import matplotlib
  #%matplotlib inline
  # draw line with sRGB color 228, 26, 28
  pylab.plot(np.linspace(0,10, 10), np.linspace(0,20,10), linewidth=10,
 color=(0.894, 0.102, 0.110))
  pylab.show()
  # Colorpicker shows 210, 46, 13 in GUI view
  # Colorpicker shows 229, 39, 27 in iPython Notebook

 In the IPython notebook, direct PIL graphics do seem to give the right
 colors cf. In [5] in the linked IPython notebook (even though PIL also
 does not explicitly specify its color model). Just matplotlib seems
 off. Of course, I'm doing some slightly crazy stuff in the Notebook,
 displaying every matplotlib output through PIL, but I cecked that
 `%matplotlib inline` actually produces the same colors.

 Should I file this on github as a bug report?

 Best,
 Michael

 P.S.: please CC for direct replies

 --
 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
 Matplotlib-users@lists.sourceforge.net
 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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Re-combine different axes to make new figure in matplotlib

2014-05-12 Thread Eric Firing
On 2014/05/11 7:56 PM, Yuxiang Wang wrote:
 Dear all,

 I am curious that whether this is possible in matplotlib:

 I first create some figures, with subplots.

 import matplotlib.pyplot as plt
 fig1, axs1 = plt.subplots(2, 2)
 fig2, axs2 = plt.subplots(2, 2)

 And then, could I recombine them, so fig3 is composed of the first row
 in fig1 (i.e., axs1[0, 0] and axs1[0, 1]) and second row in fig2
 (i.e., axs2[1, 0] and axs2[1, 1])?

 Currently, all I could do is to re-plot them. I am curious about
 whether there is a way that I can just move axes around and re-combine
 them to make new figures. Thanks!

No, there is no facility for doing this.  The Axes class is always 
initialized with a Figure instance.  The Axes and Figure are quite 
tightly tied together via transforms.

Eric


 -Shawn




--
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] basic pgf test fails

2014-05-07 Thread Eric Firing
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:
 #149; 3 signs your SCM is hindering your productivity
 #149; Requirements for releasing software faster
 #149; Expert tips and advice for migrating your SCM now
 http://p.sf.net/sfu/perforce
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
#149; 3 signs your SCM is hindering your productivity
#149; Requirements for releasing software faster
#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Set sharex and sharey on the axes object

2014-05-07 Thread Eric Firing
On 2014/05/07 2:12 PM, Yuxiang Wang wrote:
 Dear all,

 I was wondering that, is there a method like axes.set_sharex(ax0) so I
 can directly set the sharex and sharey properties of an axes object?
 It seems that the only way to do this is at time of creation via
 fig.add_subplots(1, 2, 2, sharex=ax0). If I have already created the
 axes using the plt.subplots() method, this wouldn't work.

 Could anyone please help make sure that I am understanding this
 question correctly?


This is correct.  If you use plt.subplots with sharex and/or sharey, the 
sharing applies to all subplots.

Eric

 Thank you!

 Shawn


--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
#149; 3 signs your SCM is hindering your productivity
#149; Requirements for releasing software faster
#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Entropy calculation incorrect?

2014-04-25 Thread Eric Firing
Nathan,

Thanks for bringing this up.  It looks like the short-term fix is to 
make the documentation match the code.  Longer term, it seems to me like 
this is the sort of thing that should be deprecated; it doesn't belong 
in matplotlib any more.

Would you open an issue on Github, please?  Even better: submit a pull 
request that fixes the documentation.

Eric

On 2014/04/25 1:26 AM, Nathan Lindop wrote:
 Hello,

 I have been using the matplotlib.mlab.entropy function and have noticed
 that it may be incorrect. I have posted a question on stackoverflow here:
 http://stackoverflow.com/questions/23291576/matplotlib-mlab-entropy-calculation-incorrect

 I thought I would should it on the mailing list too. Does anyone have
 any ideas?

 Thanks,
 Nathan


 --
 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] Composing image from hex tiles using RegularPolyCollection

2014-04-25 Thread Eric Firing
On 2014/04/24 11:40 PM, Tom Grydeland wrote:
 Hi all,

 I will explain what I’m trying to achieve first, then the approaches I’ve 
 attempted so far, with results.

 I have data on a 2D grid which I want to present as an image — a la 
 pyplot.imshow() — except that the grid is hexagonal, not rectangular.  The 
 grid can be represented in multiple ways, I use a regular 2D array with the 
 convention that the lower left hex is (0,0), x increases to the right 
 (crossing vertical hex boundaries) and y increases upwards slanting to the 
 right.


Tom,

Have you considered adapting the code from the Axes.hexbin() method?

Ideally, the hexbin method might be split into two parts, one for the 
calculation and another for the plotting.

Eric

 Ideally, I’d also be able to have a colorbar.

 I’m giving my routines three input vectors: x, y and c.  X and y are 
 initially integers, then transformed to centerpoint coordinates using
   x, y = x+.5*y, y*np.cos(np.pi/6)
 while c is used to look up values in a colormap.

 I first tried to adapt ‘scatter_demo2.py’ to my needs.  Unfortunately, the 
 pyplot.scatter routine fails when given ‘c’ or ’s’ keywords, as has been 
 reported elsewhere by somebody else:
 
 http://stackoverflow.com/questions/20524888/attributeerror-numpy-ndarray-object-has-no-attribute-get-matrix

 I’ve dug around in the code for a bit without finding out how this arises.  
 It seems to me it has to do with how transforms are being handed around and 
 at what point their representation is changed from objects to pure matrices.  
 This backend appears to expect to see objects only, but is handed matrices 
 instead.  I’ve hacked my way around that one in backends/backend_macosx.py by 
 changing lines around 79-80 from
 master_transform = master_transform.get_matrix()
 all_transforms = [t.get_matrix() for t in all_transforms]
 to
 try:
 master_transform = master_transform.get_matrix()
 except AttributeError: pass
 try:
 all_transforms = [t.get_matrix() for t in all_transforms]
 except AttributeError: pass
 (which is a dirty hack, but I don’t know how to do it right)

 Now I can run the scatter_demo2 script, and I can obviously have it produce 
 hexes at uniform size, but the size of the hexagons are set independently of 
 the axes.  Good for symbols used to mark arbitrary coordinates, not so good 
 when I try to cover the plane without gaps.

 Next, I’ve tried creating the patches one by one, essentially this:

 r = 1./np.sqrt(3)
 for xy, cc in zip(zip(x, y), c):
 hexp = mpl.patches.RegularPolygon(xy, 6, radius=r, facecolor=cc, 
 edgecolor=’none')
 ax.add_patch(hexp)
 ax.autoscale_view()
 ax.figure.canvas.draw()

 This works as I want it to, but becomes unbearably slow when the number of 
 hexes grows beyond a few thousand.

 Given that RegularPolygon can do the trick, it seems likely that 
 RegularPolyCollection should also be able to?

 This is what I tried:

 ax = gca()
 collection = RegularPolyCollection(
 6, # a pentagon
 rotation=(np.pi/7,),
 sizes=(.5/np.sqrt(3),),
 facecolors = cc,
 edgecolors = None,
 linewidths = (1,),
 offsets = zip(xx,yy),
 transOffset = ax.transData,
 )
 #collection.set_transform(ax.transData)
 ax.add_collection(collection, autolim=True)

 ax.autoscale_view()
 ax.figure.canvas.draw()

 This produces dots of minute sizes at the desired coordinates.  I can tweak 
 the size to make them bigger, but they don’t scale with the axes, as for the 
 scatter_demo script used initially.  Digging in the docs, I found a reference 
 to the set_transform() method of Artists, so I tried setting that to 
 ax.transData (the line commented out in the above snippet), and voila! I have 
 hexagons covering the plane again.  Strangely enough, they’re not in the 
 right place anymore (and the locations change when zooming in or out), the 
 sizes aren’t _quite_ right, the autoscaling of axes appear to believe the 
 patches are where I wanted them to be, not where they appear on the plot, 
 results are very different if saving to a figure instead of drawing to a 
 figure window, etc.

 Is there a way I can make RegularPolyCollection patches transform with axes 
 coordinates in the same way that RegularPolygon patches do?

 Am I barking up the wrong tree, is there another, blindingly obvious, way I 
 should be doing this?

 The observant reader will also notice the strange rotation keyword given to 
 RegularPolyCollection.  This keyword is ignored in the macosx backend, and I 
 have been unable to find out why.

 Thank you for all tips and pointers

 --Tom Grydeland


 --
 Start Your Social Network Today - Download eXo Platform
 Build your Enterprise Intranet with eXo Platform Software
 Java 

Re: [Matplotlib-users] turning off autoscale

2014-04-23 Thread Eric Firing
On 2014/04/23 11:19 AM, Michael Mossey wrote:
 I'm sorry, these are questions that could be found in the Axes
 documentation, but I really don't feel like scrolling through 100 pages
 that are irrelevant hoping I can find the relevant functions, which I
 don't even know what they are called. Is there ever going to be a
 concise listing of functions? Also there seem to be a lot of

PRs for doc improvements are welcome!

 undocumented functions related to bounding boxes and copying from the
 background--I had to find Stack Overflow examples to learn about those.

Doesn't the search box in the html docs help?  Or just plain browser 
searching when you are looking at the Axes API docs?

I also find that ipython is very helpful, with tab completion and the 
question mark for getting the doc string.  E.g., make an axes object and 
then use tab completion to see the methods that start with auto, and 
follow with a question mark to see the docstring.  Or a double question 
mark to see the code.


 What I want to do is

 (1) plot a couple of lines with y autoscaling and x autoscaling on
 (2) turn off y autoscaling so the y limits do not change further if the
 x limits are changed
 (3) change the x limits

 What axes functions are needed?

try:

ax.autoscale(enable=False, axis='y')

or

ax.set_autoscaley_on(False)

Ugly name for the method, but we're stuck with it.

These differ in that the first one turns y scaling off and then performs 
the autoscaling, while the second only turns y scaling off for any 
subsequent execution of the autoscale_view() method.

Eric


 Note that I'm not using pyplot, rather the API so I'm looking for
 methods of Axes.

 Mike


 --
 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] checking if an artist is in the list of artists for an axes

2014-04-22 Thread Eric Firing
On 2014/04/21 8:30 PM, Michael Mossey wrote:
 How do I check if an artist is in the list of artists attached to an axes?

if a in ax.get_children():
 ...

Eric

 Mike



 --
 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] Spooling up on matplotlib .... run all the examples

2014-04-20 Thread Eric Firing
On 2014/04/17 11:07 AM, Elden Crom wrote:

 matplotlib is impressive in its capabilities, I didn't realize how much so
 until I download from the git, and made a little script to run all of the
 examples.


Thank you.

It's hidden away, but a script to do this type of thing exists.  For a 
long time it was effectively our testing mechanism--run all the examples 
and scan the results to see if they looked right.  It is 
examples/tests/backend_driver.py.

Eric

 I'm way too much of a newbie here to check anything in, but I thought
 someone may find this trinket useful.  As written, it should be in the
 'matplotlib/examples' directory named 'runAll.py', if someone is so inclined
 to check it in.  Feel free to edit or eviscerate it or whatever.

 --
 #!/usr/bin/python
 ###
 ##
 ##  REVISION HISTORY
 ##DateNameSCR#Description
 ##    --
 
 ##  2014-04-17  Elden CromN#A Initial Release
 ###

 import subprocess, os

 ###To make the demos work that needed sample data I had to
 ### 'cp /etc/matplotlibrc ~/.matplotlib/'  and edit the examples.directory
 ###  entry to not have the extra tick marks ie
 ### examples.directory : /usr/share/matplotlib/sampledata
 ### but I think this was because of a version issue

 dirs = [root for root, dir, files in os.walk(.)]
 #dirs = ['./showcase', './widgets']  #to only run a directory or two

 excluded = ['./runAll.py','./tests/backend_driver.py']
 def myfilter(d,f):
  fpth = os.path.join(d,f)
  return (os.path.isfile(fpth) and
  f.endswith('.py') and
  not fpth in excluded)
 pyfiles =[]
 for d in dirs:
  pyfiles.extend([ (d,f) for f in os.listdir(d) if myfilter(d,f) ])

 #there are over 400 examples in the git repository
 #[git clone git://github.com/matplotlib/matplotlib.git]/matplotlib/examples
 #so you might not want to see them all in one setting!
 #pyfiles=pyfiles[100+100:]

 for i,(d,f) in enumerate(pyfiles):
  print Executing 'python %s'--(%d of
 %d)--%(os.path.join(d,f),i,len(pyfiles))
  subprocess.Popen([python, f],cwd=d).wait()







 --
 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


Re: [Matplotlib-users] removing a plot from an axes

2014-04-18 Thread Eric Firing
On 2014/04/18 12:21 PM, Michael Mossey wrote:
 Sorry for what is a beginnerish question but I'm having  a hard time
 using the docs. I want to remove a previous plot from an axes. How do I
 do this?

If you want to clear the axes, call the cla() or clear() method.
If you want to remove an artist such as a line, call its remove() method.


 Incidentally, it makes the docs hard to use that there are so many
 methods on Axes which are spread a great distance over the page. It
 would be nice to have a concise listing of the methods of Axes.

I agree. What is needed is a listing of methods by category instead of 
all together as a single alphabetical list.  In the meantime, you might 
find browsing the User Guide to be of some help.  Also, the Quick 
Search box can help.

Eric


 Note that I'm not using pyplot, but I think the term for what I'm doing
 is using the API. I'm subclassing FigureCanvas in PyQt, creating a
 Figure, and creating an axes using Figure.add_subplot().

 Mike



 --
 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



--
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


Re: [Matplotlib-users] Left-aligned and centered title

2014-03-17 Thread Eric Firing
On 2014/03/17 3:31 AM, Florian M. Wagner wrote:
 Dear users,

 I would like label my subplots with a horizontally left-aligned letter
 (wanted by the journal) and the normal, centered axes title, which
 should both be vertically in line. The following example does not work:

 from matplotlib import pyplot as plt
 import numpy as np

 fig, ax1 = plt.subplots()
 x = np.linspace(1,10)
 y = (sin(x))
 ax1.plot(x,y)

 def subplot_label(ax, letter, title):
  title = ax.set_title(title)
  pos = title.get_position()
  va = title.get_va()
  ax.text(0, pos[1], letter, transform=ax.transAxes,
 verticalalignment=va)

 subplot_label(ax1, 'a)', 'This text is not aligned with the label')


 Which property of the axes title am I missing?

Is the following what you need?

http://matplotlib.org/examples/pylab_examples/titles_demo.html

Eric


 Thank you for your help



--
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/13534_NeoTech
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Troubleshooting

2014-03-12 Thread Eric Firing
On 2014/03/12 2:41 PM, Caio Sanches wrote:
 Hey there!
 I have a mac 10.9 (Mavericks), and I needed matplotlib for a course I was 
 participating.
 I installed python 2.7.6, as requested, and downloaded the installer (dmg) 
 from the sourceforge page.
 I created a simple file, to plot a simple graph, but then it gave me an error 
 (attached as Output.txt).
 I don’t know what to do…
 Please help me.
 Thanks in advance
 -Caio


The file you attached does not show the error, or the code and data you 
used, so we have no idea what the problem might be.

If you are new to python, then I suggest that you install Anaconda 
https://store.continuum.io/cshop/anaconda/ rather than installing python 
packages like matplotlib one by one.

Second, it sounds like you need to do a bit of background reading, and 
perhaps find someone local to help you get started.

Eric


--
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/13534_NeoTech
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Clip or skip lines going over border of canvas

2014-03-07 Thread Eric Firing
On 2014/03/06 10:43 PM, svebert wrote:
 Hi!

 I plot measurment data and connect them with lines (style eg. -*r). Points
 which are outside of the ylimits are still connected with points which are
 inside of the ylimits. Is there any way to tell matplot to only connect two
 points if both are inside the y/x-limits?
 Because now i get weird lines crossing the whole canvas if some points
 spread to much from the mean data.

 Removing points before plotting is not an option because then points are
 connected which are not in consecutive order. Matplotlib should just skip a
 connecting line when one of the two points lies without the canvas/limits.

It sounds like what you need to do is either use a masked array and mask 
out the points that are outside the limits, or use NaNs for that purpose.

Eric


 Is there any simple way/option to do tha?

 Thanks in advance,
 Sven



 --
 View this message in context: 
 http://matplotlib.1069221.n5.nabble.com/Clip-or-skip-lines-going-over-border-of-canvas-tp43015.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.

 --
 Subversion Kills Productivity. Get off Subversion  Make the Move to Perforce.
 With Perforce, you get hassle-free workflows. Merge that actually works.
 Faster operations. Version large binaries.  Built-in WAN optimization and the
 freedom to use Git, Perforce or both. Make the move to Perforce.
 http://pubads.g.doubleclick.net/gampad/clk?id=122218951iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
Subversion Kills Productivity. Get off Subversion  Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Color bar extents

2014-03-06 Thread Eric Firing
On 2014/03/06 4:18 AM, Asma Riyaz wrote:
 Hi,

 I am stuck at setting the color bar minimum and maximum values,
 according to what I found I need to set ticks to a numpy linspace array.
 Here is my code:

 *threshold=1.01

  fig = plt.figure(figsize=(25,25))
  plt.suptitle(file_handle.replace('.csv',''),fontsize=22)
  cmap.set_over('green')
  cmap.set_under('grey')
  gs=gridspec.GridSpec(1, 2,height_ratios=[1,1,-2,2]
 ,width_ratios=[2,1,-2,2],hspace=0,wspace=0)

  phyl_ax=plt.subplot(gs[0])
  ht_ax=plt.subplot(gs[1])

  ht_ax.set_xlim(34,0)
  ht_ax.set_ylim(34,0)


  cb_ax,kw =mpl.colorbar.make_axes(ht_ax, shrink=0.65)

  plt.setp(phyl_ax.get_xticklabels(),visible=False)
  plt.setp(phyl_ax.get_yticklabels(),visible=False)
  plt.setp(ht_ax.get_xticklabels(),visible=True)
  plt.setp(ht_ax.get_yticklabels(),visible=True)
  plt.setp(phyl_ax.get_xticklines(),visible=False)
  plt.setp(phyl_ax.get_yticklines(),visible=False)
  plt.setp(ht_ax.get_xticklines(),visible=True)
  plt.setp(ht_ax.get_yticklines(),visible=True)


  img =
 ht_ax.imshow(data,cmap=cmap,interpolation='none',vmin=-1.0,vmax=threshold,aspect='auto')
  v = np.linspace(-1.0, 1.0, 15, endpoint=True)
  cb =
 mpl.colorbar.ColorbarBase(ax=cb_ax,cmap=cmap,ticks=v,extend='neither',**kw)
  cb.cmap.set_over('green')
  img= mpimg.imread('/home/asmariyaz/Desktop/mytree.png')
  phyl_ax.imshow(img,interpolation='bilinear',aspect='auto')
 *


Why are you using ColorbarBase instead of using fig.colorbar?  By doing 
so, you are not getting the logic that ties the colorbar to the 
color-mapped object to which it applies.

Eric

 The problem that arises is that the color bar's extent always shows up
 from 0 to 1, though I set the ticks from -1 to 1?
 I also noticed that in a dataset where I have a negative value, the
 color bar still shows up as 0 to 1.

 Could anyone guide me? Appreciate your help!!

 Asma








 --
 Subversion Kills Productivity. Get off Subversion  Make the Move to Perforce.
 With Perforce, you get hassle-free workflows. Merge that actually works.
 Faster operations. Version large binaries.  Built-in WAN optimization and the
 freedom to use Git, Perforce or both. Make the move to Perforce.
 http://pubads.g.doubleclick.net/gampad/clk?id=122218951iu=/4140/ostg.clktrk



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



--
Subversion Kills Productivity. Get off Subversion  Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imshow for .png- low resultion

2014-03-05 Thread Eric Firing
On 2014/03/05 11:37 AM, Asma Riyaz wrote:
   Sorry I somehow forgot to paste the imshow call to plot the .png
 image(pasted the entire code again), I am trying the different
 interpolation parameters in the mean time as suggested by Pierre

 data=np.array(full_len)
  cmap = mpl.cm.hot
  if outlier==0:
 threshold=1
  else:
 threshold=outlier-0.01

  fig = plt.figure(figsize=(25,25))
  plt.suptitle(file_handle.replace('.csv',''),fontsize=22)
  cmap.set_over('green')
  cmap.set_under('grey')
  gs=gridspec.GridSpec(1, 2,height_ratios=[1,1,-2,2]
 ,width_ratios=[1,1,-2,2])
  gs.tight_layout(fig,)
  phyl_ax=plt.subplot(gs[0]) ##,frameon=False)##
  ht_ax=plt.subplot(gs[1],sharey=phyl_ax)
  ##gs.tight_layout(fig, rect=[1,1,2,2])
  ht_ax.set_xlim(0,35)
  ht_ax.set_ylim(0,35)
  ##ht_ax.grid(color='white',linestyle='-',linewidth=1)
  ##fig.subplots_adjust(hspace=0)
  cb_ax,kw =mpl.colorbar.make_axes(ht_ax, shrink=0.65)

  plt.setp(phyl_ax.get_xticklabels(),visible=False)
  plt.setp(phyl_ax.get_yticklabels(),visible=False)
  plt.setp(ht_ax.get_xticklabels(),visible=True)
  plt.setp(ht_ax.get_yticklabels(),visible=True)
  plt.setp(phyl_ax.get_xticklines(),visible=False)
  plt.setp(phyl_ax.get_yticklines(),visible=False)
  plt.setp(ht_ax.get_xticklines(),visible=True)
  plt.setp(ht_ax.get_yticklines(),visible=True)


  img = ht_ax.imshow(data, cmap=cmap,
 interpolation='none',vmax=threshold)
  cb = mpl.colorbar.ColorbarBase(ax=cb_ax,cmap=cmap,
 extend='neither',**kw)
  cb.cmap.set_over('green')
  ##image_file =
 cbook.get_sample_data('/home/asmariyaz/Desktop/mytree.png',asfileobj=False)
  ##image = plt.imread(image_file)
  img= mpimg.imread('/home/asmariyaz/Desktop/mytree.png')
  phyl_ax.imshow(img,interpolation='nearest')

 heatmap_file=fig.savefig('/home/asmariyaz/Desktop/heatmap/'+file_handle+'.pdf',bbox_inches='tight')

Try giving savefig a dpi kwarg to increase the resolution with which the 
image is saved in the pdf?  Turn off anti-aliasing when you make the png?

Eric



--
Subversion Kills Productivity. Get off Subversion  Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Issue with relim and autoscale_view in 1.3.1

2014-03-04 Thread Eric Firing
On 2014/03/04 12:56 PM, Stuart Mentzer wrote:
 Hi,

 I'm seeing odd behavior with the relim() and autoscale_view() call
 sequence with matplotlib 1.3.1. In some cases I am ending up with axis
 ranges of [-0.05,0.05] instead of the actual data ranges. This happens
 with scatter plots and sometimes with contour plots.

Why are you trying to use relim() here?  It does not support 
collections, and scatter produces a collection.  It doesn't find any 
Artists that it knows about, so it assumes nothing has been added to the 
plot, and it yields a generic set of limits.

Eric


 The modified version of the scatter_demo2 below displays the problem. I
 think this used to work for scatter plots with earlier versions of
 matplotlib. Is this supposed to work or is there another way to do it
 correctly (other than doing our own limit setting)?

 Thanks,
 Stuart

 
 Demo of scatter plot with varying marker colors and sizes.
 
 import numpy as np
 import matplotlib.pyplot as plt
 import matplotlib.cbook as cbook

 # Load a numpy record array from yahoo csv data with fields date,
 # open, close, volume, adj_close from the mpl-data/example directory.
 # The record array stores python datetime.date as an object array in
 # the date column
 datafile = cbook.get_sample_data('goog.npy')
 price_data = np.load(datafile).view(np.recarray)
 price_data = price_data[-250:] # get the most recent 250 trading days

 delta1 = np.diff(price_data.adj_close)/price_data.adj_close[:-1]

 # Marker size in units of points^2
 volume = (15 * price_data.volume[:-2] / price_data.volume[0])**2
 close = 0.003 * price_data.close[:-2] / 0.003 * price_data.open[:-2]

 fig, ax = plt.subplots()
 ax.scatter(delta1[:-1], delta1[1:], c=close, s=volume, alpha=0.5)

 # These cause ranges to be set incorrectly to [-0.055,0.055] !!
 ax.relim()
 ax.autoscale_view( tight = True )

 ax.set_xlabel(r'$\Delta_i$', fontsize=20)
 ax.set_ylabel(r'$\Delta_{i+1}$', fontsize=20)
 ax.set_title('Volume and percent change')

 ax.grid(True)

 fig.tight_layout()

 plt.show()


 --
 Subversion Kills Productivity. Get off Subversion  Make the Move to Perforce.
 With Perforce, you get hassle-free workflows. Merge that actually works.
 Faster operations. Version large binaries.  Built-in WAN optimization and the
 freedom to use Git, Perforce or both. Make the move to Perforce.
 http://pubads.g.doubleclick.net/gampad/clk?id=122218951iu=/4140/ostg.clktrk



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



--
Subversion Kills Productivity. Get off Subversion  Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] About the scientific ticker format on pylab plot

2014-03-03 Thread Eric Firing
On 2014/03/03 11:40 AM, Ying Liu wrote:
 Hi,

 I want to know how to set the scientific ticker format in pylab. I know
 that I can set it to the form of 1e21, but what I want is something like
 x10^21, as follows:

 Inline image 1 - Inline image 2


 Can anybody tell me how to do this? I searched on this for a long time,
 but still I did not find the answer.

Execute this before plotting:

rcParams['axes.formatter.use_mathtext'] = True

or set it in your matplotlibrc file.

Eric


 Sorry to bother those who are not interested.

 Best regards




--
Subversion Kills Productivity. Get off Subversion  Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How can I put a white area in the middle of colorbar showing the masked data?

2014-03-02 Thread Eric Firing
On 2014/03/02 1:02 AM, ChaoYue wrote:
 Dear Eric,

 This solved part of my problem. thanks a lot.
 I think I will revisit this issue when I have time (not promised).
 do you think this could be some feature desirable?

I don't understand what feature you are referring to; evidently I don't 
understand what the problem is, so I don't know what part remains unsolved.

Eric



 Cheers,

 Chao


 On Sat, Mar 1, 2014 at 10:39 PM, Eric Firing [via matplotlib] [hidden
 email] /user/SendEmail.jtp?type=nodenode=42956i=0 wrote:

 On 2014/03/01 11:03 AM, ChaoYue wrote:
   The most correct way might be to design a new colormap with white
 color
   exactly in the middle, however this is very tedious, especially if I
   want to try
   different colormaps. so the alternative approach would be to set
 the values
   falling in (-1,1) as being masked, so they will be the same as
 the axes
   background color as you mentioned (in our case it's white). My
 question is,
   how can I put this background color (which shows maksed data) in the
   colorbar,
   by avoiding design a new colormap?

 It's not the answer you want to hear, but I think the correct answer is
 that you should do this via the colormap, and not by masking the low
 values.  It doesn't have to be painful.  If, in contourf, you use a
 diverging colormap with white already in the middle
 (http://matplotlib.org/examples/color/colormaps_reference.html) and a
 norm with symmetric limits (vmin and vmax; you can let them be set
 automatically after you specify your symmetric set of contour
 boundaries
 appropriately) then it will be done for you.

 e.g.,

 z = 10 * np.random.randn(20, 30)
 clevs = [-10, -5, -2, -1, 1, 2, 5, 10]
 cs = plt.contourf(z, levels=clevs, cmap=plt.get_cmap('PRGn'),
 extend='both')
 cbar = plt.colorbar(cs, spacing='uniform')

 Eric

 
 --


--
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis  security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How can I put a white area in the middle of colorbar showing the masked data?

2014-03-01 Thread Eric Firing
On 2014/03/01 9:57 AM, Chao YUE wrote:
 Dear all,

 In many cases in geoscience mapping we want to show the some missing values
 as some special color in the colorbar. like attached one.

 I know there is one method in matplotlib colormap called set_bad, official
 docs says:

 Set color to be used for masked values.

 But I don't know how to make this work when I call the colorbar method.

It is not a matter of calling the colorbar method, but of setting up the 
colormap used on the color-mapped plot for which the colorbar is made.

The one wrinkle to this is that if you are using contourf, the masked 
regions are not filled at all, so they take on the color of the 
background.  To give them the color you assigned to the colormap with 
set_bad, you need to assign that same color to the background, e.g.

ax.set_axis_bgcolor(#bdb76b)

On re-reading your message, however, I think you are asking something 
else, but it is not clear to me from your example exactly what you are 
trying to do.

The colorbar is strictly for a range or sequence of colors, which can 
include triangle regions for the over and under values; there is no 
place on the colorbar for a bad or missing value.  Where would you 
put one?  I don't see any such region on the example colorbar you attached.

Eric



 Is there anyone who have the some successful experience?

 Thanks a lot in advance!

 Chao
 --
 ***
 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
 


 --
 Flow-based real-time traffic analytics software. Cisco certified tool.
 Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
 Customize your own dashboards, set traffic alerts and generate reports.
 Network behavioral analysis  security monitoring. All-in-one tool.
 http://pubads.g.doubleclick.net/gampad/clk?id=126839071iu=/4140/ostg.clktrk



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



--
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis  security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How can I put a white area in the middle of colorbar showing the masked data?

2014-03-01 Thread Eric Firing
On 2014/03/01 11:03 AM, ChaoYue wrote:
 The most correct way might be to design a new colormap with white color
 exactly in the middle, however this is very tedious, especially if I
 want to try
 different colormaps. so the alternative approach would be to set the values
 falling in (-1,1) as being masked, so they will be the same as the axes
 background color as you mentioned (in our case it's white). My question is,
 how can I put this background color (which shows maksed data) in the
 colorbar,
 by avoiding design a new colormap?

It's not the answer you want to hear, but I think the correct answer is 
that you should do this via the colormap, and not by masking the low 
values.  It doesn't have to be painful.  If, in contourf, you use a 
diverging colormap with white already in the middle 
(http://matplotlib.org/examples/color/colormaps_reference.html) and a 
norm with symmetric limits (vmin and vmax; you can let them be set 
automatically after you specify your symmetric set of contour boundaries 
appropriately) then it will be done for you.

e.g.,

z = 10 * np.random.randn(20, 30)
clevs = [-10, -5, -2, -1, 1, 2, 5, 10]
cs = plt.contourf(z, levels=clevs, cmap=plt.get_cmap('PRGn'),
   extend='both')
cbar = plt.colorbar(cs, spacing='uniform')

Eric

--
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis  security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] reduce the number of ticks

2014-02-17 Thread Eric Firing
On 2014/02/17 4:58 AM, Pierre Haessig wrote:
 Hi,

 In order to get a plot with a small number of ticks, it is possible to
 create a matplotlib.ticker.MaxNLocator object with a small value for
 `nbins`.

 However, I found it also possible to modify the existing AutoLocator
 instances, since AutoLocator derives from MaxNLocator :

 ax.xaxis.major.locator.set_params(nbins=5)
 ax.yaxis.major.locator.set_params(nbins=5)

 (the default nbins value seems to be 9)

 The advantage of this inplace solution is that it doesn't any
 importing/browsing in the mpl namespace. However, it's still a bit long.

 I was then wondering :
 1) is this solution recommended or not ?
 2) is there a shortcup to avoird the five dots ?

http://matplotlib.org/api/pyplot_api.html?highlight=locator_params#matplotlib.pyplot.locator_params

This is both a pyplot function and an Axes method.

Eric


 best,
 Pierre


--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] trouble with Arrow

2014-02-02 Thread Eric Firing
On 2014/02/02 6:52 PM, Alan G Isaac wrote:
 Also, despite setting `edgecolor=None`, the edge is still stroked.

I suspect you need edgecolor='none'.  In general, specifying a color as 
the string 'none' means don't draw it.

--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] trouble with Arrow

2014-02-02 Thread Eric Firing
On 2014/02/02 7:45 PM, Alan G Isaac wrote:
 Last question about this for now ...

 Yet another issue with `arrow`: the
 docs say a dashed linestyle is supported
 http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.arrow
 but really it is not: the *edge* is dashed rather than the tail!

 Maybe I'm missing the intended usage here.  But
 I'm starting to think Matplotlib could use a SimpleArrow.
 The tail would just be a line.
 The head would just be  a filled triangle.
 The default would be length_includes_head=True.

 Alan Isaac


Alan,

I think you are raising good points. (The default of not including the 
head in the length is puzzling, to say the least.) Actually making a 
*good* simple arrow is not as simple as it might seem, but it can be 
done.  The main difficulty is the need to use a mix of coordinates and 
transforms to handle varying axes sizes and aspect ratios.  In any case, 
I think you have pointed to one of many areas where mpl's present design 
and user interface could be improved.  It's all a matter of volunteer 
labor to make such improvements--with the added difficulty of needing to 
maintain backward compatibility over fairly long periods.

For your immediate needs, might quiver work better?  It's interface is 
also rather complex because of the use cases it covers.

If you are using the arrows for annotation rather than as 
representations of vectors, then of course the annotate() function is 
appropriate.

Eric

--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Clabel conflicts with contourf

2014-01-30 Thread Eric Firing
On 2014/01/30 1:10 AM, Alexis Praga wrote:
 Hi,

 I've attached a reproducible example : when clabel is used, there are some 
 empty (i.e white) triangles in the countour.
 It does not occur without clabel.

Thanks for the report--but clabel is intended to be used only with 
contour, not with contourf.  Typically one would call contourf, and then 
call contour, perhaps with a subset of the levels used in contourf.  The 
ContourSet resulting from the contour call would then be used in the 
call to clabel.  Example:

http://matplotlib.org/examples/pylab_examples/contourf_demo.html

In this example the contour lines are black, but if you don't want the 
lines to show up at all, you could make them transparent, and then 
include a colors kwarg in the clabel call.

Eric


 Tested with matplotlib 1.2.0, python 2.7 on Fedora 14, 64 bits.

 Cheers,




--
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Plotting NOAA grib2 data in basemap

2014-01-29 Thread Eric Firing
On 2014/01/28 11:40 PM, Ian Thomas wrote:
 On 29 January 2014 03:21, Eric Firing efir...@hawaii.edu
 mailto:efir...@hawaii.edu wrote:

 On 2014/01/28 10:01 AM, A Short wrote:
   Hi - Ive now improved my code and confirmed the use of the right
 grib file
   but i cant for the life of me figure out the missing data near the
   coastline..? Could anyone help?

 The present contouring algorithm works with rectangular blocks, and if
 any corner has missing data, nothing is filled for that block.


 This will improve shortly, cutting off the corners of some of those
 empty blocks. I am currently testing the new algorithm for this prior to
 submitting it for others' approval.

Ian,

I'm glad to hear that!  One possibility would be to use a temporary 
rcParam (temporary in that it might be phased out after a couple 
releases) to allow switching between the two algorithms.  This would 
make it much easier to test, and it would also allow a transition during 
which people could reproduce results obtained with earlier mpl.  It 
would also be a safety measure, in case someone hits a corner case which 
the new algorithm doesn't handle but the old one does--not that I'm 
expecting such cases to arise.

Eric


 Ian


--
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Plotting NOAA grib2 data in basemap

2014-01-29 Thread Eric Firing
On 2014/01/29 5:41 AM, A Short wrote:
 Is there any work around so it looks like the below image?

It looks like with any reasonable contouring algorithm, this would 
require interpolating into land regions, contouring, and then plotting 
the land on top.  The key is the interpolation, not the plotting.  The 
example you show might have been interpolated to a finer grid 
everywhere, not just in the missing value regions.

I can't comment on the file itself.

Eric


 Could anyone confirm that this would be the correct grib file for The North
 Atlantic..?
 ftp://ftpprd.ncep.noaa.gov/pub/data/nccf/com/wave/prod/wave.20140129/nww3.t06z.grib.grib2

 Thanks for all the help

 http://matplotlib.1069221.n5.nabble.com/file/n42798/figure_1.png





 --
 View this message in context: 
 http://matplotlib.1069221.n5.nabble.com/Plotting-NOAA-grib2-data-in-basemap-tp42698p42798.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.

 --
 WatchGuard Dimension instantly turns raw network data into actionable
 security intelligence. It gives you real-time visual feedback on key
 security issues and trends.  Skip the complicated setup - simply import
 a virtual appliance and go from zero to informed in seconds.
 http://pubads.g.doubleclick.net/gampad/clk?id=123612991iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Plotting NOAA grib2 data in basemap

2014-01-28 Thread Eric Firing
On 2014/01/28 10:01 AM, A Short wrote:
 Hi - Ive now improved my code and confirmed the use of the right grib file
 but i cant for the life of me figure out the missing data near the
 coastline..? Could anyone help?

The present contouring algorithm works with rectangular blocks, and if 
any corner has missing data, nothing is filled for that block.

Eric


 `import Nio
 from mpl_toolkits.basemap import Basemap
 import matplotlib.pyplot as plt
 import numpy as np

 f = Nio.open_file('nww3.t12z.grib(2).grib2')
 lons = f.variables['lon_0'][:]
 lats = f.variables['lat_0'][::-1] # flip latitudes so data goes S--N
 times = f.variables['forecast_time0'][:]
 ntime = 5
 data = f.variables['HTSGW_P0_L1_GLL0'][ntime,::-1]

 fig = plt.figure(figsize=(16,16))
 m = Basemap(llcrnrlon=-35.,llcrnrlat=42.,urcrnrlon=5.,urcrnrlat=65.,
  projection='lcc',lat_1=10.,lat_2=15.,lon_0=10.,
  resolution ='h',area_thresh=1000.)

 x, y = m(*np.meshgrid(lons, lats))
 m.fillcontinents(color='#477519')
 m.drawcoastlines(linewidth=0.5, color='k', antialiased=1, ax=None,
 zorder=None )

 m.contourf(x, y, data, np.arange(0,9.9,0.1))
 plt.show() `

 Resulting plot is here
 http://matplotlib.1069221.n5.nabble.com/file/n42790/figure_7.png



 --
 View this message in context: 
 http://matplotlib.1069221.n5.nabble.com/Plotting-NOAA-grib2-data-in-basemap-tp42698p42790.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.

 --
 WatchGuard Dimension instantly turns raw network data into actionable
 security intelligence. It gives you real-time visual feedback on key
 security issues and trends.  Skip the complicated setup - simply import
 a virtual appliance and go from zero to informed in seconds.
 http://pubads.g.doubleclick.net/gampad/clk?id=123612991iu=/4140/ostg.clktrk
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users



--
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Basemap Plotting on Floating(?) Axes

2014-01-23 Thread Eric Firing
On 2014/01/22 1:51 PM, geo_leeman wrote:
 Hello all,

 Several of us have been stumped on how to create a map with basemap that
 doesn't have a rectangular bounding box.  I've attached an example of what
 we are trying to create (done with GMT and not ours).  Browsing the docs I
 thought it may be possible with a floating axis as in the gallery, but that
 doesn't do the trick either.  Is there a way to create such a plot with
 basemap?

I don't think so. Not easily, with labeled meridians and parallels.

Eric


 Thanks,
 J.L.

 http://matplotlib.1069221.n5.nabble.com/file/n42766/GMT-contour.jpg



--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] pyplot.plot plotting points in wrong order making loops in the graph display

2014-01-09 Thread Eric Firing
On 2014/01/09 1:57 AM, vargfran wrote:
 Dear all
 pyplot seems to be plottting(joining points with lines) in the wrong order I
 have checked all the algorithms relating the data being plotted and
 everything is in order
 http://matplotlib.1069221.n5.nabble.com/file/n42696/bad_line_joints.png
 this can be observed in the image on how it makes these closed loops by
 plotting a line between two points skipping one or several points in time
 then going back to them before continuing to the next. I wonder if anyone
 has encountered this problem before or knows a solution.

This looks like a problem in parsing date/time x values in a text input 
file, not a problem in the actual plotting.

Eric



--
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments  Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Matplotlib interactive shortcuts?

2014-01-08 Thread Eric Firing
On 2014/01/08 11:40 AM, Skip Montanaro wrote:
 Apologies. Gmail (or my fingers) were acting up...

 On Wed, Jan 8, 2014 at 3:39 PM, Skip Montanaro s...@pobox.com wrote:
 I'm happy with the draggable legends, but I have a problem. It seems
 there are three pointer modes, the initial mode (updates x, y as you
 move the mouse), zoom rectangle mode, and pan/zoom mode. Once I enter
 either of those modes, I can't see how to get back to the original
 mode. I found this navigation documentation:

 http://matplotlib.org/users/navigation_toolbar.html

 but I didn't see any way to get back to the starting mode (what's that
 mode called?), and the legend can only be moved as far as I can tell
 when that is the current mode.

If you are in pan/zoom or rectangle mode, just unselect it by clicking 
its select button again.

Ideally we would have an obvious radio button setup for this.

Eric


 Thx,

 Skip


--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET,  PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


  1   2   3   4   5   6   7   8   9   10   >