insets

Different x and y scale in zoomed inset, matplotlib

别来无恙 提交于 2019-12-04 19:47:19
问题 I am trying to make an inset plot using matplotlib. Currently I have something like the last answer in How to zoomed a portion of image and insert in the same plot in matplotlib There is a parameter there which determines the zoom factor. However, I want to change the scale between the x and y axes, ie I want to zoom in more on the xaxis. (so in the example, the square would be mapped to a rectangle under the inset map). How do I achieve this? Here is a working example: import pylab as pl

Java - JPanel with margins and JTextArea inside

爱⌒轻易说出口 提交于 2019-12-04 00:17:28
I want to create something like this: Main panel has its margins (x), and TextArea in the center of that panel which almost fills up the panel. At the bottom is another panel with custom size (height y), which can be toggled visible and unvisible with some shortcut. Bottom Panel has FlowLayout and few elements. The problem is I have no idea how to do this. BoxLayout has no margins. I tried with GridBagLayout but I doesn't work or I can't understand it enough :( I tried also with setting JTextArea margins textMain.setMargin(new Insets(insetTop, insetLeft, insetBottom, insetRight)); but when

How to change the background colour of a subplot/inset in R?

你离开我真会死。 提交于 2019-12-03 17:32:52
I'd like to add a subplot to an existing plot in R. The subplot (inset) should have a different background color. I tried the following: #install.packages("TeachingDemos", dependencies=T) library(package="TeachingDemos") d0 <- data.frame(x = rnorm(150, sd=5), y = rnorm(150, sd=5)) d0_inset <- data.frame(x = rnorm(1500, sd=5), y = rnorm(1500, sd=5)) plot(d0) subplot( fun = plot( d0_inset , col = 2 , pch = '.' , mgp = c(1,0.4,0) , ann = F , cex.axis=0.5 ) , x = grconvertX(c(0.75,1), from='npc') , y = grconvertY(c(0,0.25), from='npc') , type = 'fig' , pars = list( mar = c(1.5,1.5,0,0) + 0.1 , bg

How to add a margin to a CheckedListBox in .NET?

99封情书 提交于 2019-12-02 18:04:35
问题 I'm writing an windforms application using .NET (actually IronPython, but that's not relevant), and I have a CheckedListBox object in my GUI. It's working fine, it has about 20 items in a multicolumn layout. But I can't figure out how to give the thing a nice internal margin--I want to insert around 20 or 30 pixels of whitespace around the top, bottom, left, and right edges of the checkboxes. To be clear, I want the whitespace to appear between the border of the CheckedListBox and the

Create a “inset” effect using CSS in websites

拟墨画扇 提交于 2019-11-30 02:19:13
I am very much impressed by the "inset" like effect in many latest websites. Some examples are and The line in the center. Nowadays, many websites use these kinds of lines/effects. I tried to achieve the same with borders but the color combination is not working me and it is not proper. Do other websites use images for these ? is it easy to this ? Any example css ? Example sites: http://woothemes.com , http://net.tutsplus.com/ , http://www.w3schools.com (in the header) and in wordpress admin page sidebar Don't know if this will help, but using 1 px borders that are slightly lighter and darker

Java Swing - setting margins on TextArea with Line Border

痞子三分冷 提交于 2019-11-28 07:50:24
问题 As the title says, I am simply trying to set the margins (provide some padding) on a TextArea with a LineBorder set. Without setting the Border, .setMargins works fine. Here is the specific chunk of code. aboutArea = new JTextArea("program info etc....."); Border border = BorderFactory.createLineBorder(Color.BLACK); aboutArea.setSize(400, 200); aboutArea.setBorder(border); aboutArea.setEditable(false); aboutArea.setFont(new Font("Verdana", Font.BOLD, 12)); add(aboutArea); I have tried each of

How to add an inset (subplot) to “topright” of an R plot?

六眼飞鱼酱① 提交于 2019-11-28 04:46:30
I'd like to have an inset within a plot that makes up 25% of the width and height of the plotting area (area where the graphs are). I tried: # datasets d0 <- data.frame(x = rnorm(150, sd=5), y = rnorm(150, sd=5)) d0_inset <- data.frame(x = rnorm(1500, sd=5), y = rnorm(1500, sd=5)) # ranges xlim <- range(d0$x) ylim <- range(d0$y) # plot plot(d0) # add inset par(fig = c(.75, 1, .75, 1), mar=c(0,0,0,0), new=TRUE) plot(d0_inset, col=2) # inset bottomright This puts the inset to absolute topright and also uses 25% of the device-width. How can I change it to the coordinates and width of the area

It is possible to create inset graphs?

佐手、 提交于 2019-11-27 06:50:25
I know that when you use par( fig=c( ... ), new=T ) , you can create inset graphs. However, I was wondering if it is possible to use ggplot2 library to create 'inset' graphs. UPDATE 1: I tried using the par() with ggplot2, but it does not work. UPDATE 2: I found a working solution at ggplot2 GoogleGroups using grid::viewport() . Richie Cotton Section 8.4 of the book explains how to do this. The trick is to use the grid package's viewport s. #Any old plot a_plot <- ggplot(cars, aes(speed, dist)) + geom_line() #A viewport taking up a fraction of the plot area vp <- viewport(width = 0.4, height =

How to add an inset (subplot) to “topright” of an R plot?

心已入冬 提交于 2019-11-27 00:39:17
问题 I'd like to have an inset within a plot that makes up 25% of the width and height of the plotting area (area where the graphs are). I tried: # datasets d0 <- data.frame(x = rnorm(150, sd=5), y = rnorm(150, sd=5)) d0_inset <- data.frame(x = rnorm(1500, sd=5), y = rnorm(1500, sd=5)) # ranges xlim <- range(d0$x) ylim <- range(d0$y) # plot plot(d0) # add inset par(fig = c(.75, 1, .75, 1), mar=c(0,0,0,0), new=TRUE) plot(d0_inset, col=2) # inset bottomright This puts the inset to absolute topright

It is possible to create inset graphs?

我怕爱的太早我们不能终老 提交于 2019-11-26 10:31:57
问题 I know that when you use par( fig=c( ... ), new=T ) , you can create inset graphs. However, I was wondering if it is possible to use ggplot2 library to create \'inset\' graphs. UPDATE 1: I tried using the par() with ggplot2, but it does not work. UPDATE 2: I found a working solution at ggplot2 GoogleGroups using grid::viewport() . 回答1: Section 8.4 of the book explains how to do this. The trick is to use the grid package's viewport s. #Any old plot a_plot <- ggplot(cars, aes(speed, dist)) +