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…
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…
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…
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…
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…
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:
…
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?
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…
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…
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…
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)
…
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 <-…
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…
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…
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…