figure

How do you add math symbols in colorbar ticks

夙愿已清 提交于 2019-12-23 08:38:04
问题 I can get the colorbar ticks as figure; hbar=colorbar; ticks=get(hbar,'ytick'); Now how do I set the tick labels at tick(end) to be ∞ ? 回答1: This is tricky. Normally, for axes labels and titles you can use TeX or LaTeX formatting since they are text objects and thus have an 'Interpreter' property: xlabel('\infty'); %# Label the x axis with an infinity However, axes objects themselves don't appear to have a way to use Tex or LaTeX formatting for their tick labels. One solution is to download

How do you add math symbols in colorbar ticks

↘锁芯ラ 提交于 2019-12-23 08:37:53
问题 I can get the colorbar ticks as figure; hbar=colorbar; ticks=get(hbar,'ytick'); Now how do I set the tick labels at tick(end) to be ∞ ? 回答1: This is tricky. Normally, for axes labels and titles you can use TeX or LaTeX formatting since they are text objects and thus have an 'Interpreter' property: xlabel('\infty'); %# Label the x axis with an infinity However, axes objects themselves don't appear to have a way to use Tex or LaTeX formatting for their tick labels. One solution is to download

Automatic saving a figure as an image file in Matlab

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 08:38:47
问题 I'm creating 49 figures in Matlab, they are all created automatically one after the other. I want them to also automatically be saved as .tif or .jpg images with names corresponding to their figure number. Can I do it? And if so,how? the code for the creation of the figures is: for num_picture=0:48 ... figure (num_picture+1) imshow (screen_im) end The ... part is where all the calculations of screen_im are. I want those images in order to create a movie from them, If there is a way where I

Large matplotlib pixel figure best approach

血红的双手。 提交于 2019-12-22 07:08:13
问题 I have a large 2D dataset where I want to associate to each X,Y pair a color and plot it with matplotlib. I am talking about 1000000 points. I wonder what is the best approach in terms of performance (speed) and if you could point to some example 回答1: If you're dealing with a regular grid, just treat it as an image: import numpy as np import matplotlib.pyplot as plt nrows, ncols = 1000, 1000 z = 500 * np.random.random(nrows * ncols).reshape((nrows, ncols)) plt.imshow(z, interpolation='nearest

star symbols in gnuplot

不想你离开。 提交于 2019-12-21 20:53:48
问题 I'm trying to generate an .eps figure in gnuplot using set terminal postscript eps enhanced color solid I want to include in my figure a title for a plot containing some star symbols, e.g ★ ☆ I tried through this: plot "./mydata" u 1:2 title "★ ☆" as well as this: stars = sprintf("★ ☆") plot "./mydata" u 1:2 title stars but both of them don't work. Any ideas? 回答1: set term postscript enh color eps set output 'test.eps' set title 'star1:{/ZapfDingbats \110} star2:{/ZapfDingbats \111}' plot sin

Text and background-color overlay on image

ⅰ亾dé卋堺 提交于 2019-12-21 13:04:22
问题 I'm trying to create a solid-color overlay that exactly matches the size of an image, and display text on that overlay. I'd like to do this with HTML and CSS only, if possible. The image may be of any size, and will be sized to fit and centered within its parent container. Something like this (which does not work): HTML: <div class="img-overlay"> <img src="file.jpg"> <div class="overlay">Text will flow...</div> </div> CSS: .img-overlay img { margin: 0 auto; max-height: 100%; } .overlay {

How to tell legends from axes in Matlab?

[亡魂溺海] 提交于 2019-12-21 01:12:12
问题 The following stackoverflow qestion: Matlab: How to obtain all the axes handles in a figure handle? identifies how to get handles to all of the axes from a figure in Matlab. However, this list will also contain handles to legends, at least in R2008a, which appear to also be axes. How can I tell (programatically) the legends from the real plot axes in a vector of axes handles? 回答1: From linkaxes , the code you want is: ax = findobj(gcf,'type','axes','-not','Tag','legend','-not','Tag','Colorbar

How to tell legends from axes in Matlab?

这一生的挚爱 提交于 2019-12-21 01:12:09
问题 The following stackoverflow qestion: Matlab: How to obtain all the axes handles in a figure handle? identifies how to get handles to all of the axes from a figure in Matlab. However, this list will also contain handles to legends, at least in R2008a, which appear to also be axes. How can I tell (programatically) the legends from the real plot axes in a vector of axes handles? 回答1: From linkaxes , the code you want is: ax = findobj(gcf,'type','axes','-not','Tag','legend','-not','Tag','Colorbar

In matlab, how do you save a figure as an image in the same way as using “Save As…” in the figure window?

时光总嘲笑我的痴心妄想 提交于 2019-12-20 22:02:30
问题 When saving a figure, what function does Matlab use? For example, when a user selects File > Save As... and then selects .png or another image format, what is going on behind the scenes? I am asking because I am trying to automate saving, but when I use saveas or print , the resulting image is really pixelated. However, the image looks really good when I save the figure using the method described above. What method should I use to save my figure from the command line? The actual method that

Matplotlib figure/plot/canvas/layout hides buttons

依然范特西╮ 提交于 2019-12-20 05:27:22
问题 Matplotlib figure/plot/canvas/layout hides buttons. The picture should explain the problem: I would like the container of the plot to leave space for the buttons on the right. Here is a minimal working code example with some commented things that I tried: import sys from PyQt5.QtWidgets import QPushButton, QVBoxLayout, QApplication, QDialog from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as