Discussion:
[Matplotlib-users] Problems with pyplot and cm in Matplotlib ver. 1.4.3
Starfighter
2015-02-22 02:03:31 UTC
Permalink
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. Now the messages from Matplotlib I get
are:users-MacBook-Pro:lecture1 user$ python plot_solution.pySaved
pseudocolor plot as
pcolor.png/Users/user/anaconda/lib/python2.7/site-packages/matplotlib/text.py:52:
UnicodeWarning: Unicode equal comparison failed to convert both arguments to
Unicode - interpreting them as being unequal if rotation in ('horizontal',
None):/Users/user/anaconda/lib/python2.7/site-packages/matplotlib/text.py:54:
UnicodeWarning: Unicode equal comparison failed to convert both arguments to
Unicode - interpreting them as being unequal elif rotation ==
'vertical':Saved contour plot as contour.pngusers-MacBook-Pro:lecture1 user$
The python script is attached to this note. Now I've observed that the same
python script and input data generated the correct contour and color map
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? 2. What is going on where? 3. How can I fix this
problem?Please advise. plot_solution.py
<http://matplotlib.1069221.n5.nabble.com/file/n45002/plot_solution.py>



--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Problems-with-pyplot-and-cm-in-Matplotlib-ver-1-4-3-tp45002.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
Thomas Caswell
2015-02-22 02:15:43 UTC
Permalink
Can you re-send this with that error message formatted a bit better (It is
really hard to make any sense of it all squashed into one line like that).
From what I can make it out looks like it is mostly warnings, not errors.
Does it correctly save the figure? Can you show us the two outputs?

v1.1.1 is from Jun, 2012, there are over 5k new commits across 301 files
between the two versions (see
https://github.com/matplotlib/matplotlib/compare/v1.1.1...v1.4.3 but it
chokes and only will show you 250 commits)

Can you put together a minimal working example (which does not rely on any
external files)? That will really help the list pin down exactly what is
wrong and how to fix it.

Tom
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
users-MacBook-Pro:lecture1 user$ python plot_solution.py Saved pseudocolor
plot as pcolor.png
UnicodeWarning: Unicode equal comparison failed to convert both arguments
to Unicode - interpreting them as being unequal if rotation in
UnicodeWarning: Unicode equal comparison failed to convert both arguments
to Unicode - interpreting them as being unequal elif rotation ==
'vertical': Saved contour plot as contour.png users-MacBook-Pro:lecture1
user$ The python script is attached to this note. Now I've observed that
the same python script and input data generated the correct contour and
color map 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? 2. What is going on where? 3. How can I fix this
problem? Please advise. plot_solution.py
<http://matplotlib.1069221.n5.nabble.com/file/n45002/plot_solution.py>
------------------------------
View this message in context: Problems with pyplot and cm in Matplotlib
ver. 1.4.3
<http://matplotlib.1069221.n5.nabble.com/Problems-with-pyplot-and-cm-in-Matplotlib-ver-1-4-3-tp45002.html>
Sent from the matplotlib - users mailing list archive
<http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html> 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=190641631&
iu=/4140/ostg.clktrk_______________________________________________
Matplotlib-users mailing list
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Starfighter
2015-02-22 03:32:45 UTC
Permalink
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?
2. What is going on where?
3. How can I fix this problem?


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.
Paul Hobson
2015-02-22 03:40:58 UTC
Permalink
Hey Starfighter, 




I want to help, but I also don't like unzipping files from strangers. Can you make a simple script that generates some fake with numoy and the handful of matplotib commands you need to make the figure. 

-p



—
Sent from Mailbox
Post by Starfighter
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.
1. What are the differences between Matplotlib vers. 1.1.1rc and 1.4.3?
2. What is going on where?
3. How can I fix this problem?
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=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-users mailing list
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Starfighter
2015-02-22 04:33:59 UTC
Permalink
This posting contains:
1. The python script file used to input the data and produce the contour
and color map plots
2. The input data
3. JPG files containing screen snaps of the actual contour and color map
plots

Hope this helps.




solution.txt
<http://matplotlib.1069221.n5.nabble.com/file/n45006/solution.txt>
plot_solution.py
<http://matplotlib.1069221.n5.nabble.com/file/n45006/plot_solution.py>

contour.jpg
<Loading Image...>
pcolor.jpg <Loading Image...>



--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Problems-with-pyplot-and-cm-in-Matplotlib-ver-1-4-3-tp45002p45006.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
Eric Firing
2015-02-22 05:15:30 UTC
Permalink
Post by Starfighter
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.
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.
Post by Starfighter
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.
Post by Starfighter
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
Post by Starfighter
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=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-users mailing list
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Starfighter
2015-02-22 06:27:32 UTC
Permalink
Eric,

I took your suggestion and it worked. Thank you.

To all the others who responded so quickly, thank you as well.

P.S. - I'm still wondering what other differences between vers. 1.1.1rc and
1.4.3 I'll run into. I'll worry about those when I run into them.





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