Questions tagged [axes]
Axes - plural of axis
894
questions
0
votes
0answers
16 views
Limiting the axes on a mplot3d surface without the graph spilling from the figure?
I'm attempting to make a 3D surface plot of a spectrogram, but I want to limit the axes to a certain frequency and time range. I've tried the following:
fig = plt.figure(figsize=(1,1))
ax = mplot3d....
0
votes
1answer
579 views
x axes titles on subplots Plotly Python
I am trying to add the same titles on the x-axes and y-axes to four gantt charts that are displayed as subplots. I found online figs.update_layout() however, this only presents the title on the first ...
0
votes
0answers
20 views
python matplotlib: I need to change the xlabel postion from left tu right [duplicate]
I want to change the ylabel default postion:
plt.ylabel("NEW Ylabel", fontsize = 8) # loc = "right"
1
vote
0answers
31 views
jupyter notebook matplotlib\axes\_axes.py error
I have a problem with matplotlib\axes\_axes.py
If i run this:
OX = np.linspace(trainX['weight'].quantile(0.01), trainX['weight'].quantile(0.95), 100)
OY = (-1 * logreg.intercept_[0] - OX * logreg....
0
votes
0answers
16 views
How to delete the zero label on the axes when they are drawn in the center of the plot?
I have a plot with the axes drawn crossing in the center. How can I remove the zeros at the place where they cross?
1
vote
2answers
396 views
Overlay two ggplots with different x and y axes scales
Let's suppose I have two data.frames as follows:
df_1=data.frame(x=c(1:200), y=rnorm(200))
df_2=rpois(100000, 1)
df_2=data.frame(table(df_2))
df_2$df_2=as.numeric(levels(df_2$df_2))[df_2$df_2]
When ...
0
votes
1answer
401 views
d3js bar graph with x+y axes: x axis value distribution
I'm trying to show a vertical bar chart with x and y axes. I get the bar chart with y axis, however I'm struggling with the x-axis.
The x-axis text labels are equally distributed with the width of ...
4
votes
2answers
2k views
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="...
0
votes
1answer
205 views
python axes.ravel() IndexError: too many indices for array
I am trying to plot 2*2 images. with the code below.
fig, axes = plt.subplots(nrows=2, ncols=2)
ax = axes.ravel()
ax[0, 0].imshow(im1px, cmap='gray')
ax[0, 1].imshow(im2px, cmap='gray')
ax[1, 0]....
0
votes
1answer
412 views
pickling a matplotlib figure to reuse subplots
I'm attempting to take a script-generated figure, pickle it, and then load it later in a different scope to re-use some of the subplots in a new figure (by this I mean draw a new copy visually ...
1
vote
0answers
28 views
Plotting a png as background on a Log scale Plot
I have created an X/Y plot with data ranging for x=0.1 to 10 and Y=1.0 to 1000. Both scales are log10.
I would like to underlay an image that is also scaled to the same log values.
When I plot the png ...
1
vote
0answers
36 views
Create a plot with multiple axes on a uitab. Using addaxis in Matlab
I have created a tabbed Panel, in this Panel i want to create a Plot with multiple axes. To do this I am working with "addaxis" from https://de.mathworks.com/matlabcentral/fileexchange/9016-addaxis.
...
0
votes
0answers
51 views
How can Matplotlib axes be scaled hyperbolically?
I have a plot a bit like this:
The differences between the two lines (red and blue) are most important in my actual data (a ROC curve) at say the grid cell 0.2<x<0.4, 0.8<y<1. Now, I ...
3
votes
1answer
80 views
How to use nonlinear axes in Gnuplot?
I saw some examples like this one:
f(x) = log10(x)
g(x) = 10**x
set nonlinear x via f(x) inverse g(x)
So this one is equivalent to just log-scaling the x.
But I don’t get why we need to write the ...
0
votes
0answers
161 views
How to precisely set the axis position [duplicate]
I need to crop a plot so that the axes are precisely set on a known x and y line. coord_cartesian does not behave in this way (see below). So for instance, in the image below I would like the axis to ...
5
votes
1answer
6k views
Formatting a 3d bar plot in matplot lib
I am working with this code example
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np
data = np.array([
[0,1,0,2,0],
[0,3,0,2,0],
[6,1,1,7,0],
[0,5,0,2,9],
[...
1
vote
1answer
301 views
How to link axes of all plots in a Bokeh layout?
I am designing a Bokeh layout using the Bokeh server. I am defining two main columns (see attached image), and I am attempting to link the x-axis of all plots on the right column. The problems are ...
2
votes
1answer
467 views
Horizontal bar and line chart with multiple x-axes scales in bokeh
I'm attempting to plot a horizontal histogram and a timeseries of the data underlying the histogram on one chart. Naturally, this requires a shared y axis and two x axes - one for the histogram ...
0
votes
1answer
232 views
Principal axis form of Inertia tensor with eigen
I want to compute the principal axis form of an inertia tensor that stays consistent with changes of the inertia. Currently eigen outputs the computed eigenvalues(Ia,Ib,Ic) from smallest to largest, ...
0
votes
3answers
1k views
Point Cloud - Principal Axes - Use of Inertia
I have got point clouds of different primitive objects (cone, plane, torus, cylinder, sphere, ellipsoid). The all vary in orientation, position and scaling. Furthermore all of them are initialized ...
2
votes
0answers
89 views
MATLAB: Vertically align bottom edge of subplots/axes
The following code
fig = figure;
alist = [-0.1 1 4];
cp = 0;
for counter = 1:3
a = alist(counter);
fp = [(1+sqrt(1+4*a))/(-2*a) (1-sqrt(1+4*a))/(-2*a)];
fpmin = (abs(fp(1)-cp) < abs(fp(...
0
votes
0answers
25 views
How to get a 'z' limit of graph (Matplotlib)?
Is there any possibility to get 'z' limit values of 3D graph?
I know to get limits of axes 'x' and 'y' in 2D graph, xlim() and ylim() methods are used. I mean, I am looking for a method which return ...
1
vote
0answers
458 views
Matplotlib secondary_xaxis can't be formatted
I'm trying to get an "inverse" second x-axis to a x-axis in log-scale. secondary_xaxis works fine but I can't format the ticks as usually. Is this a bug or am I missing something?
Here's what I do:
...
1
vote
1answer
354 views
How to remove numerical x-ticks under custom labels in matplotlib's boxplot?
I want to plot multiple boxplots (using matplotlib in python3) into one figure and label them accordingly along the x axis. I have tried multiple methods to set custom x-ticks, but the old, numerical ...
0
votes
1answer
100 views
Change length of one (or however many) ticks
I'd like to change the tick length (tick beyond the plot frame) for an arbitrary tick.
I can set the visibility of just one tick (for example the second one) with
ax.xaxis.majorTicks[1].set_visible(...
0
votes
2answers
160 views
How to set figure axis range
How do I set the axes range after I create an figure? I want create a 2 inch by 1 inch figure with three circles next to each other. Currently I am trying to play around with the following a,b,c,d ...
3
votes
2answers
2k views
Change the order of the y-axis values
I'm using the ggplot R package, I did this plot with the code below:
p3 = data.frame(cbind(c(1:70),
c("G1" , "G2" , "G1" , "G1" , "G1" , "G2" , "G1" , "G1" , "G1" , "...
0
votes
0answers
31 views
Switching between axes when scattering in a loop
MATLAB
I want to scatter on two separate axes within a for loop when creating a video.
I want to do something like the following (currently incorrect code):
x = rand(1,100);
y = rand(1,100)*2;
z = ...
0
votes
0answers
26 views
y axes is not set Ascending [duplicate]
The problem is I don't know why the y-axes isn't set ascendingly or descendingly but randomly
I have a csv file and I read data from that file
import matplotlib.pyplot as plt
import csv
import ...
0
votes
1answer
70 views
FreeCodeCamp.org d3 bar chart axis alignment test is failing
I'm doing a d3 bar char project for FreeCodeCamp and the problem is that the bars are not aligning with the ticks on the x-axis.
The issue is that how the bars are off is not consistent from tick to ...
55
votes
1answer
69k views
What are the differences between add_axes and add_subplot?
In a previous answer it was recommended to me to use add_subplot instead of add_axes to show axes correctly, but searching the documentation I couldn't understand when and why I should use either one ...
0
votes
1answer
110 views
How can I show the upper and right axes in a bokeh plot?
I would like to always show the upper x-axis and right y-axis in my bokeh plots.
Is there a command to simply add these axes to the diagram?
1
vote
1answer
153 views
Matlab subplot linkaxes is not lining up the axes as expected
I can't seem to get linkaxes to work (code is below). I am trying to get the subplots to line up, such that visually the x-axis is has the same range and width for both subplots. The misalignment is ...
1
vote
1answer
57 views
How to changes axes size within a fix figure in python?
This code:
import matplotlib.pyplot as plt
fig = plt.figure(facecolor=(1, 0, 0, .1))
ax = fig.add_subplot(1,1,1)
plt.show()
Outputs a pink frame for the figure, with a white frame within it for the ...
20
votes
3answers
80k views
matplotlib: AttributeError: 'AxesSubplot' object has no attribute 'add_axes'
Not sure exactly sure how to fix the following attribute error:
AttributeError: 'AxesSubplot' object has no attribute 'add_axes'
The offending problem seems to be linked to the way I have set up my ...
2
votes
1answer
370 views
Matplotlib: How to remove a color bar the proper way?
I want to remove a color bar from an axes in that way that the axes will return to its default position.
To make it clear, have a look at this code (or better run it):
import numpy as np
import ...
3
votes
1answer
323 views
Understanding maplotlib and how to format matplotlib axis with a single digit?
I am having an very hard time getting the ticklabels of a seaborn heatmap to show only single integers (i.e. no floating numbers). I have two lists that form the axes of a data frame that i plot using ...
0
votes
1answer
63 views
Mouse axes are based on position, not movement
Basically, when I have my cursor in the center of the screen, the camera doesn't rotate. Pretty standard. However, If I move my cursor to the left or right, It will start rotating. Still makes sense. ...
0
votes
0answers
32 views
Setting axes to semilog with Mayavi 3D plot
I'm sucessfully generating a 3D plot with Mayavi, but can't find any way to rescale the axes to a semilog representation.
Is this possible?
I also tried taking a screenshot (as suggested by ...
0
votes
1answer
887 views
Controlling legend across multiple subplots with windrose axes
I cannot figure out how to make the legends not overlap with my figures (see below figure) in subplots. The problem is my axes are complicated because they are from a windrose. To get the axes:
1) I ...
1
vote
1answer
57 views
Port Matlab code involving matplotlib setting axes position in pixels
I would need to port this code from matlab to python:
fig;
stringNumber = '0.1'
set(gca,'units','pixels','position',[1 1 145 55],'visible','on')
box('on')
The above code results in the following ...
0
votes
2answers
59 views
Is there a way to specify x y and z limits in matplotlib plots in one command instead of 3 separate lines?
I am developing a program that needs to automatically switch from 2D to 3D plots in matplotlib. So I am looking for a way to not have many if statements to decide between 2 and 3d
I have looked at ...
0
votes
1answer
32 views
Trouble opening .fig files in axes
I am creating a GUI in Matlab's Guide which should display a video and a plot saved in a .fig file. I am currently trying to open the plot in an axes element and while I know axes cannot be a ...
2
votes
0answers
152 views
ValueError: c of shape (7303,) not acceptable as a color sequence for x
I am trying to visualize some data in Axes3D, but I'm getting an error that I don't know how to solve.
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sb
from ...
0
votes
1answer
2k views
Keras Dot Axes questions
I am trying to use Keras Dot and have the following errors.
Could you explain what I am doing wrong?
x1 = Input(shape=(2,4))
x2 = Input(shape=(4,))
y1 = dot([x1,x2], axes = (2,1))
modelA = Model(...
1
vote
0answers
36 views
Annotate segments of correlation matrix plot using a color bar
I want to annotate segments of the x & y axes of a correlation matrix plot in MATLAB using a color bar like in the image shown below:
goal correlation plot
This is the code I have right now:
b =...
0
votes
1answer
59 views
Normalize axes to have squared plot
Consider the following series
lift = {}
lift['correct']=[0.0, 10.0, 18.0, 34.0, 44.0, 58.0, 66.0, 76.0, 84.0, 86.0, 88.0, 92.0, 92.0, 94.0, 98.0, 98.0, 100.0, 100.0, 100.0, 100.0, 100.0]
lift['avg'] =...
0
votes
1answer
33 views
ticks on right side of plot un subplots enviroment
I am trying to get the ticks for my plot on the right side. (The one int he lower right corner) I've tried many of the related topics. eg.
Python Matplotlib Y-Axis ticks on Right Side of Plot
...
1
vote
1answer
320 views
Matplotlib Plot with Finer tick marks but no labels
I am trying to produce a plot where I have customized axis ticks on both x and y axis. But like in a scale, I would like to have the finer tick marks present while the tick markings only on the bigger ...
0
votes
1answer
161 views
Swap axes after plot object created in bokeh
I need to swap the x and y axes of a plot after the plot object has been created with Bokeh. I've tried to do this as follows but get the following javascript error:
Javascript Error: Cannot read ...