# Questions tagged [axes]

373 questions

1

votes

1

answer

42

Views

### Remove spines of host when using parasite axis

I'm new to both python and stackoverflow so I hope I'm posting this right.
I'm trying to make a bar chart with scatter overlay. I followed the demo_parasite_axes2 example on the matplotlib website to create a host and a parasite axis. That seems to work fine.
Now I want to remove the top and right s...

1

votes

1

answer

288

Views

### Omit axes with facet_grid - plotnine

import pandas as pd
from plotnine import *
df=pd.DataFrame({'A':[1,1,1,1],'B':[1,9,5,11],'C':['x','x','y','y'],'D':['a','b','a','b']})
p=ggplot(df,aes('A','B'))
p + geom_bar(stat='identity') + facet_grid('D~C',scales='free_y')
This will draw axes on both the left and right grids. Is there a way to o...

1

votes

1

answer

42

Views

### Scichart: how to activate or deactivate the axes range synchronization

It is possible to synchronize axes if you bind the VisibleRange of an Axis to a property of type IRange in the ViewModel. So if I have 2 charts I can bind them to the same IRange and they get synchronized. This works fine. Now I want to be able to activate or deactivate this behavior. I did somethin...

1

votes

0

answer

124

Views

### Matlab GUI, draw arrow with annotation to specific axes

I´d like to draw an arrow with annotation in a specific axes in my GUI.
At the moment I have this GUI with two axes:
I already can draw an arrow to axes2 in my GUI but not to a chosen one.
My Code so far:
How do I fit the annotation for example to axes1 and not tpo axes2?
arrow_p1 = [0.5 1]; % Sta...

1

votes

0

answer

67

Views

### Creating a candlestick chart with multiple axes (not twin axis )

I have created a candlestick chart that displays the percentage deviation from the moving average, with the percentage as the left side Y-Axis parameter. I want to plot the closing price that corresponds to those percentages( derived by a formula present in my code) on the right side Y-Axis. I am no...

1

votes

0

answer

34

Views

### R-Project: How to limit axes in SPI plot? ylim & xlim don't work

Dear stackoverflow community,
I'm quite new in R and this is my first stackoverflow entry so please show mercy with me if it's not the perfect questioning.
I'm calculating standardized precipitation index (SPI) with the package 'SPEI' for a time series of a climate station with 20 years of monthly p...

1

votes

0

answer

8

Views

### Graph flattened on the y's axe

I am trying to draw a hypotrochoïde figure, but my graph is flattened on the axes of y. I cann'ot find the error. Please help me! Thank you in advance! :)
#Définir la fonction hypotrochoïde
def hypo(R,r,d,phi0=0,color='k'):
'''
Cette fonction calcule la position du crayon en fonction de phi.
Pa...

1

votes

1

answer

98

Views

### ggplot2: issues with dual y-axes and Loess smoothing

I'm a novice with R and ggplot. I recognize the power of R and elegance of ggplot and am trying to learn. Normally, I can find a solution online but have had no luck this time.
I am trying to generate a chart in ggplot comparing Economic Freedom scores with Life Expectancy and Infant mortality using...

1

votes

0

answer

20

Views

### Multiple axes in r plotly - plots only last axe

When i try to plot multiple traces on different axes only the last one is shown.
Firstly let's assume I plot everything one one axe:
temp

1

votes

1

answer

46

Views

### Why are the Line2D objects that are supposed to be contained by a matplotlib Axis showing up as empty?

The figure plots just fine, but I can't access the Line2D objects.
Example code below:
import pandas as pd
import numpy as np
from matplotlib import pyplot
df=pd.DataFrame({'col1':np.random.rand(10), 'col2':np.random.rand(10)})
fig=pyplot.figure()
ax=fig.add_subplot(1,1,1)
ax=df.plot(kind='scatter',...

1

votes

1

answer

31

Views

### Need to get multiple y axis labels in rPlotly

I have a plot where every other column in the dataframe has a y axis label on left and right sides of y axis. I have the plot working if I don't use rplotly but now I want to do it in rplotly.
Below is the code I tried, the part before the plotly works and it is how I want the plotly graph to look....

1

votes

1

answer

18

Views

### How to specify axes for a pcolormesh?

So i'm trying to plot a (125 x 1000) grid with specified values. I'm using matplotlib with pcolormesh. This is how my code looks, enzyme array just symbolic.
enzyme = np.array([125 x 1000])
plt.pcolormesh(enzyme, cmap='Reds')
plt.colorbar()
plt.show()
The x-axis is my spatial resolution and my y-axi...

1

votes

1

answer

33

Views

### Inconsistent automatic pandas date labeling

I was wondering how pandas formats the x-axis date exactly. I am using the same script on a bunch of data results, which all have the same pandas df format. However, pandas formats each df date differently. How could this be more consistently?
Each df has a DatetimeIndex like this, dtype='datetime64...

1

votes

1

answer

2.5k

Views

### matplotlib 3D plot with PyQt4 in Qtabwidget (mplwidget)

I am working on my first Python app using PythonXY (2.6 and Qt4).
I have a window with some buttons and a QtabWidget.
When I press a button I want to plot a 3D image on a specific tab. I managed to get a 2D plot but I can't get the axes to 3D.
Via Qt desiger I use the mplwidget. In many examples I s...

1

votes

2

answer

863

Views

### preceding-sibling of current text node

I have this kind of XML :
1
document.Document
item 1
pdf
2
video.Video
item 2
mp4
3
document.Document
item 3
pdf
4
video.Video
item 4
mp4
5
document.Document
item 5
pdf
I want to count all document.Document preceding the current document.Document.
(I don't want to count the video...

1

votes

1

answer

865

Views

### Matlab - can't display manually set axes

I create a figure and a panel of uicontrols. When I run the program, the panel overlays the default axes( or plot area if that is more appropriate). So, I want to have the panel at a certain position and the axes( or plot area) set at a separate position. I've read Matlab help and tried many variati...

1

votes

2

answer

1.8k

Views

### In Matlab, own function which dynamically load/display images into Axes from a Gui in a loop?

With Guide I made a Matlab Gui that have 10 Axes in which i want to display images, in all of them at once, after i press a Button.
I made a separate .m file with function Load_Write_Img_Results(img_index) that i call from the Button Callback which have the following code:
for i = 1 : 10
handles_img...

1

votes

2

answer

517

Views

### questions about axes and mtext

I am swimming backwards in my R knowledge. Please help!
ExampleData:
Site, Aluminum_Dissolved, Federal_Guideline
M1, 0.1, 0.4
M1, 0.2, 0.4
M1, 0.5, 0.4
M2, 0.6, 0.4
M2, 0.4, 0.4
M2, 0.3, 0.4
I have a simple function:
boxplot(ExampleData$Aluminum_Dissolved ~ ExampleData$Site, col='purple',
par (cex...

0

votes

0

answer

5

Views

### Behavior of chaining syntax in axes generation

I'm writing d3.js (d3 v4) code to generate a simple bar chart, which I managed to do, but I am confused about the behavior of the code in generating axes.
So basically, I encapsulated the chart code into a function that contains basics accessors.
Here is some code showing the core of my chart functi...

1

votes

1

answer

170

Views

### How to use xpath to check entire tree for specific value

I am using a marketing platform to implement an airline confirmation message. The platform allows us to write xsl to loop through values returned from the database. What i want to be able to do is to check this entire path
/Msg/Props/bookingcontact_to_booking/passenger_to_bookings/passenger_to_booki...

1

votes

1

answer

1.3k

Views

### Matplotlib: twin axes and set_equal

I'm wondering if there is a more elegant way (by removing any for loop, or by using another way to plot the grid), to achieve this figure:
nx, ny = 8, 6
fig = plt.figure()
ax = fig.add_subplot(111)
ax.set_xlabel('Pixel X-coordinate')
ax.set_ylabel('Pixel Y-coordinate')
for i in range(nx-1):
ax.axvli...

1

votes

1

answer

2.3k

Views

### Highcharts multiple series and axes types overlapping

I have a problem with a highcharts graph, regarding overlapping of multiple axes.
There are 2 types of series, one type column and one type line. I want the line type to be always above the others and never intersect them.
You may see my problem here:
http://jsfiddle.net/99tC7/
Anticipated thank you...

1

votes

1

answer

146

Views

### How do I save an image in Matlab with axes but without plotting?

I have an image I that I want to save with axes on it.
imwrite(I,jet,'image.jpg');
will save the image.
I = image;
RI = imref2d(size(I));
RI.XWorldLimits = [xmin xmax];
RI.YWorldLimits = [ymin ymax];
figure(1);
imshow(I,RI,jet);
xlabel('x');
ylabel('y');
print(1,'-djpeg','image.jpg');
will plot the...

1

votes

1

answer

2.1k

Views

### How to read the image data from particular axes of MATLAB GUI?

I have designed one MATLAB GUI in which there are two axes for displaying images. I am using 'imcontrast' function to adjust brightness/contrast of the images on first axes. Now, I want to store this enhanced output(brightness/contrast adjusted output) in some variable. As 'imcontrast' function doe...

1

votes

1

answer

101

Views

### Show only predefined value in axes MATLAB

I would like to only show these x-values on the x-axes
xx=[0.0005 0.005 0.05 0.1 0.25 0.5 0.75 1 1.25 1.5];
Is it possible?

1

votes

1

answer

348

Views

### How to make axes vertical in ggparcoord function?

How can I make the x-axis labels vertical in ggparcord when I have something similar to this code?
ggparcoord(mtcars,columns=2:11,groupColumn=1)
I tried:
ggparcoord(mtcars,columns=2:11,groupColumn=1,las=1)
to receive an error:
Error in ggparcoord(mtcars, columns = 2:11, groupColumn = 1, las = 1) :...

1

votes

1

answer

163

Views

### Matplotlib's 'annotate' not positioning text correctly in PDFs?

Matplotlib' annotate seems to fail to position text correctly when rendered to PDF.
For example, if I attempt to center a ▲ character at the location of a tick on an axis with
fig.ax.annotate('▲',(a_tic_loc, x_axis_loc), ha='center', va='top')
instead of getting the expected and correct
as I do...

1

votes

1

answer

60

Views

### Formatting multiple axes in D3 indivdiually

I'm following the Scatterplot Matrix example, but I have axes that require different formatting. I have some time-oriented variables and some standard numeric variables. I want the axes to have different formats, because currently, the time-oriented labels show up with commas (e.g. 2,005 rather than...

1

votes

1

answer

1.3k

Views

### Custom Matplotlib Axis Scale

I'm trying to make a graph with the same axis scales as this one:
The y axis can be done simply by setting the y scale to 'Log', but I don't know how to set the x axis to be stretched at both extremes as shown in the graph, or what that scale is called. It doesn't have built in support in matplotlib...

1

votes

1

answer

4.6k

Views

### Add axes label to pcolor image

I created a pcolor image with each grid shaded in based on a value in the matrix C.
h1 = pcolor(C);
colormap(jet)
h = colorbar;
ylabel(h,'Monthly Correlation (r-value)');
shading flat
Each grid corresponds to a particular year on the x axes and a particular site name on the y axes. How can I add an...

1

votes

1

answer

256

Views

### plots in overlapping multiple axes MATLAB GUI

I have 2 axes in my GUI which overlap (they have same positions). 2 separate radio buttons trigger each. When one is triggered, the other should be suppressed. I'll show different plots in each. However, when I use 'Visible', only axes are gone not the plots. How can I solve this?
value(1) = get(S.r...

1

votes

1

answer

438

Views

### Using dataframe date column in matplotlib

I have a DataFrame with date as a column formatted as ddmmyy (e.g., 08JUN14). I can’t figure out how to format it for use as the x-axis of a matplotlib plot. From experimenting I understand that I need a string since:
datetime.strptime(“01Jul76”, ,'%d%b%y')
datetime.datetime(1976, 7, 1, 0,...

1

votes

2

answer

153

Views

### Axes takes up entire screen in MATLAB GUI

There must be a simple answer to this. I cannot really find a suitable response after a lot of searching.
This is what I want to make using the GUIDE tool.
This is what I get. (Note: the plot is made using the subplot function)
What am I doing wrong? Shouldn't the plot simply fit into the predefined...

1

votes

2

answer

1.4k

Views

### Linear and Non-linear axis in Matlab

I'm the MatLab newbie and I need some help to create a linear and non-linear axis in one chart.
I need to make chart with 2 different X-axes. One X-axis displays 1000/T at the bottom and the second X-axis displays a T at the top of the chart.
Example figure:
Do you have any idea how to solve this p...

1

votes

1

answer

505

Views

### Controlling joystick axes using AutoHotkey

I will be getting a flight stick for Kerbal Space Program soon and was hoping to AHK-ify it, like every other peripheral I use on my computer. I know how to remap the joystick buttons, and how to get readings for the axes of the flight stick and throttle, but I am unsure of how to control the axes v...

1

votes

2

answer

319

Views

### Twinx with dates affects xaxis intervals for future plots

I am creating a GUI application with a MatplotlibWidget. Based on the user's selection in the MatplotlibWidget the graph can be:
A. a function y1(t), where y1 is float and t is datetime,
B. a function y1(t), y2(t) where y2 to be a float and with y2 to be ploted at the twinx axis, or
C. a function y...

1

votes

2

answer

396

Views

### Remove ticks from 1st axis on 2nd axis in MATLAB when using plotyy and axes limits

I am trying to use MATLABs plotyy function in combination with y-axes limits like that
x = [4:2:14 18];
y1 = [86; 87; 88; 89; 89.3; 89.6; 89.7];
y2 = [15; 35; 63; 99; 143; 195; 323];
width = .36;
axes = plotyy(x-width, y1, x+width, y2, @(x,y) bar(x,y,width,'b'), @(x,y) bar(x,y,width,'r'));
set(axes(...

1

votes

1

answer

1.1k

Views

### How to remove polar gridlines and add major axis ticks

Could someone please help me remove the gridlines that form the rings inside my polar plot. I'd like to keep (and even bold) the axes and add ticks for each of the axis labels.
Here is the code that I'm working with, an image of the plot, and an image of what I want for the axes.
import numpy as np...

1

votes

1

answer

37

Views

### Make dual X-axs based on different variables using ggvis

df %
layer_lines(y = ~ var1) %>%
add_axis('y', orient = 'left', title = 'var1') %>%
add_axis('x', orient = 'bottom', title = 'X1') %>%
add_axis('x', orient = 'top', title = 'X2' )
graph
Obviously, the top x-axis (X2) is not correct here since it refers to the same variable as X1. I know how to crea...

1

votes

3

answer

978

Views

### Unable to control scale of second y-axis on df.plot()

I am trying to plot 3 series with 2 on the left y-axis and 1 on the right using secondary_y, but it’s not clear to me how to define the right y-axis scale as I did on the left with ylim=().
I have seen this post: Interact directly with axes
… but once I have:
import matplotlib.pyplot as plt
df...