plot() and imshow() relationship

Hi all,

I am trying to understand if there is a way to compare how plot() and
imshow() works for the case where I am not using imshow() to display
an image.

Via the plot() function, I am specifying the points that I want to
plot and also optionally the color that i want the points to be in.
For example, plot([1, 2, 3], [2, 3, 4], 'ro') will create a plot with
those points colored "red". Via the imshow() function, we specify the
color (or intensity) of each point and a figure is created with the
points colored accordingly. Sure, imshow() allows me to color each
point differently.

Is there a way to relate them?

Also asked on StackOverflow:
http://stackoverflow.com/questions/30527811/plot-and-imshow-relationship

Thanks,
Amit.

···

--
http://echorand.me

imshow is for displaying arrays as images/rasters.

plot is for showing data/functions as points and lines.

See the gallery for imshow:

http://matplotlib.org/gallery.html#images_contours_and_fields

···

On Fri, May 29, 2015 at 4:12 AM, Amit Saha <amitsaha.in@…287…> wrote:

Hi all,

I am trying to understand if there is a way to compare how plot() and

imshow() works for the case where I am not using imshow() to display

an image.

Via the plot() function, I am specifying the points that I want to

plot and also optionally the color that i want the points to be in.

For example, plot([1, 2, 3], [2, 3, 4], ‘ro’) will create a plot with

those points colored “red”. Via the imshow() function, we specify the

color (or intensity) of each point and a figure is created with the

points colored accordingly. Sure, imshow() allows me to color each

point differently.

Is there a way to relate them?

Also asked on StackOverflow:

http://stackoverflow.com/questions/30527811/plot-and-imshow-relationship

Thanks,

Amit.

http://echorand.me



Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

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

Thanks Paul. I have since then have been able to develop a better
understanding of imshow() and it doesn't seem very sensible to try and
compare/relate it to what plot() does.

···

On Sat, May 30, 2015 at 1:50 AM, Paul Hobson <pmhobson@...287...> wrote:

imshow is for displaying arrays as images/rasters.

plot is for showing data/functions as points and lines.

See the gallery for imshow:
http://matplotlib.org/gallery.html#images_contours_and_fields

--