how to insert a part of a plot in the same figure

Hey All,

I have a fig, see attach image. I am plotting the number of infected nodes
versus time. Time is running from 0 to 100.
I need to insert a subplot in that figure that shows me the number of
infected nodes for time running from 0 to 20 for example. If there is an
example that can do the same thing I want please post it to me or tell me
how I can do it in matplotlib.

Cheers.
http://old.nabble.com/file/p27780169/simbara-0%2B.41667-0-0.11-0.13-0.15-0.18.png

···

--
View this message in context: http://old.nabble.com/how-to-insert-a-part-of-a-plot-in-the-same-figure-tp27780169p27780169.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

I would add an additional axes 'ax2' with different x/y-limits and plot all
data to this axes.

ax1 = axes()
ax2 = axes([0.4, 0.4, 0.4, 0.4])
# rectangle [left, bottom, width, height] in normalized (0, 1) units

ax1.plot(arange(100))
draw()
ax2.plot(arange(100))
draw()
ax2.set_xlim(0, 20)
draw()

Kind regards,
Matthias

···

On Thursday 04 March 2010 13:35:12 kamaleon wrote:

Hey All,

I have a fig, see attach image. I am plotting the number of infected nodes
versus time. Time is running from 0 to 100.
I need to insert a subplot in that figure that shows me the number of
infected nodes for time running from 0 to 20 for example. If there is an
example that can do the same thing I want please post it to me or tell me
how I can do it in matplotlib.

Cheers.
http://old.nabble.com/file/p27780169/simbara-0%2B.41667-0-0.11-0.13-0.15-0.
18.png

Thanks Matthias, this seems help me.
But how to remove the xlabel, ylable and the tilte in the subplot?
Cheers

Matthias Michler wrote:

···

On Thursday 04 March 2010 13:35:12 kamaleon wrote:

Hey All,

I have a fig, see attach image. I am plotting the number of infected
nodes
versus time. Time is running from 0 to 100.
I need to insert a subplot in that figure that shows me the number of
infected nodes for time running from 0 to 20 for example. If there is an
example that can do the same thing I want please post it to me or tell
me
how I can do it in matplotlib.

Cheers.
http://old.nabble.com/file/p27780169/simbara-0%2B.41667-0-0.11-0.13-0.15-0.
18.png

I would add an additional axes 'ax2' with different x/y-limits and plot
all
data to this axes.

ax1 = axes()
ax2 = axes([0.4, 0.4, 0.4, 0.4])
# rectangle [left, bottom, width, height] in normalized (0, 1) units

ax1.plot(arange(100))
draw()
ax2.plot(arange(100))
draw()
ax2.set_xlim(0, 20)
draw()

Kind regards,
Matthias

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
View this message in context: http://old.nabble.com/how-to-insert-a-part-of-a-plot-in-the-same-figure-tp27780169p27782907.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

[...]

Hi ,

what do you mean by xlabel, ylabel and title?
In my example these were not set. In case you set them, you can remove them
using
xlabel('')
ylabel('')
title('')

or do you mean the ticks and tick-labels on the axes?
These can be removed using

xticks([ ])
ytick([ ])

Kind regards,
Matthias

···

On Thursday 04 March 2010 17:11:54 kamaleon wrote:

Thanks Matthias, this seems help me.
But how to remove the xlabel, ylable and the tilte in the subplot?
Cheers

Matthias Michler wrote:
> On Thursday 04 March 2010 13:35:12 kamaleon wrote:

Thanks you put it right,
I wanted to know how to remove them inside the subplot. It is done.

Cheers

Matthias Michler wrote:

···

On Thursday 04 March 2010 17:11:54 kamaleon wrote:

Thanks Matthias, this seems help me.
But how to remove the xlabel, ylable and the tilte in the subplot?
Cheers

Matthias Michler wrote:
> On Thursday 04 March 2010 13:35:12 kamaleon wrote:

[...]

Hi ,

what do you mean by xlabel, ylabel and title?
In my example these were not set. In case you set them, you can remove
them
using
xlabel('')
ylabel('')
title('')

or do you mean the ticks and tick-labels on the axes?
These can be removed using

xticks([ ])
ytick([ ])

Kind regards,
Matthias

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
View this message in context: http://old.nabble.com/how-to-insert-a-part-of-a-plot-in-the-same-figure-tp27780169p27784306.html
Sent from the matplotlib - users mailing list archive at Nabble.com.