axes

Matplotlib bar charts: Aligning two different y axes to zero

一个人想着一个人 提交于 2019-12-12 03:32:32
问题 I have two sets of data in a barchart which have very different axes: one is very negative (-7500) and one is slightly positive (+5). How can I have the two y axes aligned at 0, yet still be a good size? Using set_ylim means you can't see the second data set. Current code I'm using: A165H = [-4915, -7037] B167H = [-6927, -4105] B186H = [-5597, 0] CH =[0, 0] ConH = [0, 0] # Lists of dS values A165S = [6.28,-4.91] B167S = [-3.25, 6.7] B186S = [3.93, 0] CS = [0, 0] ConS = [0, 0] N1H = [A165H[0],

Change range withouth scaling in matplot

柔情痞子 提交于 2019-12-12 03:27:45
问题 I have a question, I am making a program that displays a zoomed area of Peru but the axis shown are in the range of the image (e.g. 7000x7500) but i want to be in UTM range (e.g. x-axis between 500000-600000 and y-axis 9500000-9700000) I have tried using plt.set_xlim and plt.sety_lim but no success, I think I have to use plt.autoscale(False) but it also didn't work or I used it wrong. I create the figure and axes out of the main program f = plt.figure(figsize=(5,5)) axe = f.add_axes([0, 0, 1,

ZoomRange Highstock works not correct?

倖福魔咒の 提交于 2019-12-12 02:38:04
问题 I made a Highstock diagramm and got aproblem with zooming on the yAxis. I have a Button and 2 textfield to get the wanted min/max values for the axis. With min:0, max: 100 it works well. With min:0, max:80 it doesn't (max will still be 100 in the Diagramm). If I use the mouse for zooming it works well (even a min of: 3.7 and a max of 3.894 is possible). But using the mouse is not an Option, because in the later Diagramm there will be 3 yAxes with individual zoom. $(function () { var

Linkaxes for all subplots in a for loop

两盒软妹~` 提交于 2019-12-12 02:19:34
问题 I am having difficulty making all of my subplots in a (3,4,i) plots have exactly the same axes, all starting at zero. The code I have so far is below but it returns all subplots with varying x and y scales. Can anybody help? %% plot for i = 1:num_bins; h = zeros(ceil(num_bins),1); h(i)=subplot(4,3,i); plotmatrix(current_rpm,current_torque) end linkaxes(h,'xy'); axis([0 30 0 8]); 回答1: You should move the memory allocation outside of the loop: %% plot h = zeros(ceil(num_bins),1); for i = 1:num

double axis used in matlab

拥有回忆 提交于 2019-12-12 01:39:20
问题 I am using a plotyy in matlab to plot two data set in a same figure. The left and right axis are of the different range. But I just find that on the right axis, there seems to be two different set of scale shown. I think one of them is really from the left axis. t=-1:0.02:1; y=sin(t); y1=2*sech(t); [AX, H] =plotyy(t, y, t, y1); ylim(AX(2), [0 3.25]); set(AX(2), 'YTickMode', 'auto') After searching that online, I found that to turn off the box will solve the problem too. But the problem is to

How can I change the default x-axis title in love.plot of cobalt package in R?

情到浓时终转凉″ 提交于 2019-12-12 00:51:25
问题 I would like to ask a simple question that I cannot find out the answer for. How can I change the default x-axis title in love.plot() ? I made several codes of ggplot2 that could be used for the same purpose but failed to replace the Default x-axis title with new one that I want. My code for it was like follows : love.plot(bal.tab(Procedure~Age+Gender+NYHA, data=impdata, weights='wt'), threshold = .1) 来源: https://stackoverflow.com/questions/49873861/how-can-i-change-the-default-x-axis-title

Fixing the axes while animating in matlab (not allowing them to change)

不想你离开。 提交于 2019-12-11 18:45:58
问题 I am trying to animate a cube (i wish there was a function for cube along the lines of cylinder() ) moving in 3d space. It has both rotation and translation. While I succeeded in animating, the axes seems to be scaling dynamically. I would like them to stop. I want to fix the axis limits. i want the axis to be constant from the beginning to the end. I am new to animating. I got a piece of code from the internet that demonstrates animating demo prog : http://pastebin.com/fbv9gDS2 I edited that

plotfile not using correct axes, annotation problem

一个人想着一个人 提交于 2019-12-11 17:56:11
问题 I came across a weird behaviour when using matplotlibs plotfile function. I wanted to annotate a plot of a file, text.txt , which contains: x 0 1 1 2 3 using the following code: import matplotlib.pyplot as plt fig, ax = plt.subplots() annot = ax.annotate("Test", xy=(1,1)) plt.plotfile('test.txt', newfig = False) plt.show() This gets me the following, weird looking plot with axis labels all over the place and the annotation in the wrong (relative to my data) place: However, when I use fig =

How to point each plot to correct y axis (many plots, two y axes, in R with ggplot2)

杀马特。学长 韩版系。学妹 提交于 2019-12-11 17:28:17
问题 So I have compared two groups with a third using a range of inputs. For each of the three groups I have a value and a confidence interval for a range of inputs. For the two comparisons I also have a p-value for that range of inputs. Now I would like to plot all five data series, but use a second axis for the p values. I am able to do that except for one thing: how do I make sure that R knows which of the plots to assign to the second axis? This is what it looks like now. The bottom two data

How make the x-axis a base-2 logarithm in R with magicaxis?

蹲街弑〆低调 提交于 2019-12-11 12:26:18
问题 Magicaxis lets you unlog an axis: library(magicaxis) plot(1:10, 1:10, axes=FALSE) magaxis(unlog='x') But this assumes a base 10 logarithm. How can you specify a different base? 回答1: author of magicaxis here. The new pre-CRAN version on my GitHub (asgr/magicaxis) has the new feature of specifying the log base. You can install this straight from GitHub using devtools. The argument is called powbase and defaults to 10. Let me know how this works for you. Aaron 回答2: The only part of the code the