From: Dima K. <gn...@di...> - 2020-04-09 21:06:18
|
Ethan A Merritt <me...@uw...> writes: > On Thursday, 9 April 2020 11:58:52 PDT Dima Kogan wrote: >> A common use case for me is to mark-up images. So gnuplot would plot an >> image, and render stuff on top of it. > > Already there in 5.4 (please test release candidate!) What? Wow! OK. First off, I've been running 5.4-rc1 (built from source, new x11_waitforinput patch cherry-picked) for a few days now. No surprises yet. I just tried out 'set pixmap'. For me it only appears to work in the most basic cases, and I can't tell if it's any faster. I think there're several issues at play. I tried small images first. Using http://gnuplot.info/figs/front2.png from the gnuplot site. This works: set terminal x11 set pixmap 1 "/tmp/front2.png" at 0,0 plot x This doesn't: set terminal x11 set pixmap 1 "/tmp/front2.png" at 0,0 width first 300 behind plot x The plot pops up, and goes away immediately. Might be x11_waitforinput() still needs work, because in the qt terminal it does work. x11 is weird in lots of cases here, so I'm using qt for the rest of this email. Will revisit x11 later. You need to zoom out manually because the pixmap isn't a part of the autoscaling logic. Should it be? It is when using "with rgbimage" I think. It'd also be really nice to use the native size of the image somehow. The default "set pixmap" uses is "native image size in pixel coordinates". But what I'd want usually is "native image size in plot axis coordinates", and this isn't available. I have to know the size, and to communicate it in the command with something like "first 300". Usually when talking about images, the y axis is flipped: the (0,0) pixel is the TOP-left not the BOTTOM-left. So "set pixmap at" should maybe place the top-left pixel of the image? In my usage I generally do "set yrange [:] reverse". But even in that usage "set pixmap at" places the bottom-left pixel. Among the same lines, it should be possible for the image pixel axes to follow the plot axes. In that mode "set yrange [:] reverse" would plot the image right side up, and with the default axis orientation, it would be upside down. "set pixel height" and "set pixel size" don't play nicely with "set yrange [:] reverse", so for instance this doesn't draw an image at all: set yrange [:] reverse set pixmap 1 "/tmp/front2.png" at 0,0 height 300 plot x "set pixel size" doesn't follow the docs, I think. The docs say it wants "set pixel size A B", while it actually wants "set pixel size A,B". Note the extra comma. I tried big images too. I THINK they work, but it's still really slow compared to any image viewer. Is that expected? Should it be faster than what "with rgbimage" does? Thanks for the feature! |