Arrange base R plot and ggplot togeter in R and save with high resolution - ggplot2

Dear members and seniors,
Hope you all are well. Does anyone know whether we could arrange base R plot and ggplot in R and could save high resolution (300 dpi) for publication. I tried to do it, but not work. So asking in case anyone knows and could share example.
Kind Regards,
synat

Related

How to change axis velocity during Gcode operation

Good work everyone,
I have been working on a 3 axis CNC machine for a while. A lot of things are going great! But I couldn't find how to increase or decrease the axis speeds while processing the g code. I am using the SMC_INTERPOLTAOR block to manipulate the G code. I think I can overcome this problem with the 'dwtime' value in the entry of this block, but this does not offer a healthy solution.
I need support for this! I need to do an instant increase or decrease of the axis speed during a motion!
Thanks. / ByCNC
What is motion axis speed control problem method
While I have no experience with SoftMotion CNC libraries, looking through the documentation the dOverride input argument seems to be promissing:
... The scheduled velocity of the particular objects will get scaled by dOverride; thus the scheduled velocity can be increased resp. reduced in online mode...

Does ZedGraph offer any kind of Level-of-Detail Culling behavior?

I've searched and can't find an answer to this question. I could write the code myself to do it, but I don't want to reinvent the wheel. :)
Since ZedGraph uses an IPointList and its indexer for internal data access, you can assign any kind of data structure to it and dynamically change the data that ZedGraph receives when it calls the indexer.
It's a smart architecture, and naturally, it would be feasible to implement a Level-of-Detail system using a custom IPointList where the number of points is culled based on the xScale and yScale of the GraphPane.
This way you can have millions of points loaded, but when the zoomlevel of the graph would show all the points, they can be culled so that ZedGraph is only drawing a few thousand. As the zoom magnification is increased, fewer points would be culled in the region of interest.
I wanted to know if ZedGraph already offers anything like this out of the box. I haven't seen any indication of support for it.
Does anyone know?
I posted about this on Sourceforge and got no response there either.
Then I posted on a fork on Github and got a response. It's here:
https://github.com/ZedGraph/ZedGraph/issues/13
The answer:
There is a naive algorithm that filters points by simply skipping them blindly to reach a target display number.
Of course this naive approach can give completely wrong impressions of what the data looks like when peaks and valleys get dropped in a line graph, for instance. IMHO, an algorithm like that is completely unuseable.
So basically, there is no acceptable built-in culling in ZedGraph at the present time.

Create subplots from interactive python plot

I have some LVIS Lidar data in hdf5 format.
The data has Lat and Long co-ordinates, so I have been able to visualise them on a map using Basemap:
f = h5py.File('ILVIS1B_GA2016_0304_R1701_043591.h5','r')
LONG = f['/LON0/']
LAT = f['/LAT0/']
X = LONG[...]
Y = LAT[...]
m = Basemap(projection='merc',llcrnrlat=-0.5,urcrnrlat=0.5,\
llcrnrlon=9,urcrnrlon=10,lat_ts=0.25,resolution='i')
m.drawcoastlines()
m.drawcountries()
parallels = np.arange(-9.,10.,0.5)
m.drawparallels(parallels,labels=[False,True,True,False])
meridians = np.arange(-1.,1.,0.5)
m.drawmeridians(meridians,labels=[True,False,False,True])
m.drawmapboundary(fill_color='white')
x,y = m(X, Y)
scatter = plt.scatter(x,y)
m.scatter(x,y)
plt.show()
This gets me this, where the orange bands are very dense points:
The hdf5 file also has the full waveform data for each mapped point (each datapoint is a reflection detected at the sensor, as a function of time) so that each of the orange points has data associated with it like:
Ultimately, I would like to be able to click on any of the orange points and for the subsequent waveform to be displayed. I have looked into interactive plots for this and have come across a number of libraries (mpl3d, plotly etc).
I'm having some trouble getting my head around some of these and how I can get my data into the examples - my python isn't up to this level. Does anyone have any advice on where to start? Which libraries would be best suited to this? A little help to understand the basics would be appreciated.
Apologies there is no direct question here, I'm just after some info from the knowledgable community.
The question seems to be: How do I tackle a task I have no clue how to solve?
Step 1: Search for a possible solution. It may happen that someone else has already solved your problem. This will mostly not be the case, but you may be lucky.
Step 2: Abstract the task. What would be the general problem that a lot of people might have and for which there might be a solution? Does it need to be hdf5 files? No. Is georeferencing important? Maybe, but one could neglect for the moment. Which requirements are really important, which not?
Step 3: Search again. You will have more success now for finding similar or related problems.
Step 4: Look at the tools in use. Make a list of possible tools and check against your requirements. Interactivity, Application or web-based, accuracy etc.
Step 5: Decide for one tool and go for it. Start with a general case study. Can I plot a map on the left and a graph on the right side using this tool? If not, find out why - maybe there is a general problem with this, maybe there is just an implementation detail missing. At this point you may ask a question about the case study problem, specifying the tool in use and providing the code that gives the problem. Do not think about your actual problem until this is solved.
Step 6: Proceed and try to add interactivity. Can I get something to happen when clicking? Again treat this independent of the actual problem. Search for solutions and if there none, ask a question about it.
Step 7: Proceed further up to the point where you're truely stuck. Now is the time to finally ask a question here, but with all the details that have brought you down to step 7 inside the question.

determine camera rotation and translation matrix from essential matrix

I am trying to extract rotation matrix and translation matrix from essential matrix.
I took these answers as reference:
Correct way to extract Translation from Essential Matrix through SVD
Extract Translation and Rotation from Fundamental Matrix
Now I've done the above steps applying SVD to essential matrix, but here comes the problem. According to my understanding about this subject, both R and T has two answers, which leads to 4 possible solutions of [R|T]. However only one of the solutions would fit in the physical situation.
My question is how can I determine which one of the 4 solutions is the correct one?
I am just a beginner on studying camera position. So if possible, please make the answer be as clear (but simple) as possible. Any suggestion would be appreciated, thanks.
The simplest is testing a point 3D position using the possible solution, that is, a reconstructed point will be in front of both cameras in only one of the possible 4 solutions.
So assuming one camera matrix is P = [I|0], you have 4 options for the other camera, but only one of the pairs will place such point in front them.
More details in Hartley and Zisserman's multiple view geometry (page 259)
If you can use Opencv (version 3.0+), you count with a function called "recoverPose", this function will do that job for you.
Ref: OpenCV documentation, http://docs.opencv.org/trunk/modules/calib3d/doc/calib3d.html

how to extract data from plot produced by easy.py in libsvm-3.17

I just downloaded libsvm-3.17 abt two weeks ago. I tried heart_scale (dataset provided in the libsvm-3.17 package) with easy.py. An image or plot is produced (from gnuplot) to illustrate the best c and best gamma. I cannot post the image here because I am new here and do not have enough reputation.
I would like to ask from the many colors curves in the plot, how to extract from the plot that the best log2(c)=11 (which gives c=2048) and the best log2(gamma)=-13 (which gives gamma = 0.0001220703125).
Thank you very much.
the chosen parameters are reported by easy.py (cannot run it now, but you will find them). the plot is just a visual aid to manually verify the parameter neighborhood. with some experience you can interpret the diagram. without experience simply trust easy.py