472,347 Members | 2,383 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,347 software developers and data experts.

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.

thanks
Jun 27 '08 #1
1 1396
asdf wrote:
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.
You need to look up the matplotlib.dates package - it's covered briefly in
the tutorial at http://matplotlib.sourceforge.net/tutorial.html

At a guess, you want something along the lines of this...

from matplotlib.dates import YearLocator, MonthLocator, WeekdayLocator, \
DayLocator, HourLocator, MinuteLocator, SecondLocator, \
DateFormatter

subplot.xaxis.set_major_locator(HourLocator(range( 0,24,6)))
subplot.xaxis.set_major_formatter(DateFormatter("% a %H:%M"))
subplot.xaxis.set_minor_locator(HourLocator(range( 0,24,1)))

....but you'll probably need to look up the documentation to get the details
to suit what you need.

Hope that helps!
--
I'm at CAMbridge, not SPAMbridge
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John Hunter | last post by:
matplotlib is a 2D plotting library for python. You can use matplotlib interactively from a python shell or IDE, or embed it in GUI applications...
2
by: Dr. Colombes | last post by:
MatPlotLib question: How to get more different size plot symbols in the plot function ? Is there a way to get different size squares (or circles...
4
by: Matt Feinstein | last post by:
Hi all-- I'm planning to try to do a completely local install of matplotlib (in Fedora Core 1)-- the system administrator isn't going to stop...
8
by: Derek Basch | last post by:
Can anyone give any suggestions on how to make a logarithmic (base 10) x and y axis (loglog) plot in matplotlib? The scatter function doesn't seem...
5
by: John Henry | last post by:
I've been asking this question at the matplotlib user list and never gotten an answer. I am hoping that there are matplotlib users here that can...
12
by: orangeDinosaur | last post by:
Hi, I am exploring the possibility of using python as a replacement of MATLAB when I leave school. So, I've been playing with matplotlib and...
1
by: redcic | last post by:
I've got a question regarding matplotlib. I use the command: pylab.plot(...) to create a graph. Then, the execution of the code stops after the...
3
by: vajratkarviraj | last post by:
i hav python2.5, matplotlib0.90.1, and py2exe for python 2.5 all on windows xp... i hav a python program(letsc.py) which uses the matplotlib...
4
by: John Henry | last post by:
Has anybody been able to create an exe of their python applications involving matplotlib using pyinstall (ver 1.3)? I am getting a: ...
0
by: PamMish1982 | last post by:
Hi all, I have recently started using Python and I am trying to make a GUI out of Tkinter. I am using matplotlib for the graphic purposes. I have...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.