Core-Plot, is there an automatic way to manage the amount of numbers on the axis? - objective-c

As seen on the picture below the x-axis is very crowded in this example. I do know that the scale can be changed in Core-Plotr via:
axisSet.xAxis.majorIntervalLength = CPTDecimalFromFloat(1.0f);
...so it will make it easier to read.
My question is if there is a way to automate the scaling of the axis so when it get too crowdy the axis label change to continue to be readable?
I guess that one way is to check the number of data points and change via code but it would be convenient if it is available via Core-Plot.
Here is a picture that shows my test graph:
When is get at this stage i would like to change it so it shows every 5th number and then every 10th etc.

Try the CPTAxisLabelingPolicyAutomatic labeling policy. There's a demo in the Plot Gallery example app that shows all of the available labeling policies.

Related

Highlighting a part of a series in Candles chart

In my project, I use Apexcharts to display a candle bars chart. Actually, many of them. But I need to be able to highlight a certain part of the candle series on the chart. I couldn't find a way in the docs. Maybe there is, but not that straight, like maybe splitting the series in two and displaying them with different colors?
The latter, though, I've tried and it looks like it breaks the chart, because they dont not even look like a single series anymore, with weird offsets and missing candles.
Can someone at least give a hint how to achieve highlighting on a series?

How to smooth every plot in GNUplot?

I have a script where I do a lot of plots of a couple of data files. Now, I want to smoothen the curves with smooth csplines.
Unfortunately, I would have to manually add this to every single plot command, which is neither beautiful, nor very elegant (and harder to maintain).
So my question is: Is there a way to set something somehow or any workaround so that I automatically smooth every plot?
Thank you guys in advance,
BUFU
No, you cannot set the smoothing globally. In order to improve maintenability you can use macros to define the options in one place an use them for every plot:
set macros
opt = "smooth csplines"
plot 'a' #opt

How to change colors of function plots in Tensorboard?

I'm trying to compare different learning-rate-decays using Tensorflow. Therefore I visualize the cost functions in Tensorboard ('EVENTS'-tab). My problem is that the different plots of the functions are in very similar colors making it hard to compare them. Is there any possibility to change those colors?
Just create different summary writes with different log files for each learning rate. Then launch the tensorboard tool using:
tensorboard --logdir=tag1:/path/to/summary/one,tag2:/path/to/summary/two
There's currently no way to change those colors, but a recent release has made the colors more differentiated. Try updating and seeing if that helps.
This is very far from an actual solution, but in case someone only wants to change the colors for a screenshot in a paper or presentation its a quick workaround:
Open your browser dev tools (F12)
Search for the color code you want to change (the default orange is #ff7043) and replace it with the color you want
As suggested here, creating (and pointing tensorboard to) a symlink of a run's logdir is one workaround to change the color used to plot that run.

How to see details of a figure like it is shown before it is saved in matplotlib?

I find several links(e.g. this one) about the size or resolution of figures plot by matplotlib.
Like , we can use pl.show(), and zoom in or zoom out before we save the figure. We can see as many details as possible in this way.
However, after we specify a dpi value in pl.savefig and save the whole figure*(png format), the details like above are lost.
Even we use a svg format, the improvement is limited like
What is the best way then? After we save the figure, can we display it and adjust it like pl.show()?
However, after we specify a dpi value in pl.savefig and save the figure, the details are lost.
The details aren't lost if you save the figure as pdf or svg, they are vector formats. Just try opening one of them in e.g. Inkscape, and you can select or edit every individual line segment.
The difference between zooming in a Matplotlib window or a saved figure is that the line width isn't re-scaled when you zoom in e.g. the saved PDF (which of course is a good thing).
After we save the figure, can we display it and adjust it like pl.show()
If that's what you want, why not simply re-run your Python script?

Photoshop jsx image grid

What I am ultimately trying to do is to create a grid of images for print that are minor variations of the same thing (different text is all). Looking through online resources I was able to create a script that changes the text and exports all of the images necessary (several hundred). What I am trying to do now is to import all of these images into a new photoshop document and lay them all out in a grid and I can't seem to find any examples of this.
Can anyone point me in the right direction to place a file at a specific coordinate (I'm using CS5 and have the design suite so if there is a way in illustrator to do this quickly...)?
Also, I'm open to other ideas on how to do this (even other programs) easily. It's for labels so the positioning on the sheet has to be pretty precise...
The art layer object has a translate() method that takes delta x and y params. You'll need to open each image, copy it to the target document, get its current location (using artLayer.bounds) and do the math to find the deltas to position it where you want it. Your deltas can be in pixels so you'll get plenty of precision.
Check out your 'JavaScript Scripting Reference' pdf in your Adobe install directory for more details.
Ok I'm marking Anna's response as the answer because though I didn't fully test it, it seems like it should work and answers the original question with jsx. However I'm also leaving my final solution in case anyone else runs across this with the same issue and may prefer this method as well.
What I ended up doing instead is using InDesign. I figured out that it has a grid option that lets you import a number of files and place them all in an equal grid in a single command. This is almost exactly what I was looking for, except that it leaves a small border/margin in between the columns and grids and mine were designed to meet exactly.
I couldn't figure out how to make it not have the border (I have very little experience with InDesign, it may be possible). However I was able to select all my images and scale them uniformly to be the correct size, then I just selected each column and dragged it over to snap to the adjacent column and the same with rows...