简体   繁体   中英

Plotting data with meshgrid

When you use meshgrid to plot data (using meshgrid itself not one of the other plotting functions), how do you change the color to grayscale or black and white? Also, how do you get rid of the "meshy" look of the image?

To change the colour to greyscale you can use:

colormap(gray);

As for the 'meshy' look, I'm not 100% sure what you mean; but I'm assuming whatever you've created is looking pixelated? If so, decrease your mesh spacing:

From

x = meshgrid(-25:25);

To

x = meshgrid(-25:0.5:25);

I don't know if it works for meshgrid, but if you use surf , you can specify

shading interp

to get rid of the 'meshy' look.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM