To run the code, you have to get nasafile.py and add this into your
PYTHONPATH, later get dccn_plot.py and
09_03_26_11_36_15.dmtccnc.combined.raw file. nasafile.py has the NasaFile
class to read this ascii file.
run as ./dccn_plot.py 09_03_26_11_36_15.dmtccnc.combined.raw
Please note that your entire application is hardly a “small, complete example”.
While I did download your code from the svn and ran it, but
understand that it makes the job difficult and reduces your chance of
getting help from the developers (or other users).
I know it is getting complex even for myself. Lots of data source and trying to make a general reading routine is somewhat lowering the readability. You should have seen this same code without classes in action. That NasaFile class has helped me alot actually, but the extra functionality also adds lots of lines of code there, too. Thinking of moving this to a GUI. Nevertheless for the time being I am talking in a more speculative way.
I have changed the code as you suggested. Here is the result:
Two things I notice, right y-axis label is gone, and latter the top x-axis
nicely added there but it a replicate of bottom x-axis. Doing this:
For the diappearing label,
unfortunately, the axes_grid toolkits has slightly different behavior
from mainline mpl.
in your code will work.
Thanks, this worked.
At second thought, this might be a bug in the axes_grid toolkit.
For your second point.
There is a reason that I used a factor 3600 in my first example.
aux_trans = mtransforms.Affine2D().scale(3600., y_max) # transform
from ax2 to ax1
Added this line to the code:
aux_trans = mtransforms.Affine2D().translate(0., 0.).
See how the output looks like : http://img18.imageshack.us/img18/5056/newss2.png
As you might see, the pary plotting disappears, when I use this scaling which seemingly correct scaling for my case. It remedies the top axis properly. They are correct equivalences of second-from-midnight representation of time, i.e 45000 --> 12:30:00 (12.5)
When I play a little bit more in IPython (Still experiment, not in a production stage :)) when the figure is up:
Then it turns wrong: http://img3.imageshack.us/img3/4707/newss3.png
Either my understanding, or somethings internally in formatting code.
So close, these things are not easy to figure out. And to me these are beyond advanced matplotlib functionality. I will put a more simplified sample code once I figure out this.
Thank you again.
On Sat, Sep 26, 2009 at 11:14 PM, Jae-Joon Lee <lee.j.joon@…287…> wrote:
On Sat, Sep 26, 2009 at 11:10 PM, Gökhan Sever <gokhansever@…287…> wrote:
You need to try to understand the units for date-time display and then
figure out the correct transform for your need.
If you try 3600, the unit will show as hours. But you may need some
more work to make it fit your need.
from matplotlib.dates import DateFormatter, HourLocator
locator = HourLocator()
formatter = DateFormatter(r’$%H^h
results with my IPython session crashed:
RuntimeError: Locator attempting to generate 216001 ticks from 41000.0 to
50000.0: exceeds Locator.MAXTICKS
I want to be able see in this fashion:
I: current_axis = gca()
but this returns the bottom x-axis and changes them to all 00:00:00.