How to change the coloring of the mode shapes in Abaqus - abaqus

how can i change the coloring in Abaqus to be comparable with the ones I already got from matlab. your help will be really appreciated.

here is an example of a custom color table for abaqus cae. Save in a .py file and do "run script" while you are in contour plot module.
session.Spectrum(name="custom",colors=(\
'#000004','#010107','#02020C','#030312','#050417','#07051D','#0A0722',\
'#0D0828','#100A2E','#130B34','#170B3B','#1B0C41','#1F0C47','#230C4D',\
'#270B52','#2C0B57','#300A5C','#350A60','#390963','#3E0965','#420A68',\
'#460B69','#4A0C6B','#4E0D6C','#530E6D','#57106D','#5B116E','#5F136E',\
'#63146E','#67166E','#6B176E','#6F196E','#731A6E','#771C6D','#7B1D6D',\
'#7F1F6C','#83206B','#87216A','#8B2369','#8F2468','#932667','#982766',\
'#9C2964','#A02A63','#A42C61','#A82D5F','#AB2F5D','#AF315B','#B33359',\
'#B73557','#BB3755','#BF3952','#C23B50','#C63D4D','#C9404B','#CD4248',\
'#D04545','#D34842','#D74B3F','#DA4E3D','#DD513A','#DF5437','#E25734',\
'#E55B31','#E75F2D','#E9622A','#EC6627','#EE6A24','#F06E21','#F1721D',\
'#F3771A','#F57B17','#F67F13','#F78410','#F8880D','#F98D0A','#FA9207',\
'#FB9606','#FB9B06','#FCA007','#FCA50A','#FCA90E','#FCAE13','#FCB318',\
'#FBB81D','#FBBD23','#FAC229','#F9C72F','#F8CC36','#F7D13D','#F6D644',\
'#F5DB4C','#F4E055','#F3E55E','#F2E968','#F1EE72','#F2F27C','#F3F587',\
'#F5F991','#F8FC9B','#FCFFA4'))
session.viewports['Viewport: 1'].odbDisplay.contourOptions.setValues(spectrum='custom')
I'll leave it to a matlab expert to figure how to get the hex codes for its contour color scheme.

Related

How to remove non-periodic lines from binary image

Example Image
I want to remove the lines (shown in RED color) as they are out of order. Lines shown in black color are repeating at same period (approximately). Period is not known beforehand. Is there any way of deleting non-periodic lines( shown in red color) automatically?
NOTE: Image is binary ( back & while).. lines shown in red color only for illustration.
Of course there is any way. There is almost always some way to do something.
Infortunately you have not provided any particular problem. The entire thing is too broad to be answered here.
To help you getting started: (I highly recommend you start with pen, paper and your brain)
Detect the lines -> google or think, there are many standard ways to detect lines in an image. if you don't have noise in your binary image its trivial.
find any aequidistant sets -> think
delete the rest -> think ( you know what is good so everything else has to go away)
I assume, your lines are (almost) vertical.
The following should work
turn the image to a column sum histogram
try a Fourier transformation on the signal (potentially padding the image appropriately)
pick the maximum/peak from the Fourier spectrum as your base period
If you need the lines rather than the position of the lines, generate a mask with lines at appropriate intervals (as determined by your analysis before) and apply to the image.

How to find sizes and shapes of Microsoft Powerpoint objects?

I have a slide with some hand-drawn circles on it. I'd like to get a list of the coordinates and radii (sizes) of them. Attached is an image and link. Anyone have an idea how?
I started looking into computer vision techniques, but it seems like there should be a much more direct way.
If you are familiar with openCV the method HoughCircles() will do the job:
http://docs.opencv.org/doc/tutorials/imgproc/imgtrans/hough_circle/hough_circle.html
Are you familiar with Matlab? imfindcircles() will do it:
http://www.mathworks.com/help/images/ref/imfindcircles.html
If this is a one time job you can post it as a job for someone else to do it for you for a small fee. Example: https://www.mturk.com/mturk/welcome
If you don't know any programming language and this is a one time job, you can do it manually. You can select each circle in photoshop, count the amount of pixels (and using the formulae of circumference = 2*pi*radius) find the radius. The center of mass of all the pixels will be the center of the circle.
It is a bit tricky to separate overlapping circles but you can do it by hand
I found a suitable method using vector graphics.
Select all the circles in powerpoint, right click and 'save as a picture'. Use .emf (windows metafile) format (this option was only available on my windows machine, not mac).
Open the emf file in inkscape, and save it to an 'svg' format, which is ascii and human readable.
Extract the information from the path commands.
E.g.: Each circle is represented as a path object, with a line:
d="m 36.527169,36.434607 c 0,-9.696733 9.075703,-17.551993 20.274845,-17.551993 11.194626,0 20.270329,7.85526 20.270329,17.551993 0,9.69264 -9.075703,17.552246 -20.270329,17.552246 -11.199142,0 -20.274845,-7.859606 -20.274845,-17.552246"
Here, the (x,y) following the 'm' character is the center of the circle, and the 12 (x,y) pairs following 'c' denote a 4-segment polybezier curve in which pairs 3,6,9,12 are the four compass points. Therefore in the above object, this is not a circle but an ellipse with axes ~ 20.27 and 17.55.

Color selection for matplotlib that prints well

I am using pandas and matplotlib to generate bar-graphs with lots of bars.
I know how to cycle through a list of selected colors (How to give a pandas/matplotlib bar graph custom colors).
The question is what colors to select so that my graph prints nicely on a paper (it is for a research paper). What I am most interested in is sufficient contrast between the columns and a selection of colors that looks pleasant. I would like to have multiple colors instead of gray-scale or single-hue colorschemes.
Are there any predetermined schemes to select from that people use?
So your requirements are "lots of colors" and "no two colors should map to the same grayscale value when printed", right? The second criteria should be met by any "sequential" colormaps (which increase or decrease monotically in luminance). I think out of all the choices in matplotlib, you are left with cubehelix (already mentioned), gnuplot, and gnuplot2:
The white line is the luminance of each color, so you can see that each color will map to a different grayscale value when printed. The black line is hue, showing they cycle through a variety of colors.
Note that cubehelix is actually a function (from matplotlib._cm import cubehelix), and you can adjust the parameters of the helix to produce more widely-varying colors, as shown here. In other words, cubehelix is not a colormap, it's a family of colormaps. Here are 2 variations:
For less wildly-varying colors (more pleasant for many things, but maybe not for your bar graphs), maybe try the ColorBrewer 3-color maps, YlOrRd, PuBuGn, YlGnBu:
https://www.flickr.com/photos/omegatron/7298887952/
I wouldn't recommend using only this color to identify bar graphs, though. You should always use text labels as the primary identifier. Also note that some of these produce white bars that completely blend in with the background, since they are intended for heatmaps, not chart colors:
from matplotlib import pyplot as plt
import pandas, numpy as np # I find np.random.randint to be better
# Make the data
x = [{i:np.random.randint(1,5)} for i in range(10)]
df = pandas.DataFrame(x)
# Make a list by cycling through the colors you care about
# to match the length of your data.
cmap = plt.get_cmap('cubehelix')
indices = np.linspace(0, cmap.N, len(x))
my_colors = [cmap(int(i)) for i in indices]
# Specify this list of colors as the `color` option to `plot`.
df.plot(kind='bar', stacked=True, color=my_colors)
And these are the new guys:
In 1.5 matplotlib will ship with 4 new rationally designed color maps:
'viridis' (default color map as of 2.0)
'magma'
'plasma'
'inferno'.
The process of designing these color maps is presented in A Better Default Colormap for Matplotlib | SciPy 2015 .
The tool developed for this process can be installed by pip install viscm.
I would suggest the cubehelix color map. It is designed to have correct luminosity ordering in both color and gray-scale.
I am not aware of predetermined schemes. I usually use a few colours for publication plots. I mostly take two things into consideration when choosing colours:
Colour-blindness: this page on wikipedia has lots of good info about choosing colours that are distinguishable to most color-blind people. If you notice on the "tips for editors" section, once you take the guidelines into account there are only a few sets of colours available. (A good rule of thumb is to never mix red and green!) You can also use the linked colour-blind simulators to see if your plot would be well visible.
Luminance: most of the journals in my field will publish in B&W by default. Even though most people read the papers online, I still like to make sure that the plots can be understood when printed in grayscale. So I take care to use colours that have different luminances. To test, a good way is to just desaturate the image produced, and you'll have a good idea of how it looks when printed in grayscale. In many cases (particularly line or scatter plots), I also use other things than colour to distinguish between sets (eg. line styles, different markers).
If no colours are specified in matplotlib plots, it has a default set of colours that it cycles through. This answer has a good explanation on how to change that default set of colours. You can customise that to your preferred set of colours, so the plots would use them in turn.

How to create a sidebar with latex?

I need to make a journal, and I want to have a "recommended books" on the side of the page within the last page of the journal, but I couldn't find anything that would give me this result. I'm already using multicols package for the content and i cant see how a graphicx package would help me out.
I want to have a nice blue background with rounded corners too, help is welcome ^^.
If you are already using multicol, just make it another column and draw a box around it with the usual techniques. Maybe not the fanciest solution, but it seems like it should work. Use \newcolumn in the multicol environment to put the sidebar in its own column. For your fancy boxes, try the fancybox package. With it, you can draw boxes with rounded corners.
On the other hand, this guy gets super fancy and uses the TikZ package to get colors and all sorts of stuff.

Latex font color

I'm trying to typeset a document I'm working on.
Currently I'm trying to format a piece of text such that the text consists of two colors: a fill color and a line color. In this way the header should pop out more.
I found \psset with options such as linecolor and fillcolor, but I can't get it to work. Can someone provide an example of how I could do this?
Just providing a color using the color-package is no problem, but also not what I want because using this package I can only provide a single color for a piece of text.
Maybe this is what you're looking for: Contour package. Here's the doc containing examples.

Resources