zoom a plot

Hi, I use matplotlib to create a png file, then display it in a web browser. All works fine. Now I want to zoom the plot. What I can think of is:

  1. Get coordinates (x1, y1), (x2, y2) of the image when user makes an area selection on the image;

  2. Convert (x1, y1), (x2, y2) to the real values matplotlib was plotting;

  3. Request matplotlib to create a new png file using the updated area values.

Could anybody please let me know how to accomplish step 2?

Many thanks,

Tom

I don’t think you’ll get acceptable performance out of that workflow.

I recommend looking into the webagg backend: http://matplotlib.org/users/whats_new.html#webagg-backend

···

On Mon, Sep 15, 2014 at 8:38 AM, Xiaobo Yang <xiaobo.yang@…287…> wrote:

Hi, I use matplotlib to create a png file, then display it in a web browser. All works fine. Now I want to zoom the plot. What I can think of is:

  1. Get coordinates (x1, y1), (x2, y2) of the image when user makes an area selection on the image;
  1. Convert (x1, y1), (x2, y2) to the real values matplotlib was plotting;
  1. Request matplotlib to create a new png file using the updated area values.

Could anybody please let me know how to accomplish step 2?

Many thanks,

Tom


Want excitement?

Manually upgrade your production database.

When you want reliability, choose Perforce

Perforce version control. Predictably reliable.

http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Thank you for your quick answer. I understand the performance issue you
mentioned. For now it is only a proof of concept.

I just figured out how to do it in theory by using
figure.subplot.left|right|bottom|top plus a few other settings.

I'll certainly look at the webagg backend. Are there any examples available?

···

--
View this message in context: http://matplotlib.1069221.n5.nabble.com/zoom-a-plot-tp43952p43954.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Yes. They are on the same webpage to which I linked earlier.

http://matplotlib.org/search.html?q=codex+webagg&check_keywords=yes&area=default

···

On Mon, Sep 15, 2014 at 9:28 AM, Tom Young <xiaobo.yang@…287…> wrote:

Thank you for your quick answer. I understand the performance issue you

mentioned. For now it is only a proof of concept.

I just figured out how to do it in theory by using

figure.subplot.left|right|bottom|top plus a few other settings.

I’ll certainly look at the webagg backend. Are there any examples available?

View this message in context: http://matplotlib.1069221.n5.nabble.com/zoom-a-plot-tp43952p43954.html

Sent from the matplotlib - users mailing list archive at Nabble.com.


Want excitement?

Manually upgrade your production database.

When you want reliability, choose Perforce

Perforce version control. Predictably reliable.

http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users