graphics

How to flip axes on seaborn tsplot plot?

十年热恋 提交于 2019-12-12 02:16:07
问题 I have data with various measurements and depth associated with those measurements. I am able to plot the data with the shaded error bounds as the y axis and depth as the x axis. However, I want the data with the error bounds to be on the x axis and depth on the y. Is there a way to tell tsplot to use the data parameter as the x axis and depth as the y or to flip the axes? Basically I want to turn this into this with all the proper axes formatting as it would if you simply transposed an array

Bitmap and picturebox cause out of memory exception

拟墨画扇 提交于 2019-12-12 02:15:17
问题 I am trying to create an application that shows the online trains in picturebox . but my application spends a lot of memory and sometimes i got the Out of memory exception and sometimes my trains Disappears from the picturebox . To draw online train first time i draw the map of trains (lines ,stations ,...) on picturebox with size x=A and y=b after that i create another picturebox with the same size and put the second picturebox on first picturebox using this code: pictureBoxonlineTrain

controlling column widths for side by side base graphic and ggplot2 graphic

早过忘川 提交于 2019-12-12 01:59:13
问题 @Ricardo Saporta has proposed here an easy way to combine base graphics and ggplot graphics in a multiple plots figure. I use this way to plot a base graphic at left and a ggplot graphic at right which actually contains two graphics (this is an artifical example, not a real one, but it has the same structure as my real example) : library(ggplot2) library(gridExtra) library(plotrix) Mvalues <- matrix(rpois(9,1), ncol=3) Mcolors <- matrix(rpois(9,5), ncol=3) par(mfrow=c(1,2)) color2D.matplot(x

Plot multiple normal curves in same plot

本小妞迷上赌 提交于 2019-12-12 01:56:02
问题 I'm interested in creating an example plot (ideally using ggplot) that will display two normal curves with different means and different standard deviations. I've discovered ggplot's stat_function() argument but am not sure how to get a second curve on the same plot. This code produces one curve: ggplot(data.frame(x = c(-4, 4)), aes(x)) + stat_function(fun = dnorm) Any advice on ways to get a second curve? Or maybe simpler to do in base package plotting? 回答1: Just in case you also want to do

How to repaint over images in Java game

好久不见. 提交于 2019-12-12 01:55:37
问题 Hello everyone I am having trouble with painting over coins that the user intersects with. What I want this code to do is when the user sprite intersects with any of the ten coin images it paints over the coin so that it no longer appears on the screen (also need to add in some kind of counter so that when the user collects all ten coins it will stop the thread, and say "You Win!"). My question is how would I go about doing this because I have tried using repaint() in the if statements, and

Placing images in a fixed layout GTK2

本秂侑毒 提交于 2019-12-12 01:49:23
问题 I have an application that is attempting to do the following: Create a GTK2 top level main window Add a fixed frame into the main window for absolute positioning of widgets Create a matrix of GtkImages that will be used to display animated GIFS and static JPEGS On start-up the static JPEGS picked randomly from a list will fill the matrix When an event happens the matrix will be filled with animated GIFS When the animation is over possibly different JPEGS will again be displayed in the matrix

Extracting vector graphics (lines and points) with pdfclown

十年热恋 提交于 2019-12-12 01:47:03
问题 I want to extract vector graphics (lines and points) out of a pdf with pdfclown. I have tried to wrap my head around the graphics sample but i cannot figure out how the object model works for this. Please can anyone explain the relationships? 回答1: You are right: till PDF Clown 0.1 series, high-level path modelling was not implemented (it would have been derived from ContentScanner.GraphicsWrapper). Next release (0.2 series, due next month) will support the high-level representation of all the

Draw opaque graphics on transparent form - C# winforms

可紊 提交于 2019-12-12 01:45:30
问题 I've been working on a screen recorder lately and I wanted to implement a region recorder. I set up the code required to draw the region but the problem is that I can't get rid of the form. I tried TransparencyKey = BackColor; but that made the form click through which doesn't allow the user to draw the region I also tried Opacity = 0F; but that made the form invisible, and when set to very low values, it makes even the rectangle transparent. My goal is to make the form fully transparent and

Image in memory compression exception when getting byte array from the Image

笑着哭i 提交于 2019-12-12 01:43:20
问题 I have a bitmap object which is taking a huge part of the memory at runtime, I want to compress it (JPEG format) in memory then later on use it. I am using this for the compression: MemoryStream ms = new MemoryStream(); oBmp.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); oBmp.Dispose(); oBmp = null; Image ResultImg = Image.FromStream(ms); ms.Dispose(); ms = null; I dont know if this is really saving some memory or that everything is back to normal memory consumption when I load back the

Cairo: grabbing the whole drawing as a pattern

喜你入骨 提交于 2019-12-12 01:39:57
问题 I am probably missing something conceptual about cairo . I draw using the following helper class: struct GroupLock { GroupLock(Graphics &g) : g_(g) { cairo_push_group(g_.cr); } ~GroupLock() { cairo_pop_group_to_source(g_.cr); cairo_paint(g_.cr); cairo_surface_flush(g_.surface); XFlush(g_.display); } private: Graphics &g_; }; All my drawing functions are of the form: void drawSomething(Graphics &g) { GroupLock lock{g}; (void)lock; ... // some drawing } Each call to such a drawing function sets