Questions tagged [axes]

Axes - plural of axis

Axes is plural of axis used in Cartesian coordinate system.

1002 questions
10
votes
1 answer

matplotlib axes.set_aspect('equal') doesn't behave like expected

I need a figure in matplotlib where both axes are always the same length. For this I am using the option 'equal'. In most cases it works quite well and I get the expected results (see figure 1), but when the values of the y-axis are much higher…
fidelitas
  • 1,113
  • 2
  • 12
  • 14
10
votes
1 answer

In Matlab how can I exchange the horizontal and vertical axes of an existing plot

Suppose I have vectors x and y, I know I can do plot(x,y) or plot(y,x) to achieve what I want. However, my question is specifically: If I have a plot already created in a figure as plot(x,y), how can I programmatically exchange the horizontal and…
Isopycnal Oscillation
  • 3,234
  • 6
  • 21
  • 37
10
votes
1 answer

how to fix axes position by using set_position method in python matplotlib?

I think this is quite easy but I searched the internet and matplotlib users mailing list and not able to find an answer. ax2 is an inset axes within the "ax" axes in figure "fig", which I make by following…
wiswit
  • 5,599
  • 7
  • 30
  • 32
9
votes
2 answers

gganimate with changing scales (axis limits)

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…
Megatron
  • 15,909
  • 12
  • 89
  • 97
9
votes
1 answer

How to use ax.get_ylim() in matplotlib

I do the following imports: import matplotlib.pyplot as plt import matplotlib.axes as ax import matplotlib import pylab It properly executes plt.plot(y1, 'b') plt.plot(y2, 'r') plt.grid() plt.axhline(1, color='black', lw=2) plt.show() and shows…
user1067305
  • 3,233
  • 7
  • 24
  • 29
9
votes
1 answer

XPath element which contains an attribute and whose parent's parent contains another attribute

This is my first post here and since I've seen many great answers I thought I'd give it a try. I'm trying to use XPath to obtain a specific element in an HTML document. Here is an example based off of the Google web page: …
gtaborga
  • 773
  • 3
  • 13
  • 18
9
votes
2 answers

Is it possible to link the axes of two surface plots for 3d-rotation?

Say I have two 2-dimensional matrices of equal size and create a surface plot for each of them. Is there a way to link the axes of both plots, so that one can 3D-rotate both of them simultaneously in the same direction?
bluebox
  • 555
  • 1
  • 8
  • 19
9
votes
2 answers

How do I scale the x and y axes in mayavi2?

I want to do a 3-d plot with mayavi2 using mayavi.mlab.surf(). This function has an argument called warp_scale that can be used to scale the z axis, I'm looking for something similar but for the x and y axes. I can do this manually by multiplying…
andres
  • 1,079
  • 1
  • 10
  • 17
8
votes
1 answer

Python matplotlib -> 3D bar plot -> adjusting tick label position, transparent bars

I am trying to create a 3D bar histogram in Python using bar3d() in Matplotlib. I have got to the point where I can display my histogram on the screen after passing it some data, but I am stuck on the following: Displaying axes labels correctly…
Dman
  • 105
  • 1
  • 2
  • 5
8
votes
3 answers

How to add subtext to axes in ggplot2 R

For the main y-axis and x-axis, I have generic titles like "Tank's Ratio" and "Counts". I want a second line of label where I specify the ratio and counts. eg. Just below "Tank's Ratio" I want "# in water/# in sand" in a smaller font but along the…
Rspacer
  • 2,369
  • 1
  • 14
  • 40
8
votes
2 answers

How to force same size between matplotlib subplot image axes

Suppose I have the following code to create three side-by-side images: n=10 x = np.random.rand(n,1) y = np.random.rand(1,n) z = np.random.rand(n,n) fig, ax = plt.subplots(1, 3) ax[0].imshow(x) ax[1].imshow(z) …
dkv
  • 6,602
  • 10
  • 34
  • 54
8
votes
1 answer

How to use sec_axis() for discrete data in ggplot2 R?

I have discreet data that looks like this: height <- c(1,2,3,4,5,6,7,8) weight <- c(100,200,300,400,500,600,700,800) person <- c("Jack","Jim","Jill","Tess","Jack","Jim","Jill","Tess") set <- c(1,1,1,1,2,2,2,2) dat <-…
Share
  • 395
  • 7
  • 19
8
votes
2 answers

Matlab axes scaling

how exactly do you get fixed scaling of axes in Matlab plot when plotting inside a loop? My aim is to see how data is evolving inside the loop. I tried using axis manual and axis(...) with no luck. Any suggestions? I know hold on does the trick, but…
meu
  • 83
  • 1
  • 1
  • 4
8
votes
1 answer

Gnuplot: more than 2 datasets in single plot with 2 y-axes

I have multiple datasets I want to plot in a single figure: plot "data1a.txt", "data1b.txt", "data1c.txt", "data2.txt" I want to have two y-axes with different ranges. yrange=[0:10] y2range=[-10:10] This is easily done on gnuplot if you only have…
Eddy
  • 6,661
  • 21
  • 58
  • 71
8
votes
1 answer

JFreeChart domain/range axes defined

Could somebody provide a simple explanation of the JFreeChart axis-types? First, we have the axes that are based on the class hierarchy (ValueAxis, CategoryAxis, lots of subclasses) We also have the "domain axis" versus "range axis" distinction…
lbalazscs
  • 17,474
  • 7
  • 42
  • 50