3

I am trying to plot a matrix plot with Gnuplot version 5.0 without interpolation between values.

I am using the following code and data from http://www.gnuplotting.org/tag/matrix/.

However, the image I does not produce discrete regions in the plot and instead interpolates between values. Why is the "with image" option not working?

code

set palette grey
plot 'color_map.dat' matrix with image

with the following data

0 1 2 3 4 3 2 1 0
0 1 2 3 4 3 2 1 0
0 1 2 3 4 3 2 1 0
0 1 2 3 4 3 2 1 0
0 1 2 3 4 3 2 1 0
0 1 2 3 4 3 2 1 0
3
  • Which output terminal do you use? Commented May 11, 2015 at 5:06
  • Your example works fine. Most probably, your problem is related to the viewer you are using, see e.g. stackoverflow.com/q/25736904/2604213 Commented May 11, 2015 at 10:45
  • I was using postscript. When I switched to svg it was working fine. Wierd! Commented May 14, 2015 at 2:10

1 Answer 1

2

I've been searching for this command for quite some time and stumbled across the answer recently. By using

plot 'color_map.dat' matrix u 1:2:3 with image pixels

one can keep the vectorgraphics (pdf) terminal.

The solution was taken from here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.