Matplotlib axis control problem


I would like to control the y axis of a plot. The following code does
exactly what I want it to! On my linux computer it sets the y axis
limits to 18.0 minimum, 58.0 maximum, plots some points on y=x, provides
ticks at 20,30,40,50 and horizontal tick lines that intersect the
plotted points.

very good, but if I change the upper y axis limit to 54.0,
(ax.set_ylim(18.0, 54.0)), it fails, plotting the ticks at some strange
values.

Ultimately I want to uncomment the set scale to log and use this to
label semi log plots that by default are only labeled on powers of 10.
My data falls within one decade so I don't want the full 10-100 limits.

I'm rather new at matplotlib so if I'm making trivial errors please feel
free to criticize.

Posted On: Monday 5th of November 2012 02:19:24 AM Total Views:  158
View Complete with Replies

RELATED TOPICS OF Python Programming PROGRAMMING LANGUAGE




How to do it(installer that can install python,matplotlib and tkinter all in one go ???

hello i ve written a small gui script in python. the script imports tkinter,matplotlib and another module rperror _handler. I want to distribute this script to friends who already donot have python installed in their computer. So i want to make some sort of installer(i worry if it is called so)which can install python(python 2.7 in this case),matplotlib for python 2.7 and tkinter. Is it possible\t\t\t\t\t kindly help me Other issue is i have python 2.7 64 bit and this script was written using this. will this script be able to run on python 2.7 32 bit vesions
VIEWS ON THIS POST

162

Posted on:

Sunday 21st October 2012
View Replies!

[matplotlib] Overlapping axis text

I got a really annoying problem with datetime graphs. The problem is that with a long range time graph, the text on the x axis keeps overlapping like here: http://durand.zephyrhosting.net/tremcs/graph_all.png Would there be any way to fix this I was thinking of rotating the text so that there was enough space for each one but the best solution would be to only display text with the right scale. IE, with a 7 day graph, each day would have text, with a year long graph, each month would be displayed, etc... This is the code I use at the moment but its pretty messy: import dateutil,pylab from matplotlib.dates import MonthLocator, WeekdayLocator fig = pylab.figure() ax = fig.add_subplot(111) days = MonthLocator() # every monday months = MonthLocator() # every month ax.xaxis.set_major_locator(months) ax.xaxis.set_minor_locator(days) pylab.plot_date(pylab.date2num(dates), allkills, '.-', color='blue') pylab.plot_date(pylab.date2num(dates), alldeaths, '.-', color='red') pylab.plot_date(pylab.date2num(dates), kills, '.-', color='darkgreen') pylab.plot_date(pylab.date2num(dates), deaths, '.-', color='orange') if legend == 1: pylab.legend(("Total Kills","Total Deaths", "Single Session Kills", "Single Session Deaths"), 'lower left') pylab.xlabel('Date') pylab.ylabel('Stats') ax2 = pylab.twinx() pylab.plot_date(pylab.date2num(dates), allratio, '.-', color='purple') pylab.plot_date(pylab.date2num(dates), ratio, '.-', color='yellow') pylab.ylabel('Ratio') ax2.yaxis.tick_right() pylab.show() Please excuse the extra tabbing, it's part of an if statement.
VIEWS ON THIS POST

74

Posted on:

Sunday 4th November 2012
View Replies!

matplotlib psd

Kudos to matplotlib in python, it's a real slick package. But I'd like to do several power spectrum density calls [ psd() ] and control the color of each. I don't see any obvious option for this. Any hints
VIEWS ON THIS POST

73

Posted on:

Sunday 4th November 2012
View Replies!

Anyone Have (XP) 2.4.4 Installed and Can Check This Simple matplotlibProgram?

I'm going to try another stab at this problem again. I'd like someone with 2.4.4 and matplotlib-0.98.3.win32-py2.4exe to try it (below). It produces a runtime error, and python (IDLE) dies. If I use from the console "import matplotlib" or variations (pythonw), it fails. I think is the final shot on this. If it won't work, I'm off to 2.5, and will drag some others with me who use the common program I'm trying to add a feature to. Here's the code I pulled from the matplotlib site. I added finish() to it. from pylab import * def finish(): print; print "Bye" print raw_input('Press Enter to Quit') sys.exit() t = arange(0.0, 2.0, 0.01) s = sin(2*pi*t) plot(t, s, linewidth=1.0) xlabel('time (s)') ylabel('voltage (mV)') title('About as simple as it gets, folks') grid(True) show() finish() -- W. eWatson (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39 15' 7" N, 121 2' 32" W, 2700 feet Web Page:
VIEWS ON THIS POST

61

Posted on:

Sunday 4th November 2012
View Replies!

ANN: matplotlib-0.98.3 - plotting for python

matplotlib is a 2D plotting library for python for use in scripts, applications, interactive shell work or web application servers. matplotlib 0.98.3 is a major but stable release which brings many new features detailed below. Homepage: http://matplotlib.sourceforge.net/ Downloads: http://sourceforge.net/project/showf...ease_id=617552 Screenshots: http://matplotlib.sourceforge.net/screenshots.html
VIEWS ON THIS POST

102

Posted on:

Sunday 4th November 2012
View Replies!

ANN: matplotlib-0.98.3 - plotting for python

matplotlib is a 2D plotting library for python for use in scripts, applications, interactive shell work or web application servers. matplotlib 0.98.3 is a major release but stable release which brings many new features detailed below. Homepage: http://matplotlib.sourceforge.net/ Downloads: http://sourceforge.net/project/showf...ease_id=617552 Screenshots: http://matplotlib.sourceforge.net/screenshots.html
VIEWS ON THIS POST

92

Posted on:

Sunday 4th November 2012
View Replies!

matplotlib: is there something like DISLIN's "call newpag" ?

, hope somebody here can help me out: is there a command in matplotlib which resembles DISLIN's "CALL NEWPAG" I am trying to make multiple plots on several pages, all stored in one ps (or pdf) document. Cheers -Ralf
VIEWS ON THIS POST

124

Posted on:

Sunday 4th November 2012
View Replies!

matplotlib question

basically I need to plot a graph of data vs time. However when i use matplotlib the hr:min tick marks come out very close together and appear jumbled. So 12:00 comes out very close to 12:30 for example. There are two things I would like to do. First, is to increase the horizontal dimension of the graph. So basically increase the horizontal number of pixels. The data will always be from midnight to midnight it's just that i want it stretched out more horizontally. Also, how do i specify that i only want hourly tickmarks. So under the x-axis i only want to see 12:00 1:00 etc.
VIEWS ON THIS POST

90

Posted on:

Sunday 4th November 2012
View Replies!

pycon matplotlib tutorial deadline tomorrow

I will be presenting a tutorial on matplotlib a this year's pycon. If you are coming to the conference, are are already in the Chicago area, you may want to consider signing up for the tutorial http://us.pycon.org/2008/tutorials/ Tomorrow (Monday Feb 18th) is the deadline for registration. Here are some snippets from the proposal which covers the topic list and some additional info: = Intended audience = Tutorial attendees should be familiar with the basics of python and numpy. = Format description = The tutorial is a 20-30 minute overview of matplotlib capabilities, where the presenter will work interactively while explaining the main features and capabilities of matplotlib. After that, the rest of the tutorial will be interactive, hands on, exercises, that are will be a mix of "type-along" tutorial with students working through examples with help from the instructor. = Promotional summary = Matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms. matplotlib can be used in python scripts, the python and ipython shell (ala matlab or mathematica), web application servers, and six graphical user interface toolkits. The tutorial will cover basic plotting from the python shell, and advanced topics like object oriented matplotlib, using matplotlib in a user interface or web application server and interactive event handling. = Tutorial outline = * 30 min: overview of capabilities and type along * 30 min: interactive graphics from the python shell * 30 min: object oriented matplotlib, web application servers and embedding matplotlib in GTK, Qt, Tk, FLTK or WX * 30 min: user interaction and event handling in matplotlib * 30 min: advanced topics * 30 min: question and answer = Presenter = The presenter is the original author and lea developer of matplotlib. After many years in academia, where he developed scientific python software for human intracortical epilepsy recording, he recently departed the confines of academia for the financial industry, where he continues to develop python based solutions for data ****ysis, modeling and visualization. = Previous presentations and tutorials = * SciPy 2004-6 : matplotlib presentations * PyCon 2005 : matplotlib presentation * SciPy 2006 : led tutorial on data ****sysis and visualization with Fernando Perez * ChiPy : matplotlib presentation to the Chicago Python User's Group * UIC : scientific computing in python tutorial at Univ of Illinois Chicago * Py4Science : with Fernando Perez, teach 2 day seminar on scientific computing in python. Sessions at Los Alamos, UC Berkeley, Univ of Michigan, Claremont Colleges Hope to see you there! Let me know if you have any questions or topic requests JDH
VIEWS ON THIS POST

142

Posted on:

Sunday 4th November 2012
View Replies!

Love matplotlib, but....

I love matplotlib, but I want to do a polar plot using your basic compass type plot, i.e. zero degrees at the top, degrees going clockwise. I don't see a real easy way to do this. Any examples
VIEWS ON THIS POST

106

Posted on:

Monday 5th November 2012
View Replies!

ANN: matplotlib-0.91.2 - a python graphics package

A new release of matplotlib is posted to the sourceforge download site. You can read the release notes with links at http://matplotlib.sourceforge.net/whats_new.html Download: Downloads: http://sourceforge.net/project/showf...group_id=80706 Homepage: http://matplotlib.sourceforge.net Screenshots: http://matplotlib.sourceforge.net/screenshots.html What's new: enhanced mathtext - Complete revamp of matplotlib's internal math layout and rendering engine. Michael Droetboom has improved the TeX parser to significantly expand it's coverege, and implemeted Knuth's box layout algorithms. Additionally, the much anticipated STIX fonts for math expressions have come online and ship with matplotlib. See a sample of the new mathtext at http://matplotlib.sourceforge.net/sc...htext_examples better configuration - Darren Dale has provided support for a site.cfg configuration file to enable users and package maintainers to have better control over the matplotlib build process. He has also provided a (currently optional) enthought.traits enabled property configuration to replace matplotlib's rc configuration using a maplotlib.conf file writing to file-like objects - You can now pass file like objects (eg StringIO) to all backends for hardcopy. This has been a much requested feature for usage in web application servers. record array support - New functions for loading, displaying and saving numpy record arrays in matplotlib.mlab. See for example, http://matplotlib.sourceforge.net/examples/loadrec.py pyplot - Added a module matplotlib.pyplot which has all of pylab's plotting functions (eg figure, plot, show, close) but does not import the numpy namepace. This is useful for those who want to use the pylab functionality w/o the namespace clutter. http://matplotlib.sourceforge.net/ma...ib.pyplot.html maskedarray - Added optional support for the scipy sandbox masked array packaged. Configurable with an rc setting. plotfile - Added new pylab/pyplot command plotfile for gnuplot style file plotting http://matplotlib.sourceforge.net/ma...html#-plotfile http://matplotlib.sourceforge.net/ex...otfile_demo.py And lots more....
VIEWS ON THIS POST

109

Posted on:

Monday 5th November 2012
View Replies!

pyinstall and matplotlib

Has anybody been able to create an exe of their python applications involving matplotlib using pyinstall (ver 1.3) I am getting a: RuntimeError: Could not find the matplotlib data files when I attempt to run the exe created. In searching the web, it appears this is an issue when others tried to use py2exe as well. Unfortunately, the few hits I saw doesn't include enough details to inspire me as to what I should be doing in my pyinstall .spec file. Does anybody has an example or information about this
VIEWS ON THIS POST

141

Posted on:

Monday 5th November 2012
View Replies!

matplotlib install error

I'm trying to install matplotlib and currently getting the below error. I searched the group and google and couldn't find anything similar... Any ideas
VIEWS ON THIS POST

105

Posted on:

Monday 5th November 2012
View Replies!

Using matplotlib/wxpython on XP embedded

List, my customer is looking for an application to show some simple 2d graphs based on messured data. I'm consider to use wxpython, matplotlib and py2exe to build and compile this application. Mayby I also like to use WxMPL and inosetup. The target platform is XP embedded. As I don't have XP embedded available, I can't try it out. So my question is, if somebody has experiances with the above mentioned libraries on XP embedded Should it work out of the box similar to a usual windows environment or do I have to do some special builds for XPe or is it even impossible to use those libraries on it
VIEWS ON THIS POST

168

Posted on:

Monday 5th November 2012
View Replies!

Matlab axis control problem - solved

I don't understand my earlier problem but the following code works no matter what the ylim is set to: I reworked the example major_minor_demo1.py to find the answer. thanks Dick C ps: I still can't post a reply since I read the list with my mozilla or konqueror browser and email separately with thunderbird - the reply address is not obvious. from pylab import * from matplotlib.ticker import MaxNLocator, MultipleLocator, FormatStrFormatter x=[10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0] y=x figure(1) ax=subplot(111) ax.plot(array(x), array(y), 'x') ymajorLocator = MultipleLocator(5) ymajorFormatter = FormatStrFormatter('%d') ax.set_yscale('log') ax.set_ylim(18.0, 58.0) ax.yaxis.set_major_locator(ymajorLocator) ax.yaxis.set_major_formatter(ymajorFormatter) ax.yaxis.grid(True, linestyle='-', which='major') show()
VIEWS ON THIS POST

119

Posted on:

Monday 5th November 2012
View Replies!

howto write matplotlib backend?

Somewhere on http://matplotlib.sourceforge.net or elsewhere I found some hints how to get started writing a new backend for matplotlib. It mentioned some almost empty kind of template that you could extend for your needs. I cannot find this description again. Would somebody help, please Cheers Mihail
VIEWS ON THIS POST

206

Posted on:

Monday 5th November 2012
View Replies!

Re: Mouse control with ctypes in OS X

Robert Kern wrote: > Googling around a bit more, however, I see that the Quartz Event Services is > documented and provides similar functionality. The DarwiinRemote project has a > mouse emulation mode for the Nintendo Wii controller that uses this API. It's > only available in OSX 10.4, however. Apologies for the self-response, but reading the docs more I see that CGPostMouseEvent(), the most relevant function in the API, has been available since 10.0. Sweet. That's just what I've been looking for, too. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
VIEWS ON THIS POST

129

Posted on:

Monday 5th November 2012
View Replies!

negative polar axis

hi! how can i do polar plot in python with negative axes that is the value of the magnitude is negative
VIEWS ON THIS POST

70

Posted on:

Monday 5th November 2012
View Replies!