Hi,
On Thu, Jun 4, 2009 at 06:56, musik wrote:
> I want to make a plot with both y axes labeled. The one on the left (y1)
> will be in Fahrenheit, while the one on the right (y2) in Celsius. Is there
> a way to do this?
what you're looking for is [1]
[1]
http://matplotlib.sourceforge.net/api/
On Thu, Jun 4, 2009 at 6:01 AM, Sandro Tosi wrote:
> Hi,
>
> On Thu, Jun 4, 2009 at 06:56, musik wrote:
> > I want to make a plot with both y axes labeled. The one on the left (y1)
> > will be in Fahrenheit, while the one on the right (y2) in Celsius. Is
> there
> > a way to do this?
>
> what y
Exactly. I want to plot the original data once, but the two y axes show
different scales (units). Is twinx() good for that? How?
Thanks.
Ryan May-3 wrote:
>
> On Thu, Jun 4, 2009 at 6:01 AM, Sandro Tosi wrote:
>
>> Hi,
>>
>> On Thu, Jun 4, 2009 at 06:56, musik wrote:
>> > I want to make a
On Thu, Jun 4, 2009 at 10:08 AM, musik wrote:
>
> Exactly. I want to plot the original data once, but the two y axes show
> different scales (units). Is twinx() good for that? How?
>
I wouldn't call it "good", but you can make it work. Basically, you'd plot
your data once in F, then convert it
I hope the code below gives you some idea.
def Tc(Tf): return (5./9.)*(Tf-32)
ax1 = subplot(111) # y-axis in F
ax2 = twinx() # y-axis in C
def update_ax2(ax1):
y1, y2 = ax1.get_ylim()
ax2.set_ylim(Tc(y1), Tc(y2))
# automatically update ylim of ax2 when ylim of ax1 changes.
ax1.callback
On Thu, Jun 4, 2009 at 12:16 PM, Jae-Joon Lee wrote:
> I hope the code below gives you some idea.
>
>
> def Tc(Tf): return (5./9.)*(Tf-32)
>
> ax1 = subplot(111) # y-axis in F
> ax2 = twinx() # y-axis in C
>
> def update_ax2(ax1):
>y1, y2 = ax1.get_ylim()
>ax2.set_ylim(Tc(y1), Tc(y2))
>
>
This works nicely. Thank you JJ.
Jae-Joon Lee wrote:
>
> I hope the code below gives you some idea.
>
>
> def Tc(Tf): return (5./9.)*(Tf-32)
>
> ax1 = subplot(111) # y-axis in F
> ax2 = twinx() # y-axis in C
>
> def update_ax2(ax1):
> y1, y2 = ax1.get_ylim()
> ax2.set_ylim(Tc(y1),
On Thu, Jun 4, 2009 at 12:16 PM, Jae-Joon Lee wrote:
> I hope the code below gives you some idea.
>
>
> def Tc(Tf): return (5./9.)*(Tf-32)
>
> ax1 = subplot(111) # y-axis in F
> ax2 = twinx() # y-axis in C
>
> def update_ax2(ax1):
>y1, y2 = ax1.get_ylim()
>ax2.set_ylim(Tc(y1), Tc(y2))
>
> #
John Hunter wrote:
> On Thu, Jun 4, 2009 at 12:16 PM, Jae-Joon Lee wrote:
>> I hope the code below gives you some idea.
>>
>>
>> def Tc(Tf): return (5./9.)*(Tf-32)
>>
>> ax1 = subplot(111) # y-axis in F
>> ax2 = twinx() # y-axis in C
>>
>> def update_ax2(ax1):
>>y1, y2 = ax1.get_ylim()
>>ax
On Fri, Jun 5, 2009 at 11:44 AM, Andrew Straw wrote:
> I think this would be a good direction, as well. It would also allow
> disabling the tick mark labels in some axes that share the same axis --
> because the ticks/labels would belong to the spine, which itself
> wouldn't (necessarily) be share
John,
These ideas have been part of motivation behind my axes_grid toolkit.
In the module documentation of
"lib/mpl_toolkits/axes_grid/axislines.py", I tried to briefly explain
what I wanted and what I implemented, although the explanation is very
far from complete (also some examples are found in
Jae-Joon Lee wrote:
> ...
> def Tc(Tf): return (5./9.)*(Tf-32)
>
> ax1 = subplot(111) # y-axis in F
> ax2 = twinx() # y-axis in C
>
> def update_ax2(ax1):
> y1, y2 = ax1.get_ylim()
> ax2.set_ylim(Tc(y1), Tc(y2))
>
> # automatically update ylim of ax2 when ylim of ax1 changes.
> ax1.callb
12 matches
Mail list logo