Zoom and pan within dataspace.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Zoom and pan within dataspace.

Jordan Ilott
Hi everyone. I'm hoping someone can offer some advice. I am trying to limit the range that a Chaco plot may be zoomed/panned.

I have found that the PanTool can be restricted to the data space by setting the tool's restrict_to_data property to True. I've also found that I can impose a maximum zoom out factor by specify a value for the ZoomTool's x_min_zoom_factor  and y_min_zoom_factor  properties to 1.

Here is my problem: If I zoom in and then pan before zooming out, the minimum zoom factor is reached, but the plot will be panned outside of the axis limits. As soon as an attempt to pan the plot is made, the range gets reset to match the range of the data.

How can I allow the user to zoom and pan but never be presented with a plot where the range is outside of the range of the data?

Thanks a lot for any suggestions.

Jordan


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Zoom and pan within dataspace.

Roan LaPlante
Hi Jordan,

I am not sure if this is the best way of doing this -- but what I would probably do is subclass PanTool to include a check for panning outside of the current range.


R


On Wed, Sep 11, 2013 at 7:00 PM, Jordan Ilott <[hidden email]> wrote:
Hi everyone. I'm hoping someone can offer some advice. I am trying to limit the range that a Chaco plot may be zoomed/panned.

I have found that the PanTool can be restricted to the data space by setting the tool's restrict_to_data property to True. I've also found that I can impose a maximum zoom out factor by specify a value for the ZoomTool's x_min_zoom_factor  and y_min_zoom_factor  properties to 1.

Here is my problem: If I zoom in and then pan before zooming out, the minimum zoom factor is reached, but the plot will be panned outside of the axis limits. As soon as an attempt to pan the plot is made, the range gets reset to match the range of the data.

How can I allow the user to zoom and pan but never be presented with a plot where the range is outside of the range of the data?

Thanks a lot for any suggestions.

Jordan


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.




--
Roan LaPlante
Athinoula A. Martinos Center for Biomedical Imaging


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Zoom and pan within dataspace.

Jordan Ilott-2
Thanks for the idea Roan. I believe this is basically what the restrict_to_data property of the default PanTool is meant to do. This does give me an idea to subclass the Zoom class so that when the zoom factor is 1 the range is set to be the data range.

I may give it  a try.

Jordan


On Thu, Sep 12, 2013 at 11:24 AM, Roan LaPlante <[hidden email]> wrote:
Hi Jordan,

I am not sure if this is the best way of doing this -- but what I would probably do is subclass PanTool to include a check for panning outside of the current range.


R


On Wed, Sep 11, 2013 at 7:00 PM, Jordan Ilott <[hidden email]> wrote:
Hi everyone. I'm hoping someone can offer some advice. I am trying to limit the range that a Chaco plot may be zoomed/panned.

I have found that the PanTool can be restricted to the data space by setting the tool's restrict_to_data property to True. I've also found that I can impose a maximum zoom out factor by specify a value for the ZoomTool's x_min_zoom_factor  and y_min_zoom_factor  properties to 1.

Here is my problem: If I zoom in and then pan before zooming out, the minimum zoom factor is reached, but the plot will be panned outside of the axis limits. As soon as an attempt to pan the plot is made, the range gets reset to match the range of the data.

How can I allow the user to zoom and pan but never be presented with a plot where the range is outside of the range of the data?

Thanks a lot for any suggestions.

Jordan


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.




--
Roan LaPlante
Athinoula A. Martinos Center for Biomedical Imaging


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: Zoom and pan within dataspace.

Roan LaPlante
Sorry, I meant the ZoomTool.  But you get the idea.


On Thu, Sep 12, 2013 at 1:45 PM, Jordan Ilott <[hidden email]> wrote:
Thanks for the idea Roan. I believe this is basically what the restrict_to_data property of the default PanTool is meant to do. This does give me an idea to subclass the Zoom class so that when the zoom factor is 1 the range is set to be the data range.

I may give it  a try.

Jordan


On Thu, Sep 12, 2013 at 11:24 AM, Roan LaPlante <[hidden email]> wrote:
Hi Jordan,

I am not sure if this is the best way of doing this -- but what I would probably do is subclass PanTool to include a check for panning outside of the current range.


R


On Wed, Sep 11, 2013 at 7:00 PM, Jordan Ilott <[hidden email]> wrote:
Hi everyone. I'm hoping someone can offer some advice. I am trying to limit the range that a Chaco plot may be zoomed/panned.

I have found that the PanTool can be restricted to the data space by setting the tool's restrict_to_data property to True. I've also found that I can impose a maximum zoom out factor by specify a value for the ZoomTool's x_min_zoom_factor  and y_min_zoom_factor  properties to 1.

Here is my problem: If I zoom in and then pan before zooming out, the minimum zoom factor is reached, but the plot will be panned outside of the axis limits. As soon as an attempt to pan the plot is made, the range gets reset to match the range of the data.

How can I allow the user to zoom and pan but never be presented with a plot where the range is outside of the range of the data?

Thanks a lot for any suggestions.

Jordan


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.




--
Roan LaPlante
Athinoula A. Martinos Center for Biomedical Imaging


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.




--
Roan LaPlante
Athinoula A. Martinos Center for Biomedical Imaging


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev