Creating Circular Image Plots with Transparency in MATLAB

In summary, the conversation discusses how to create a circular image in MATLAB using a 500x500 matrix. The suggestion is to transform the x and y coordinates to polar coordinates and plot them using "plot3". The issue of not plotting anything outside the circular region is also addressed, with the solution involving using the alpha data of the object. The conversation ends with the individual successfully solving the problem by using a ROI to make part of the image transparent.
  • #1
mikeph
1,235
18
Hi,

Just came across this as an image in a book/monograph and it looks very MATLAB-esque, except I cannot figure out how to possibly create a circular image

fig6.4r.jpg


Say I have a 500x500 matrix and want to plot it as a colour image in this way. Does anyone know how? I've been re-reading the same help files again and again with no progress.
 
Physics news on Phys.org
  • #2
transform the x and y coordinates to polar coordinates and plot the new coordinates,
plot3(cos(x), sin(y));
 
  • #3
Thanks for the reply, I don't fully understand how to apply it to my problem (never been strong on plot tools), my image has no coordinates, it's just a 500x500 matrix. I don't need the axis, just for the plotter to not plot anything outside a circular region. Currently I'm using pcolor with "EdgeAlpha" to zero so it looks very similar to that image I linked, but it's a square.
 
  • #4
Hi, just need to bump this, I still don't understand how to do this.
 
  • #5
One more bump, I still can't find an answer, thanks

I really just need to know how to make the non-circle area white, at the moment I'm fiddling around with colour maps and manually changing the values to force it to look white, but it has side-effects.
 
Last edited:
  • #6
Bumping to say I solved the problem.

The solution lies in the alpha data of the object.

For example you can use a ROI to make part of the object transparent, using

set(gco,'AlphaDataMapping','scaled','AlphaData',ROI)

Where ROI = 1 the image will stay opaque and where it is 0 the image will be transparent.
 

Related to Creating Circular Image Plots with Transparency in MATLAB

What is a circular image plot in MATLAB?

A circular image plot in MATLAB is a data visualization technique that displays data in a circular format. It is commonly used to represent polar data or data that has a circular or periodic nature.

How do I create a circular image plot in MATLAB?

To create a circular image plot in MATLAB, you can use the "polarplot" function. This function takes in polar coordinates (theta and rho) as input and plots the data in a circular format.

What types of data are suitable for a circular image plot?

Circular image plots are suitable for data that has a circular or periodic nature, such as data from a circular sensor or data that repeats over time. They are also commonly used for displaying directional data, such as wind direction or ocean currents.

Can I customize the appearance of a circular image plot in MATLAB?

Yes, you can customize the appearance of a circular image plot in MATLAB by using various options in the "polarplot" function. You can change the line style, color, and thickness, as well as add labels and legends to the plot.

Are there any alternatives to a circular image plot in MATLAB?

Yes, there are alternative methods for visualizing circular or polar data in MATLAB, such as using the "compass" function or creating a custom polar plot using the "polaraxes" function. You can also use other data visualization techniques, such as bar charts or scatter plots, to display circular data in a different format.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
Back
Top