Two questions...

Hello,

One easy one harder two questions :slight_smile:

My screenshot http://img213.imageshack.us/img213/3443/snapshot5.png

1-) I want to link bottom and top x axes as well as left and right y axes. For now on the x-axis xticks are the time in seconds from midnight, not sure how to add the secondary top x axis with time in regular HH:MM:SS representation, without plotting the same data again. Right y-axis is there thanks to twinx however that and left one don’t snap each other when I zoom in the plot. There is the twin function but couldn’t figure out how to achieve what I explained here.

2-) How to move plot title upwards when the new top x-axis ticks become visible? They are overlapping each other, which I am trying to make them nice looking.

Thanks.

···


Gökhan

The example below will give you some idea where to start.
It uses twin function in axes_grid toolkit.
(also see http://matplotlib.sourceforge.net/examples/axes_grid/parasite_simple2.html)

You may use twinx or twiny, but you need to make both x and y axis in
sync to each other (maybe using the "xlim_changed" or "ylim_changed"
event).

To change the title position you set_position method (the coordinate
is in normalized axes coordinate). If you need more control, I
recommend to use annotate function.

Regards,

-JJ

import matplotlib.transforms as mtransforms
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid.parasite_axes import SubplotHost

fig = plt.figure()

ax1 = SubplotHost(fig, 1,1,1)
fig.add_subplot(ax1)

ax1.plot([41000, 42000, 43000], [10., 60, 80.])

y_max = 90

aux_trans = mtransforms.Affine2D().scale(3600., y_max) # transform
from ax2 to ax1

ax2 = ax1.twin(aux_trans)

from matplotlib.dates import DateFormatter, HourLocator
locator = HourLocator()
ax2.xaxis.set_major_locator(locator)
formatter = DateFormatter(r'$%H^h$')
ax2.xaxis.set_major_formatter(formatter)

t = ax1.set_title("Title")
t.set_position((0.5, 1.05))

plt.show()

Thanks Jae-Joon for your explanations.

My second question has easily been solved after setting the label position.

However, I am still stuck snapping the axis pairs. I have two different scaled data sources. First three data (dccnConc, dccnConAmb, and dccnConSTP are plotted on the main host y-axis, and dccnSS, and dccnSS_Amb are plotted on the parasite left y-axis. With twin and proper Affine2D transformation I could not make the secondary y-axis data being shown on the figure.

The script and the data file I am using is under

http://code.google.com/p/ccnworks/source/browse/#svn/trunk

I execute the script as shown below:
./dccn_plot.py 09_03_26_11_36_15.dmtccnc.combined.raw

Any further thoughts?

···

On Thu, Sep 24, 2009 at 10:38 PM, Jae-Joon Lee <lee.j.joon@…287…> wrote:

The example below will give you some idea where to start.

It uses twin function in axes_grid toolkit.

(also see http://matplotlib.sourceforge.net/examples/axes_grid/parasite_simple2.html)

You may use twinx or twiny, but you need to make both x and y axis in

sync to each other (maybe using the “xlim_changed” or “ylim_changed”

event).

To change the title position you set_position method (the coordinate

is in normalized axes coordinate). If you need more control, I

recommend to use annotate function.

Regards,

-JJ

import matplotlib.transforms as mtransforms

import matplotlib.pyplot as plt

from mpl_toolkits.axes_grid.parasite_axes import SubplotHost

fig = plt.figure()

ax1 = SubplotHost(fig, 1,1,1)

fig.add_subplot(ax1)

ax1.plot([41000, 42000, 43000], [10., 60, 80.])

y_max = 90

aux_trans = mtransforms.Affine2D().scale(3600., y_max) # transform

from ax2 to ax1

ax2 = ax1.twin(aux_trans)

from matplotlib.dates import DateFormatter, HourLocator

locator = HourLocator()

ax2.xaxis.set_major_locator(locator)

formatter = DateFormatter(r’$%H^h$’)

ax2.xaxis.set_major_formatter(formatter)

t = ax1.set_title(“Title”)

t.set_position((0.5, 1.05))

plt.show()


Gökhan

You might be able to manually add text for the upper tick labels, as
in this example:

http://matplotlib.sourceforge.net/examples/pylab_examples/boxplot_demo2.html

JDH

···

On Thu, Sep 24, 2009 at 3:29 PM, Gökhan Sever <gokhansever@...287...> wrote:

Hello,

One easy one harder two questions :slight_smile:

My screenshot http://img213.imageshack.us/img213/3443/snapshot5.png

1-) I want to link bottom and top x axes as well as left and right y axes.
For now on the x-axis xticks are the time in seconds from midnight, not sure
how to add the secondary top x axis with time in regular HH:MM:SS
representation, without plotting the same data again. Right y-axis is there
thanks to twinx however that and left one don't snap each other when I zoom
in the plot. There is the twin function but couldn't figure out how to
achieve what I explained here.

Hi John,

Allright, previously I was blocking the plotting event while trying to update ticks instead of ticklabels. Hah trying to use 8103 ticks kills the action :slight_smile:

After looking at that example I brought parx = host.twiny() into the game.

Now when I do parx.xaxis.set_ticklabels(dccn.hms) I only get 5 wrong ticklabels. If I do a simple plot(dccn.hms) ticklabels are properly set. I know a few additional steps needed to make this work, but couldn’t manage to solve this yet.

On your suggested example try zooming into the plot, bottom and top x-axes behave differently. JJ suggested to use xlim_changed and ylim_changed event connection but how ? :slight_smile:

One more question;

Say simply when I do: parx.xaxis.set_ticks(arange(10)), and later query:

I[30]: parx.xaxis.get_majorticklocs()
O[30]: array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])

whereas

I[31]: parx.xaxis.get_majorticklabels()
O[31]: <a list of 10 Text major ticklabel objects>

I get objects here. Is there a way to see their actual values, besides the object representation like in get_majorticklocs() method?

Thank you.

···

On Fri, Sep 25, 2009 at 6:52 AM, John Hunter <jdh2358@…83…287…> wrote:

On Thu, Sep 24, 2009 at 3:29 PM, Gökhan Sever <gokhansever@…287…> wrote:

Hello,

One easy one harder two questions :slight_smile:

My screenshot http://img213.imageshack.us/img213/3443/snapshot5.png

1-) I want to link bottom and top x axes as well as left and right y axes.

For now on the x-axis xticks are the time in seconds from midnight, not sure

how to add the secondary top x axis with time in regular HH:MM:SS

representation, without plotting the same data again. Right y-axis is there

thanks to twinx however that and left one don’t snap each other when I zoom

in the plot. There is the twin function but couldn’t figure out how to

achieve what I explained here.

You might be able to manually add text for the upper tick labels, as

in this example:

http://matplotlib.sourceforge.net/examples/pylab_examples/boxplot_demo2.html

JDH


Gökhan

First the first part, my understanding is if twiny() could accept tranforms this like twin() this issued might be resolved. When I use twin() and transforms with different scaled data sources, I can’t get one of them being plotted correctly.

Just FYI,

Maybe someone can further look into this.

Thank you.

···

On Fri, Sep 25, 2009 at 11:45 AM, Gökhan Sever <gokhansever@…287…> wrote:

On Fri, Sep 25, 2009 at 6:52 AM, John Hunter <jdh2358@…287…> wrote:

On Thu, Sep 24, 2009 at 3:29 PM, Gökhan Sever <gokhansever@…287…> wrote:

Hello,

One easy one harder two questions :slight_smile:

My screenshot http://img213.imageshack.us/img213/3443/snapshot5.png

1-) I want to link bottom and top x axes as well as left and right y axes.

For now on the x-axis xticks are the time in seconds from midnight, not sure

how to add the secondary top x axis with time in regular HH:MM:SS

representation, without plotting the same data again. Right y-axis is there

thanks to twinx however that and left one don’t snap each other when I zoom

in the plot. There is the twin function but couldn’t figure out how to

achieve what I explained here.

You might be able to manually add text for the upper tick labels, as

in this example:

http://matplotlib.sourceforge.net/examples/pylab_examples/boxplot_demo2.html

JDH

Hi John,

Allright, previously I was blocking the plotting event while trying to update ticks instead of ticklabels. Hah trying to use 8103 ticks kills the action :slight_smile:

After looking at that example I brought parx = host.twiny() into the game.

Now when I do parx.xaxis.set_ticklabels(dccn.hms) I only get 5 wrong ticklabels. If I do a simple plot(dccn.hms) ticklabels are properly set. I know a few additional steps needed to make this work, but couldn’t manage to solve this yet.

On your suggested example try zooming into the plot, bottom and top x-axes behave differently. JJ suggested to use xlim_changed and ylim_changed event connection but how ? :slight_smile:

One more question;

Say simply when I do: parx.xaxis.set_ticks(arange(10)), and later query:

I[30]: parx.xaxis.get_majorticklocs()
O[30]: array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])

whereas

I[31]: parx.xaxis.get_majorticklabels()
O[31]: <a list of 10 Text major ticklabel objects>

I get objects here. Is there a way to see their actual values, besides the object representation like in get_majorticklocs() method?

Thank you.


Gökhan


Gökhan

Please post a simple, complete code that does not work.
Just saying "it didn't work" does not help.

I think the following change (or something like this) in you code
(dccn_plot.py) seems to work to my eyes. If this is not what you want,
you have to describe why it is not.

import matplotlib.transforms as mtransforms
aux_trans = mtransforms.Affine2D().translate(0., -0.5).scale(1., 3500/0.45)
#pary = host.twinx()
pary = host.twin(aux_trans)

Regards,

-JJ

···

On Fri, Sep 25, 2009 at 1:14 AM, Gökhan Sever <gokhansever@...287...> wrote:

With twin and proper Affine2D transformation I could not make the secondary
y-axis data being shown on the figure.

As specified in the doc

http://matplotlib.sourceforge.net/api/axis_api.html?highlight=get_majorticklabels#matplotlib.axis.Axis.get_majorticklabels

it returns a list of Text instances. You may use

http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.text.Text.get_text

to retrieve the strings associated.
For example,

[t.get_text() for t in ax.xaxis.get_majorticklabels()]

-JJ

···

On Fri, Sep 25, 2009 at 12:45 PM, Gökhan Sever <gokhansever@...287...> wrote:

On Fri, Sep 25, 2009 at 6:52 AM, John Hunter <jdh2358@...287...> wrote:

On Thu, Sep 24, 2009 at 3:29 PM, Gökhan Sever <gokhansever@...1896....> >> wrote:
> Hello,
>
> One easy one harder two questions :slight_smile:
>
> My screenshot http://img213.imageshack.us/img213/3443/snapshot5.png
>
> 1-) I want to link bottom and top x axes as well as left and right y
> axes.
> For now on the x-axis xticks are the time in seconds from midnight, not
> sure
> how to add the secondary top x axis with time in regular HH:MM:SS
> representation, without plotting the same data again. Right y-axis is
> there
> thanks to twinx however that and left one don't snap each other when I
> zoom
> in the plot. There is the twin function but couldn't figure out how to
> achieve what I explained here.
>

You might be able to manually add text for the upper tick labels, as
in this example:

http://matplotlib.sourceforge.net/examples/pylab_examples/boxplot_demo2.html

JDH

Hi John,

Allright, previously I was blocking the plotting event while trying to
update ticks instead of ticklabels. Hah trying to use 8103 ticks kills the
action :slight_smile:

After looking at that example I brought parx = host.twiny() into the game.

Now when I do parx.xaxis.set_ticklabels(dccn.hms) I only get 5 wrong
ticklabels. If I do a simple plot(dccn.hms) ticklabels are properly set. I
know a few additional steps needed to make this work, but couldn't manage to
solve this yet.

On your suggested example try zooming into the plot, bottom and top x-axes
behave differently. JJ suggested to use xlim_changed and ylim_changed event
connection but how ? :slight_smile:

One more question;

Say simply when I do: parx.xaxis.set_ticks(arange(10)), and later query:

I[30]: parx.xaxis.get_majorticklocs()
O[30]: array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])

whereas

I[31]: parx.xaxis.get_majorticklabels()
O[31]: <a list of 10 Text major ticklabel objects>

I get objects here. Is there a way to see their actual values, besides the
object representation like in get_majorticklocs() method?

Thank you.

--
Gökhan

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

OK JJ, trying to be more descriptive.

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

I have changed the code as you suggested. Here is the result: http://img44.imageshack.us/img44/1075/newsso.png

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:

from matplotlib.dates import DateFormatter, HourLocator

locator = HourLocator()
pary.xaxis.set_major_locator(locator)
formatter = DateFormatter(r’$%H^h$’)

ax2.xaxis.set_major_formatter(formatter)

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[3]: current_axis = gca()
I[4]: current_axis.xaxis.set_major_formatter(DateFormatter(’%H:%M:%S’))

but this returns the bottom x-axis and changes them to all 00:00:00.

···

On Sat, Sep 26, 2009 at 9:50 PM, Jae-Joon Lee <lee.j.joon@…287…> wrote:

On Fri, Sep 25, 2009 at 1:14 AM, Gökhan Sever <gokhansever@…287…> wrote:

With twin and proper Affine2D transformation I could not make the secondary

y-axis data being shown on the figure.

Please post a simple, complete code that does not work.

Just saying “it didn’t work” does not help.

I think the following change (or something like this) in you code

(dccn_plot.py) seems to work to my eyes. If this is not what you want,

you have to describe why it is not.

import matplotlib.transforms as mtransforms

aux_trans = mtransforms.Affine2D().translate(0., -0.5).scale(1., 3500/0.45)

#pary = host.twinx()

pary = host.twin(aux_trans)

Regards,

-JJ


Gökhan

Yes, got it. Thanks.

···

On Sat, Sep 26, 2009 at 9:58 PM, Jae-Joon Lee <lee.j.joon@…287…> wrote:

As specified in the doc

http://matplotlib.sourceforge.net/api/axis_api.html?highlight=get_majorticklabels#matplotlib.axis.Axis.get_majorticklabels

it returns a list of Text instances. You may use

http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.text.Text.get_text

to retrieve the strings associated.

For example,

[t.get_text() for t in ax.xaxis.get_majorticklabels()]

-JJ

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 have changed the code as you suggested. Here is the result:
http://img44.imageshack.us/img44/1075/newsso.png

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.

http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html#id5

http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/axislines.html

Adding

pary.axis["right"].label.set_visible(True)

in your code will work.

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

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.

-JJ

···

On Sat, Sep 26, 2009 at 11:10 PM, Gökhan Sever <gokhansever@...287...> wrote:

from matplotlib.dates import DateFormatter, HourLocator
locator = HourLocator()
pary.xaxis.set_major_locator(locator)
formatter = DateFormatter(r'$%H^h
)
ax2.xaxis.set_major_formatter(formatter)

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[3]: current_axis = gca()
I[4]: current_axis.xaxis.set_major_formatter(DateFormatter('%H:%M:%S'))

but this returns the bottom x-axis and changes them to all 00:00:00.

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:

http://img44.imageshack.us/img44/1075/newsso.png

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.

http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html#id5

http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/axislines.html

Adding

pary.axis[“right”].label.set_visible(True)

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.).
scale(3600, dccn.data[‘dccnConSTP’].max())

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:

pary.xaxis.set_major_formatter(DateFormatter(’%H:%M:%S’))

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.

-JJ

from matplotlib.dates import DateFormatter, HourLocator

locator = HourLocator()

pary.xaxis.set_major_locator(locator)

formatter = DateFormatter(r’$%H^h

)

ax2.xaxis.set_major_formatter(formatter)

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[3]: current_axis = gca()

I[4]: current_axis.xaxis.set_major_formatter(DateFormatter(’%H:%M:%S’))

but this returns the bottom x-axis and changes them to all 00:00:00.


Gökhan

I hope my answer in the other thread clears your problem.

One note, I found that some grid lines are missing at first run. This
can be fixed by using "host.xaxis.get_major_ticks()" instead of
"host.xaxis.majorTicks" (same for yaxis).

-JJ

···

On Sun, Sep 27, 2009 at 2:22 AM, Gökhan Sever <gokhansever@...287...> wrote:

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@...985.....> >> wrote:
> 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:
> http://img44.imageshack.us/img44/1075/newsso.png
>
> 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.

http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html#id5

http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/axislines.html

Adding

pary.axis["right"].label.set_visible(True)

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.).\
scale(3600, dccn.data['dccnConSTP'].max())

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:

pary.xaxis.set_major_formatter(DateFormatter('%H:%M:%S'))

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.

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.

-JJ

>
> from matplotlib.dates import DateFormatter, HourLocator
> locator = HourLocator()
> pary.xaxis.set_major_locator(locator)
> formatter = DateFormatter(r'$%H^h
> )
> ax2.xaxis.set_major_formatter(formatter)
>
> 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[3]: current_axis = gca()
> I[4]: current_axis.xaxis.set_major_formatter(DateFormatter('%H:%M:%S'))
>
> but this returns the bottom x-axis and changes them to all 00:00:00.

--
Gökhan