axes

Changing tick labels without affecting the plot

做~自己de王妃 提交于 2019-12-02 04:15:30
问题 I am plotting a 2-D array in python using matplotlib and am having trouble formatting the tick marks. So first, my data is currently organized as a 2-D array with (elevation, latitude). I am plotting values of electron density as a function of height and latitude (basically a longitudinal slice at a specific time). I want to label the x axis going from -90 to 90 degrees in 30 degree intervals and the y values with another array of elevations (each model run has different elevation values so I

How to have a common label for all x and y axes in case of subplots?

纵然是瞬间 提交于 2019-12-02 03:52:27
I have used the following loop to get subplots: for j=1:19; Aj=B(j,:); subplot(5,4,j); plot(Aj,h) end For all these subplots, I need to have only one x-label and one y-label. How to do this? Also how to insert legend to all the subplots? You can use suplabel from the FileExchange to have combined x and y label for all subplots. Example: subplot(1,2,1); plot(randperm(40)); hold on; plot(randperm(40)); %Plotting some random data legend('show') %To show the legend subplot(1,2,2); plot(randperm(40)); hold on; plot(randperm(40)); %Plotting some random data legend('show') %To show the legend %Using

Changing tick labels without affecting the plot

余生颓废 提交于 2019-12-02 01:03:10
I am plotting a 2-D array in python using matplotlib and am having trouble formatting the tick marks. So first, my data is currently organized as a 2-D array with (elevation, latitude). I am plotting values of electron density as a function of height and latitude (basically a longitudinal slice at a specific time). I want to label the x axis going from -90 to 90 degrees in 30 degree intervals and the y values with another array of elevations (each model run has different elevation values so I can't manually assign an arbitrary elevation). I have arrays with latitude values in it and another

MATLAB Colorbar - Same colors, scaled values

纵饮孤独 提交于 2019-12-01 21:52:49
问题 Consider the following example: [ X, Y, Z ] = peaks( 30 ); figure( 100 ); surfc( X, Y, Z ); zlabel( 'Absolute Values' ); colormap jet; c = colorbar( 'Location', 'EastOutside' ); ylabel( c, 'Relative Values' ); The output looks as follows: How can I scale the ticks on the colorbar, i.e. scale the c-axis (e.g. divide the values by 100): without changing the z values and colors on the plot without changing the colors on the colorbar without changing the relation between the colors on the plot,

Why won't the axes on my D3 SVG figure update?

∥☆過路亽.° 提交于 2019-12-01 14:29:42
I have a simple D3 scatterplot that I switch among displaying several different attributes of my data, but while I can get the data points to change (and to transition as I want them to), and can change the labels to the figure's axes, I cannot get the axes themselves to update (let alone transition). I suspect I'm doing something in the wrong order, or am missing a step, but I can't figure out from the documentation or examples I'm working from what I'm missing. How do I get my axes to update along with my data? The mystery arises from the behavior at the end of the linked code: d3.select("

How to draw an axis in the middle of the figure using Matplotlib

心不动则不痛 提交于 2019-12-01 11:31:54
I would like to draw a static vertical line that is parallel to the y-axis and which is at the middle of the x-axis. This line should not move when one pan in the figure. My goal is to have this vertical line in the middle of the figure as a reference line. I will have some other figures which represent data that will depend on the x value which is at the middle of the x-axis. Jouni K. Seppänen The coordinates of the endpoints of that line are (0.5, 0) and (0.5, 1) in axis coordinates: from matplotlib.lines import Line2D from matplotlib import pyplot f=pyplot.figure() a=f.add_subplot(111) a

How to draw boxes/borders around x or y axis labels?

狂风中的少年 提交于 2019-12-01 09:11:10
问题 Is there a way in R to draw boxes/borders around x or y axis labels, possibly angled labels? I've been using ggplot to create tile charts and found code that places around labels in the data itself (through geom_label : Set ggplot2 label background color but not around labels in the axes themselves. Chart Example: 回答1: library(grid) element_custom <- function() { structure(list(), class = c("element_custom", "element_text")) } element_grob.element_custom <- function(element, label="", ...) {

How to draw an axis in the middle of the figure using Matplotlib

送分小仙女□ 提交于 2019-12-01 08:47:07
问题 I would like to draw a static vertical line that is parallel to the y-axis and which is at the middle of the x-axis. This line should not move when one pan in the figure. My goal is to have this vertical line in the middle of the figure as a reference line. I will have some other figures which represent data that will depend on the x value which is at the middle of the x-axis. 回答1: The coordinates of the endpoints of that line are (0.5, 0) and (0.5, 1) in axis coordinates: from matplotlib

在tensorflow 2.0 中使用 relu 和 LeakyReLU

落花浮王杯 提交于 2019-12-01 07:22:12
网络上关于ReLU、LReLU等非常多的理论东西,可是大部分都是理论的,聚集怎么应用比较少。 在 Convolutional Neural Network (CNN) https://tensorflow.google.cn/tutorials/images/cnn?hl=en 的学习课程中,激活函数是 relu。 在学习过程中,看有的博文中说当激活函数 ReLU 效果不好时,建议使用LReLU试试,可是网上并没有特别详细的使用方法,只好去官网上找。 1 关于 relu 的常规使用方法 首先使用常规的relu —— 直接使用。 直接使用官网例子《Create the convolutional base》 https://tensorflow.google.cn/tutorials/images/cnn?hl=en#create_the_convolutional_base model = models.Sequential() model.add(layers.Conv2D(32, (3, 3), activation='relu', input_shape=(32, 32, 3))) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Conv2D(64, (3, 3), activation='relu'))

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

泪湿孤枕 提交于 2019-11-30 16:57:14
问题 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 the x and y arrays and then using the ranges argument in mayavi.mlab.axes() to correct the axes labels, however I'm looking for a more direct approach like that of warp_scale. Thanks! 回答1: when "m" is your surface object: m.actor.actor.scale = (0.1,