axes

Save axes handle when plotting In MATLAB

一世执手 提交于 2019-12-11 11:57:30
问题 I have script handling figures so that I can print and input them in a latex document with scale = 1 and everything looks nice. In this context I want to save the figure, axes and legend handles. Is there a way to save them like when using fig = figure . I know two 'hacks' 1) nfig = nfig+1; fig = figure(nfig); plot() ax = gca leg = legend() 2) nfig = nfig+1; fig = figure(nfig); ax = subplot(1,1,1) plot() leg = legend() My script function fig_set(fig,ax,leg,width,heigth,font_size) %% fig_set

Highcharts: make the X and Y axes intersect at 0

随声附和 提交于 2019-12-11 11:14:35
问题 I'm trying to make the X and Y axes of my chart intersect at 0, always . Currently, I'm intercepting the 'load' event and then changing the offset of the axes which works initially, but when the window is resized or the chart is zoomed in, the axes don't update. How can I keep the axes centred on 0 even when the window is resized or the chart zoomed? Here's my fiddle and code: http://jsfiddle.net/a003mc4b/ $(function () { $('#container').highcharts({ chart: { type: 'scatter', zoomType: 'xy',

When should you use ax. in matplotlib?

别说谁变了你拦得住时间么 提交于 2019-12-11 08:04:48
问题 I still don't understand the best usage of fig, plt. and ax. in matplotlib Should I be using plt. all the time? When should ax. be used? 回答1: Use fig and ax are part of the object oriented interface and should be used as often as possible. Using the old plt interface works in most cases too, but when you create and manipulate many figures or axes it can become quite tricky to keep track of all your figures: plt.figure() plt.plot(...) # this implicitly modifies the axis created beforehand plt

Enable white frames on matplotlib figure/ Disable transparent frames

↘锁芯ラ 提交于 2019-12-11 06:34:30
问题 I'm running ipython notebook on a dark theme. When I build a chart on this, the chart is white, but the frame is transparent (hence dark), hiding the ticks which are also dark. Is there a way to make the frame not transparent/ white? The ticks are barely visible due to black background. How do I solve this? Thanks! Edit: This is not about changing the colors of axis, ticks/labels, I'm thinking of adding a white background frame, not changing the colors of ticks - it'll be ugly if I just

Matplotlib: generate multiple twin axes with different and inverted scale

跟風遠走 提交于 2019-12-11 03:53:00
问题 I want to plot a data series on two x and y axes in order to have 4 different axes. First the x (energy in eV) vs. the y (normalized counts) axis and then x (wavelength which is inversely related to energy) vs. y (counts) axis. My code for this is: import numpy as np import matplotlib.pyplot as plt import matplotlib.mlab as mlab from scipy.constants import h, c, e def E(wavelength): return (h*c)/(wavelength*e) wavelen = np.linspace(800e-9,1600e-9,200) E_eV = E(wavelen) loc, scale = 950e-9, 3

How to determine if axes are 2D or 3D in Matlab?

北慕城南 提交于 2019-12-11 03:39:29
问题 As stated, what is the easiest way to determine programmatically if a Matlab axes object is a 2D or 3D plot? 回答1: Examine the output of [az,el] = view . If it's 2D, then el == 90 . 回答2: use: numel(axis)/2 it will return 2 for 2d and 3 for 3d. 来源: https://stackoverflow.com/questions/8064969/how-to-determine-if-axes-are-2d-or-3d-in-matlab

gganimate with changing scales (axis limits)

岁酱吖の 提交于 2019-12-11 03:03:52
问题 I'd like to create a gif using gganimate , but my axis ranges vary wildly in one frame. This is causing all subsequent frames to be squeezed. In ggplot2 's facets, there's an option to have scales="free" . Is there a way to have free scales in each frame of gganimate ? Here's an example: library(gapminder) library(ggplot2) library(gganimate) theme_set(theme_bw()) p <- ggplot(gapminder, aes(gdpPercap, lifeExp, size = pop, color = continent, frame = year)) + geom_point() + scale_x_log10()

JFreeChart Link Axes

夙愿已清 提交于 2019-12-11 01:00:59
问题 I have created a Frame with two independent separate JFree charts (held in a 2x1 Grid layout). The top chart shows a Canlestick chart, the bottom a time series plot. What I would like to do is link the displayed X-Axis of both charts so that when I zoom in on one chart the other chart zooms to the corresponding time period. Is this possible? If so could you give me an example 回答1: What you need is called CombinedDomainXYPlot . Instead of creating independent JFreeChart objects you will need

Getting ticks in figure with subplots

十年热恋 提交于 2019-12-10 23:38:13
问题 I have a complicated figure made in matplotlib with three subplots, two of which have twin axes. It works well except there are no tick marks in the figure and I can't figure out how to get them. Here is the code and figure: fig = plt.figure() gs = gridspec.GridSpec(3, 1) idx=0 n=len(d_10[idx]) fac=0.2 ax1=fig.add_subplot(gs[0,0]) ax1.errorbar(range(n),d_10[idx]["abs(Overlap)"][0:n],yerr=d_10[idx]["ErrOverlap"][0:n],ms=4,mew=0.7,marker="o",ls='none',elinewidth=0.7,capsize=3,fillstyle='none'

Mayavi, python axes INDICATOR

血红的双手。 提交于 2019-12-10 17:45:12
问题 does anyone know how to switch on the axes INDICATOR in python code? I can switch it on when the graph is plotted, but I wanna know how to do it in code. I have found only how to switch on the axes: mlab.axes() but it is not the indicator (I mean that three arrows X,Y and Z) Thank you 回答1: The following code switches on the axes indicator: mlab.orientation_axes() 来源: https://stackoverflow.com/questions/26034560/mayavi-python-axes-indicator