matlab-figure

Plotting issues with dash-dot and dotted lines: How to modify default linestyles for better use with vector renderer 'painters'?

主宰稳场 提交于 2020-01-12 08:27:11
问题 Matlab offers the following default linestyles: '-' Solid line (default) '--' Dashed line ':' Dotted line '-.' Dash-dot line The first two are alright, the third : is absolutely not my taste and rendered badly and the last one -. is just usable with pixel renderers ( openGL , zbuffer ), otherwise it looks the same as -- . But I'd like to render my graphs with painters for countless reasons. This way the dash-dot line becomes useless: The dash-dot lines (blue, bright red) practically look the

In Matlab, how to draw lines from the curve to specific xaxis position?

戏子无情 提交于 2020-01-11 12:03:25
问题 I have a spectral data (1000 variables on xaxis, and peak intensities as y) and a list of peaks of interest at various specific x locations (a matrix called Peak) which I obtained from a function I made. Here, I would like to draw a line from the maximum value of each peaks to the xaxis - or, eventually, place a vertical arrow above each peaks but I read it is quite troublesome, so just a vertical line is welcome. However, using the following code, I get "Error using line Value must be a

matlab: using the GPU for saving an image off a figure

天大地大妈咪最大 提交于 2020-01-11 11:43:11
问题 I use matlab to render a complex mesh (using trimesh, material, camlight, view...) and need not display it to the user, just to get the rendered image. This is discussed in another question. Using any of the suggested solutions (save-as image, saving into a video object, and using undocumented hardcopy ) is very slow (~1sec), especially compared to rendering the plot itself, including painting on the screen takes less than 0.5sec. I believe it is caused by hardcopy method not to utilize the

Obtain full size of colorbar in Matlab

回眸只為那壹抹淺笑 提交于 2020-01-11 07:19:09
问题 I am writing a plot automation routine for Matlab. However, I am having issues to assess the (horizontal) size of colorbars. I can use the following to get the size of the colorbar: cb = findall(groot,'Type','colorbar'); % get colorbar xwidth = cb.Position(3); This will give me the horizontal size of the colorbar, but EXCLUDES labels and tick labels. Do you have an idea how to obtain the full size of both the bar and the labels? Thanks in advance 回答1: In versions of MATLAB prior to R2014b, a

Why isn't this MATLAB class holding on to its properties?

无人久伴 提交于 2020-01-11 07:10:50
问题 There must be something very simple that I'm missing here. I have a MATLAB class which creates a figure containing two push-buttons, each button calls the same function, but the handles for those buttons aren't retained within that function, and I don't know why. Here's the class, simplified... classdef Test properties Figure ButtonA ButtonB end methods function app = Test() app.Figure = figure(); app.ButtonA = uicontrol('Style', 'pushbutton', ... 'String', 'Button A', ... 'Position', [10, 10

Write a figure to a file automatically in MATLAB

依然范特西╮ 提交于 2020-01-11 00:21:07
问题 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! 回答1: print function does that: Print figure or save to specific file format... print(filename,formattype) saves the current figure to a file using the specified file format, such as print('BarPlot','-dpng') . If the file name does not include an extension, then print appends the

MATLAB scatter with tooltip showing other kinds of data and connecting points with arrowhead

醉酒当歌 提交于 2020-01-10 04:37:25
问题 I want to ask two questions here. In short they are, In a scatter plot in MATLAB how can I click a point using the tooltip and get not the x,y data but some other sort of data associated with the x,y point? Right now I have a workaround using gscatter and a file from file-exchange (see below). But it will get messy for large data sets. How do I connect two points with an arrowhead on the line between them? For example in the rlocus plots MATLAB makes, there is a nifty little arrowhead. Is

How to merge two figure files into a single file

女生的网名这么多〃 提交于 2020-01-09 19:13:46
问题 This should be a problem with a trivial solution, but still I wasn't able to find one. Say that I have 2 matlab figures fig1.fig , fig2.fig which I want to load and show in the same plotting window. What should I do? I mean, I am pretty sure that I can accomplish the task using some low(er) level graphic command which extracts contents from one image and put them in the second one, nonetheless I cannot believe that there is not any high level function ( load fig2 on top of fig1 ) that does

Concatenating 2D plots

情到浓时终转凉″ 提交于 2020-01-09 11:53:10
问题 I have several 2D-plots in MATLAB. In each plot there are some lines (each line is a row-vector of values of fixed length). There is always a base line (black one) and the remaining colored lines may or may not be present. , . I need to concatenate all such plots into one plot as shown below: Please note these are just for representational purpose but explain my problem well. I am not able to figure how to do it. Anybody got an idea? An example may be? Also, there has to be a vertical gap

Bar plot switch colors in Matlab

£可爱£侵袭症+ 提交于 2020-01-07 08:23:14
问题 I have the following code in Matlab, which produces a useful plot for me. Now I'd like to make the plot comparable color wise with another plot. For this reason, some colors should be switched: colors for... 'Pre split total EON' with 'Post split total EON' 'Pre split pure EON' with 'Post split pure EON' 'Pre split total RWE' with 'Post split total RWE' 'Pre split pure RWE' with 'Post split pure RWE'. That is all, but I do not know how to do it, since the colors are assigned automatically...