matplotlib / AnatomyOfMatplotlib

Anatomy of Matplotlib -- tutorial developed for the SciPy conference
Other
1.22k stars 598 forks source link

Interactive example demo #30

Closed nithinraok closed 5 years ago

nithinraok commented 5 years ago

This example is inspired from my severe usage of MATLAB overlay plotting where I plot on a figure and based on its distribution/look I do some operation in backend like moving the image to another directory etc. Hoping this example would become handy for someone like me(who moved from MATLAB plotting)
Discussion : Twitter Link

lgtm-com[bot] commented 5 years ago

This pull request introduces 1 alert when merging df21b88034e5c261cbb84980e064c2e9b551e77a into 0ff68e0558d18fa1f112bf34bc73e80f86a849bb - view on LGTM.com

new alerts:

timhoffm commented 5 years ago

Thanks, for sharing your example. Unfortunately, I don't really understand what problem this solves. Can you please clarify?

Also, please use raw_input instead of input (see the lgtm alert above).

nithinraok commented 5 years ago

Hi, This example is to show usage of figure and current axis to plot image/points on same axis over and over, where user interacts with the program and does some background operation based on his view of output(I put print statement here in code). This way I do research and helps me to quickly run over all examples in dataset. Shared here thinking this would help someone like me.

In MATLAB we just do


Figure(1)
for i=1:3
hold on
Plot(image)
hold off
end
timhoffm commented 5 years ago

I still don't understand the intent; and have some doubts this is a standard way of working in python. Is this intended to be used in a shell/ipython or in a notebook?

WeatherGod commented 5 years ago

Agreed. This is a script that isn't referenced from the tutorial. There is nothing integrating this example into the tutorial. "Anatomy of Matplotlib" wasn't designed as a tutorial helping matlab users migrate to matplotlib (although we do make a few references to matlab in the tutorial as "touchstones" to help former users map similar concepts between the two). It was designed to be a tutorial on the core components and concepts of matplotlib.

Perhaps your example is better suited in a different tutorial or example more geared towards teaching interactivity concepts, or migrating matlab users?

story645 commented 5 years ago

Hi @nithinraok , thanks for the PR but like I said on twitter I agree with @WeatherGod that this specific PR doesn't really belong here. If it's not documented in the Matplotlib docs, please add the example there.