Questions tagged [matlab-figure]

MATLAB is a high-level language and programming environment developed by MathWorks. This tag relates to the creation and manipulation of graphical plots and visualizations in MATLAB figures. For questions on the creation of graphical user interface (GUI) applications in MATLAB, consider using [tag:matlab-gui], [tag:matlab-guide] or [tag:matlab-app-designer].

MATLAB is a high-level language and programming environment developed by MathWorks.

This tag relates to the creation and manipulation of graphical plots and visualizations in MATLAB figures. For questions on the creation of graphical user interface (GUI) applications in MATLAB, consider using , or .

Additional sources of technical information on these topics include:

3812 questions
11
votes
4 answers

Write a figure to a file automatically in MATLAB

Does anyone know if it's possible to automatically write a figure out to a .eps file in MATLAB? I'm running a script that produces a large number of graphs, and it'd be nice if I didn't have to manually save each one!
Ed James
  • 10,385
  • 16
  • 71
  • 103
11
votes
2 answers

How I obtain bars with function bar3 and different widths for each bar?

I have the code: values = [1.0 0.6 0.1; 0.0 1.0 0.3; 0.9 0.4 1.0]; h = bar3(values); shading interp for i = 1:length(h) % Get the ZData matrix of the current group zdata = get(h(i),'Zdata'); …
JMSH
  • 1,268
  • 2
  • 9
  • 10
11
votes
3 answers

Disable plots in Matlab

I have some programs written in Matlab that I need to run several times for some reasons (debugging, testing with different input, etc...) But, there are a lot's of graphs that are plotted by the programs and its various functions such that…
Mesop
  • 5,187
  • 4
  • 25
  • 42
10
votes
6 answers

Semi-transparent markers in Matlab Figures

I want to plot a scatter plot with filled markers and make them semi-transparent so when two or more markers overlap, the overlapping area will be more opaque. I naively thought sg = scatter(rand(1000,1),rand(1000,1), 'filled'); alpha(0.5) would…
Ruggiero Spearman
  • 6,735
  • 5
  • 26
  • 37
10
votes
1 answer

How can I let my stack overflow?

I want to make a bar chart in Matlab, where one of the categories is "breaking through the roof" of the axes, over the y-axis limit, but I can't figure how to do this. When I change the upper limit to a lower value, the bar gets trucked. What can I…
EBH
  • 10,350
  • 3
  • 34
  • 59
10
votes
1 answer

How to have a common legend for subplots?

I am trying to create a figure of subplots. I don't want the subplots to have legends but instead the figure to have an overall legend. I read that it is possible either by adding a legend only to the last subplot and adjusting its location in the…
Whitebeard13
  • 411
  • 1
  • 7
  • 17
10
votes
1 answer

How to set x and y values when using bar3 in Matlab?

Quick version How can I control the x- and y-values for a 3-d bar plot in Matlab? Details Say we have an 10 x 20 data matrix and we plot it using bar3, and we want to set the x- and y-values. For instance: foodat = rand(10,20); xVals =…
eric
  • 7,142
  • 12
  • 72
  • 138
10
votes
1 answer

How do I access the new value of an PropertyEvent in MATLAB R2014b?

Background In previous versions of MATLAB (e.g. R2013b), I had a neat trick where I would attach a listener to an axes handle's YLim property, which would notify me when the axes y-limits were changed: addlistener(gca, 'YLim', 'PreSet',…
KQS
  • 1,547
  • 10
  • 21
10
votes
4 answers

Interpolate surface of 3D cylinder in Matlab

I have a dataset that describes a point cloud of a 3D cylinder (xx,yy,zz,C): and I would like to make a surface plot from this dataset, similar to this In order to do this I thought I could interpolate my scattered data using TriScatteredInterp…
space-dementia
  • 307
  • 1
  • 5
  • 10
9
votes
2 answers

Why is Matlab placing text spaces in legend using Latex when the figure gets saved as a PDF?

I am trying to put a legend in Matlab figures that include a symbol in Latex. When I plot the figure, the legend looks fine. However, when I export the figure as a PDF, the legend gets spaces put into it. I don't know why this is happening. Sample…
Lou
  • 1,113
  • 3
  • 9
  • 22
9
votes
2 answers

Major and minor graticule for maps?

I have created the following map, which has a uniform gray grid with 1° intervals both for meridians and parallels: I would also like to have the meridians and parallels thicker and in black for every 5° interval (while keeping the 1° grid), so…
codeaviator
  • 2,545
  • 17
  • 42
9
votes
3 answers

How to set the origin to the center of the axes in Matlab

When I plot a function f(x) in Matlab, for example, the sine function, the graph I get is this: I want to plot it in a rather different way, such as this, generated with Mathematica: Note the axes position (together with the ticks), and the x and…
E Be
  • 167
  • 1
  • 2
  • 8
9
votes
1 answer

Replace quiver arrowheads with images

I have a circular lattice and on the lattice sites I plot normalized arrows that remain in the same magnitude and change direction according to a simulation, the details of which don't matter. My plots look like this Is it possible to replace the…
jarhead
  • 1,821
  • 4
  • 26
  • 46
9
votes
2 answers

How to set the opacity for a plot?

I have some data to be plotted in one figure. Noise data is ruining other data. How can I change the transparency level of a given data? In my case, I'm using hold all command for plotting several data. One of the solution is to change the LineWidth…
CroCo
  • 5,531
  • 9
  • 56
  • 88
9
votes
1 answer

colormap/datatip issue in Matlab figure

I run this code A = uint8( ones( 200 ) ); a = [ A * 0 A * 1; ... A * 2 A * 3 ]; color_map = [ 0 0 0; ... 0.3 0.3 0.3; ... 0.9 0.3 0.1; ... 1 1 1; ... zeros( 252, 3 )…
David
  • 91
  • 1