0

I need to make publication quality plots showing domains in parameter space bounded by various inequalities (f1(x,y)>0, f2(x,y)>0, ...) where some regions will satisfy several inequalities and should have blended flat colours.

There are various proposed methods of making inequality plots, but none of them seem to produce a great result:

  • Using a meshgrid with imagesc will introduce jagged edges (unless I use a ridiculously large matrix to reach print resolution).
  • Contourf(x,y,f1,[0 0]) and hold on almost gets what I want, except that it is apparently impossible to give the contoured regions transparency.
  • Using surf(x,y,f1), a white z=0 plane for clipping, and view(0,90) also looks good and enables transparency, but were I to plot two or more inequalities artefacts are introduced since the colour is different if f1(x,y)>f2(x,y) or f2(x,y)>f1(x,y).
  • Stacking axes on top of each other with the previous method fails since the clipping plane is not transparent.
  • Taking the countour matrix and filling using fill(C(1,:),C(2,:)) runs into trouble when the countour reaches the edge of the axes on two sides, since now 1,2, or even 3 corner points are lacking and the fill curve will be closed by a straight line crossing the image.

Anybody know a way of achieving this? Either by making transparent contourf regions, surfaces whose colours combine in the same way regardless of ordering, a way of z-clipping surfaces using a transparent clipping plane, or an algorithm that adds the necessary extra edge points to the fill contour.

  • 1
    "unless I use a ridiculously large matrix to reach print resolution". Print resolution is 300 dpi, or maybe 600 dpi if you want really fine lines. For a 2" (5 cm) square figure (one column width) in print you only need a 1200x1200 matrix. That is trivially small for a bitmap nowadays. – Cris Luengo Mar 01 '19 at 23:11
  • @Chris Luengo - Maybe I am oldfashioned, but turning what is essentially a line art problem into a bitmap feels very much like The Wrong Way. Still, I was amused to see that the output of a 7200x7200 plot only increased the final PDF size by 100 KB; the compression algorithm was fortuitiously suited for this kind of simple image. – Anders Sandberg Mar 02 '19 at 08:49
  • 1
    I agree that it would be nicer to have a vector graphic if possible. The bitmap route is sometimes the easiest, and it might not be worth the effort to do something a lot more complex. On the other hand, I didn’t understand what your plot is supposed to look like, so I didn’t want to comment on other alternatives. This is why I just left a comment, not an answer. – Cris Luengo Mar 02 '19 at 14:53

0 Answers0